/
Setup_PiOS_upgrade_bookworm.txt
350 lines (250 loc) · 10.6 KB
/
Setup_PiOS_upgrade_bookworm.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
# Headless Setup 64-bit PiOS Bullseye then upgrade to Bookworm
As Of: 8 OCT 2023
** Get Latest Raspberry Pi Imager (will list latest OS options) **
https://www.raspberrypi.com/software/
**Check for latest PiOS:**
- [u]https://www.raspberrypi.com/software/operating-systems/[/u]
**Check for latest GoPiGo3 Software:**
- Check last commit date at [u]https://github.com/DexterInd/GoPiGo3[/u]
- Check last commit date at [u]https://github.com/DexterInd/DI_Sensors[/u]
**Write Latest 64-bit PiOS to SDcard with Raspberry Pi Imager**
- Choose OS -> Other OS -> 64-bit Pi OS Desktop
- Preconfigure WiFi SSID/PW, user, pw, locale, in Imager
=== disable ipv6
Browse the disk (boot)
Rt Click on System Volume Information->Open Terminal Here
cd ..
nano cmdline.txt
add to end of line/file:
ipv6.disable=1
save, exit editor
**First SSH:**
- ssh pi@X.X.X.X
- (If needed: ssh-keygen -R X.X.X.X , then try ssh again)
- pw: your password
- To stop incessant message:
```
$ sudo mv /usr/share/piwiz/srprompt.wav /usr/share/piwiz/srprompt.wav.bak
```
**Update OS**
```
$ sudo apt update
$ sudo apt full-upgrade
$ sudo reboot
```
**=== Configure add VNC**
$ sudo raspi-config
- (You can exit menus by using Tab key, move to Finish, enter key)
- InterfaceOptions:Legacy PiCamera-> enable
- InterfaceOptions: VNC -> VNC Server?-> Yes
- InterfaceOptions: SPI -> yes
- InterfaceOptions: I2C -> yes
- DisplayOptions->VNC Resolution -> 1920x1080
- SystemOptions:BootOptions:Desktop GUI, requiring user to login, Return
- Tab to Finish, reboot now? yes
** UPGRADE TO BOOKWORM
- mod /etc/apt/sources.list
deb http://deb.debian.org/debian bookworm main contrib non-free
deb http://security.debian.org/debian-security bookworm-security main contrib non-free
deb http://deb.debian.org/debian bookworm-updates main contrib non-free
#deb http://deb.debian.org/debian bullseye main contrib non-free
#deb http://security.debian.org/debian-security bullseye-security main contrib non-free
#deb http://deb.debian.org/debian bullseye-updates main contrib non-free
- sudo apt update
- sudo apt upgrade
answered N to upgrade conf
- sudo apt dist-upgrade
(answered Y to upgrade useradd)
- sudo apt autoremove (to remove obsoleted pkgs)
**===Install GoPiGo3 software**
```
$ git clone http://www.github.com/DexterInd/GoPiGo3.git /home/pi/Dexter/GoPiGo3
$ sudo curl -kL dexterindustries.com/update_tools | bash -s -- --system-wide --use-python3-exe-too --install-deb-debs --install-python-package
$ sudo apt install -y --no-install-recommends python3-curtsies
$ git clone https://github.com/DexterInd/DI_Sensors.git /home/pi/Dexter/DI_Sensors
# === pigpiod
wget https://github.com/joan2937/pigpio/archive/master.zip
unzip master.zip
cd pigpio-master
make
sudo make install
cd ..
rm master.zip
mkdir config
cd config
wget https://raw.githubusercontent.com/slowrunner/ROS2-GoPiGo3/main/utils/pigpiod.service
sudo cp pigpiod.service /etc/systemd/system
sudo systemctl enable pigpiod.service
sudo systemctl start pigpiod.service
systemctl status pigpiod.service
wget https://raw.githubusercontent.com/slowrunner/ROS2-GoPiGo3/main/utils/99-com.rules
# === setup RFR_Tools
sudo git clone https://github.com/DexterInd/RFR_Tools.git /home/pi/Dexter/lib/Dexter/RFR_Tools
sudo apt install -y libffi-dev
cd /home/pi/Dexter/lib/Dexter//RFR_Tools/miscellaneous/
sudo nano di_i2c.py -> comment out all RPI_1SW, wiringpi, class DI_I2C_RPI_SW
sudo python3 setup.py install
The GoPiGo3 depends on wiringpi , which has not been updated for the RP1 I/O controller of the Raspberry Pi 5 (and Bookworm). This is the major hurdle
== Details ==
I got Dexter_AutoDetection_and_I2C_Mutex-1.3.2-py3.11.egg built and installed.
GoPiGo3 depends on wiringpi which fails build/install:
Running wiringpi-2.60.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-qxc_o8le/wiringpi-2.60.1/egg-dist-tmp-9w9i89c3
/usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
.
.
File "/usr/lib/python3/dist-packages/setuptools/command/install_lib.py", line 17, in finalize_options
self.set_undefined_options('install',('install_layout','install_layout'))
File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 296, in set_undefined_options
setattr(self, dst_option, getattr(src_cmd_obj, src_option))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 107, in __getattr__
raise AttributeError(attr)
AttributeError: install_layout. Did you mean: 'install_platlib'?
=== also depends on smbus-cffi
pip install smbus-cffi --break-system-packages
sudo nano setup.py
install_requires=[ 'pyserial', 'python-periphery'],
)
# install_requires=['smbus-cffi', 'pyserial', 'python-periphery', 'wiringpi'],
# ==== GPG3_POWER SERVICE ===
cd ~
sudo cp /home/pi/Dexter/GoPiGo3/Install/gpg3_power.service /etc/systemd/system
sudo chmod 644 /etc/systemd/system/gpg3_power.service
sudo systemctl daemon-reload
sudo systemctl enable gpg3_power.service
sudo systemctl start gpg3_power.service
systemctl status gpg3_power.service
# ==== SETUP GoPiGo3 and DI_Sensors Python3 eggs
pip install spidev --break-system-packages
cd /home/pi/Dexter/GoPiGo3/Software/Python
nano setup.py
install_requires = ['pigpio']
)
# install_requires = ['spidev', 'pigpio']
sudo python3 setup.py install
cd /home/pi/Dexter/DI_Sensors/Python
sudo nano di_sensors/easy_distance_sensor.py
#def __init__(self, port="I2C", use_mutex=False):
# use hardware i2c for bookworm
def __init__(self, port="RPI_1", use_mutex=False):
sudo nano di_sensors/distance_sensor.py
#def __init__(self, bus = "RPI_1SW"):
# Use hardware i2c for bookworm
def __init__(self, bus = "RPI_1"):
"""
Constructor for initializing a :py:class:`~di_sensors.distance_sensor.DistanceSensor` class.
#:param str bus = "RPI_1SW": The bus to which the distance sensor is connected to. By default, it's set to bus ``"RPI_1SW"``. Check the :ref:`hardware specs <hardware-interface-section>` >
# use RPI_1 hardware i2c for bookworm
:param str bus = "RPI_1": The bus to which the distance sensor is connected to. By default, it's set to bus ``"RPI_1"``. Check the :ref:`hardware specs <hardware-interface-section>` for m>
sudo python3 setup.py install
# ==== Setup non-root access rules ====
sudo cp /home/pi/config/99-com.rules /etc/udev/rules.d
cp /home/pi/Dexter/GoPiGo3/Install/list_of_serial_numbers.pkl /home/pi/Dexter/.list_of_serial_numbers.pkl
# === ESPEAK-NG
sudo apt install -y espeak-ng
pip3 install py-espeak-ng --break-system-packages
espeak-ng "Am I alive? Can you hear me?"
# Install ffmpeg to allow ffplay to play tts from espeak-ng -w file
# already installed: sudo apt install -y ffmpeg
$ sudo reboot
(Note green pwr LED will be solid after this indicating gpg3_power.service is running)
(Note red/green "yellow" WiFi LED means connected to WiFi)
```
**Test GoPiGo3 Software Installation**
```
$ cd Dexter/GoPiGo3/Software/Examples
$ ./Read_Info.py
pi@64BitPiOS:~/Dexter/GoPiGo3/Software/Python/Examples $ ./Read_Info.py
Traceback (most recent call last):
File "/home/pi/Dexter/GoPiGo3/Software/Python/Examples/./Read_Info.py", line 17, in <module>
import gopigo3 # import the GoPiGo3 drivers
ModuleNotFoundError: No module named 'gopigo3'
```
python3 /home/pi/Dexter/GoPiGo3/Software/Python/Examples/LED.py <<---- Works
python3 /home/pi/Dexter/GoPiGo3/Software/Python/Examples/Servo.py <<---- WORKS!
python3 /home/pi/Dexter/GoPiGo3/Software/Python/Examples/Motor_Turn.py <<--- WORKS oh wow...
python3 /home/pi/Dexter/GoPiGo3/Software/Python/Examples/easy_Distance_Sensor.py
python ~/Dexter/GoPiGo3/Software/Python/Examples/Grove_US2.py
* check gpg3_config.json for ticks
```
$ more ~/Dexter/gpg3_config.json
* "Old GoPiGo3":
{"wheel-diameter": 66.5, "wheel-base-width": 117, "ticks": 6, "motor_gear_ratio": 120}
* "New GoPiGo3":
{"wheel-diameter": 66.5, "wheel-base-width": 117, "ticks": 16, "motor_gear_ratio": 120}
```
* Continue with test effectors and sensors
```
$ ./Motors.py
$ ./Servo.py
$ ./Grove_US2.py (with Grove Ultrasonic Ranger in AD1 for time being)
$ ./easy_Distance_Sensor.py
$ python3 ~/Dexter/DI_sensors/Python/Examples/IMUSensor.py
(Put IMU in AD1, move Grove US ranger to AD2 and
change Grove_US.py GPG.GROVE_1 to GPG.GROVE_2 two places)
```
**=== Configuring vncserver**
```
$ nano /home/pi/.vnc/config.d/vncserver-x11-virtual
```
add to file these two lines, save and exit (ctrl-x):
```
Authentication=VncAuth
Encryption=PreferOff
```
**Continuing:**
```
sudo cp .vnc/config.d/vncserver-x11-virtual /root/.vnc/config.d/vncserver-x11
sudo vncpasswd -service (set the password you want for vnc logins)
sudo systemctl restart vncserver-x11-serviced.service
vncserver -kill :1
vncserver :1 -geometry 1920x1080 -depth 24 -Authentication VncAuth -Encryption PreferOff -SecurityTypes StandardUser
```
- Use "Mac splat-k" (Command-k) to bring up "Connect to Server"
```
vnc://ip.ip.ip.ip (no port), press enter
enter vnc service password
```
**Pi will guide through setting up like a new user, just go with it**
- set timezone,
- connect to WiFi,
- set a password (I used pi user password set earlier),
- skip the OS update,
- Done
**=== Run Desktop "GoPiGo3 Control Panel"**
- asks what do you want to do? Click Execute
- Try all the buttons
**=== Run Desktop "GoPiGo3 Calibration"**
- Asks what to do: Execute
- For my bot at this speed: 66.5mm and 104.5mm WOW!! worked best
- This must because it is at 300DPS.
- I usually run my bot at 150DPS so config closer to the physical 117mm
- Save and Exit
- Check that it saved:
```
$ more ~/Dexter/gpg3_config.json
{"wheel-diameter": 66.5, "wheel-base-width": 104.5, "ticks": 16, "motor_gear_ratio": 120}
```
**=== Check File Space**
- $ df -h
**=== Check Memory**
- $ free -h
**=== Test Camera**
In an ssh terminal or terminal on the desktop:
```
$ cd ~/Dexter/GoPiGo3/Projects/RemoteCameraRobot
```
- BTW - Read the README at: [u]https://github.com/DexterInd/GoPiGo3/tree/master/Projects/RemoteCameraRobot[/u]
```
$ sudo pip3 install -r requirements.txt
$ python3 remote_robot.py
```
- Open a browser to http://<your bot's IP>:5000 (note: http **not** http[u]**s**[/u] )
- Hold down mouse button and drag it fwd to go forward,
- try dragging right/left/back etc.
**=== SHUTTING DOWN**
```
$ sudo shutdown -h now
```
- NOW WATCH FOR THE GREEN LIGHT TO START BLINKING - (may take a minute or two)
- Turn power off, recharge battery