Raspberry Pi 5!

OUCH Getting GoPiGo3 python egg files built/installed on Bookworm may be a long haul requiring @cleoqc and an MR decision on the value of supporting the Pi5 (or even Bookworm on Pi4).

Python continues to change in ways that break system designs (virtual-environment default now) and system install scripts (setup.py deprecated)

Previously the GoPiGo3 install broke by the deprecation of Python 2, requiring minor install script changes at strategic points, but the advance to Python 3.11.2 with stricter package management seems to require deeper install design changes.

I have seen a few hints that user permissions may have been altered in Bookworm. Driving the GoPiGo3 hardware by a non-privileged user was carefully crafted by DI by adding the pi user to privileged groups, and adding rules for accessing the GoPiGo3 hardware. I cannot get far enough in the install to test for any changes there but I’m pretty sure the bcm2835-gpiomem rule won’t work on the Pi5 since the RP1 replaces the BCM2835 chip.

The GoPiGo3 sensors and software I2C depend 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.

The DI Sensors and I2C depend 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'?

Seems like DI implemented the software I2C using WiringPi (to support devices which require clock stretching like the DI IMU). This would need to be rewritten or changed to only support hardware I2C on the Pi5.

DI already removed the main GoPiGo3 dependency on wiringpi - switching to pigpio back in 2020:

2 Likes

The $400 Create3 with native ROS 2 interface and native auto-docking is looking inviting (but only after a version of ROS 2 for Bookworm on Pi5 emerges…)

The only real need for a Pi5 on the GoPiGo3 is to run native ROS 2 SLAM faster or with greater precision, and I am perhaps the only person in the world that wants “autonomous ROS 2 mobile robot” to not use the main raison d’etre of ROS - distributed processing.

2 Likes

I’m booting up Bookworm for the first time today in order to assess the “damage” and see what will be involved to port.
Any thing you discover is going to be very helpful indeed.

3 Likes

Ok - well I just managed to get read_info to fly:

pi@bookworm:~ $ python3 /home/pi/Dexter/GoPiGo3/Software/Python/Examples/Read_Info.py
Manufacturer    :  Dexter Industries
Board           :  GoPiGo3
Serial Number   :  56ECD67E5152415447202020FF192614
Hardware version:  3.x.x
Firmware version:  1.0.0
Battery voltage :  10.554
5v voltage      :  4.981

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...

This is Bookworm on a Pi4 - don’t know how “on a Pi5” will be…

Of course I2C is out of the question without wiringpi:

pi@bookworm:~ $ python3 /home/pi/Dexter/GoPiGo3/Software/Python/Examples/easy_Distance_Sensor.py
No module named 'wiringpi'
Importing di_sensors error: No module named 'wiringpi'
Traceback (most recent call last):
  File "/home/pi/Dexter/GoPiGo3/Software/Python/Examples/easy_Distance_Sensor.py", line 44, in <module>
    my_distance_sensor = gpg.init_distance_sensor()
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/gopigo3-1.3.2.1-py3.11.egg/easygopigo3.py", line 1043, in init_distance_sensor
ImportError: di_sensors library not available

I manually installed spidev and smbus-cffi, removed those from the setup requires, to finish the install:

=== also depends on smbus-cffi

pip install smbus-cffi --break-system-packages

cd /home/pi/Dexter/lib/Dexter//RFR_Tools/miscellaneous/
sudo nano setup.py  

        install_requires=[ 'pyserial', 'python-periphery'],
)
#       install_requires=['smbus-cffi', 'pyserial', 'python-periphery', 'wiringpi'],

# ==== 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

This was the beginning part of my setup:

**===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



# ==== 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?"

2 Likes

Wow you managed some motor control!?!?!!
Kudos to you!

3 Likes

I commented everything associated with RPI_1SW and wiringpi out of di_i2c.py and managed to get the distance sensor working using (bus=“RPI_1”), and easy distance sensor using (port=“RPI_1”) and ultrasonic_sensor works without modification:

pi@bookworm:~/systest/i2c $ python test_dist_sensor.py 
EasyGoPiGo3 obj created
distance sensor created
dist: 494 mm
easy distance sensor created
dist: 501 mm

modified easy_distance_sensor.py and distance_sensor.py to default to hardware I2C RPI_1 and rebuilt di_sensors egg:

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

and with the changes to di_i2c.py the ultrasonic sensor example also works:

pi@bookworm:~/systest/i2c $ python ~/Dexter/GoPiGo3/Software/Python/Examples/Grove_US2.py
Sensor 1:    0mm   Sensor 2:  649mm
Sensor 1:    0mm   Sensor 2:  895mm
Sensor 1:    0mm   Sensor 2:  653mm
Sensor 1:    0mm   Sensor 2:  649mm
Sensor 1:    0mm   Sensor 2:  653mm

Since I don’t have a working DI IMU anymore, and not planning to use the BNO055 IMU in future projects, I’m not investigating how to rewrite the bit-banging software I2C that used wiringpi.

I have tested my “somewhat fried” MPU9250/6050 using the hardware I2C and

# FILE: imu_basic.py
#
# REQUIRES:  
#   pip install imusensor --break-system-packages
#   pip install easydict --break-system-packages
#

import os
import sys
import time
import smbus

from imusensor.MPU9250 import MPU9250

address = 0x68
bus = smbus.SMBus(1)
imu = MPU9250.MPU9250(bus, address)
imu.begin()

while True:
	imu.readSensor()
	imu.computeOrientation()

	# print ("Accel x: {0} ; Accel y : {1} ; Accel z : {2}".format(imu.AccelVals[0], imu.AccelVals[1], imu.AccelVals[2]))
	# print ("Gyro x: {0} ; Gyro y : {1} ; Gyro z : {2}".format(imu.GyroVals[0], imu.GyroVals[1], imu.GyroVals[2]))
	# print ("Mag x: {0} ; Mag y : {1} ; Mag z : {2}".format(imu.MagVals[0], imu.MagVals[1], imu.MagVals[2]))
	print ("roll: {0} ; pitch : {1} ; yaw : {2}".format(imu.roll, imu.pitch, imu.yaw))
	time.sleep(0.1)

The Roll values seem to be reported correctly even though I could not get the device to calibrate successfully. I’m planning on buying a new MPU9250 ($15) to replace the DI IMU on Dave.

2 Likes

This is what Pimaroni says about my Pi-5 order:

Translation:

God Himself Only Knows when I will get mine.

Hopefully by the end of November, otherwise I spent $120+ for nothing.

2 Likes

mine is same “sequenced” at pishop.us

hope your’s gets to you in time

2 Likes

Some interesting Pi4 vs Pi5 Disk I/O benchmarking I noted which is very applicable to standard GoPiGo3 robots without USB or NVME SSD media:

  • SanDisk Ultra SD Cards are roughly 3x faster random write, and 4x faster random read on Pi4
    than the cheapest SD card tested (that came with Pi5)
2 Likes

FYI. I got mine a couple of days ago.

4 Likes

First thoughts?
I got mine, but haven’t had a chance to play with it yet.
/K

3 Likes

I have not received either of my two ordered yet, but thoughts - I’ve been experiencing lots.

The Pi5 is a game changer for autonomous robots in computational capability, but also in the necessary robot intrinsic abilities to take advantage of the increased computational capability.

Most important needed change in the robot intrinsic ability is the power capacity, power isolation, and power distribution needed to support the diverse needs of a self-contained robot.

Simple robots can “get by” with a simple power system with “enough capacity” to operate the simple robot for the duration of a “shortened attention span” of a well controlled education curricula.

Simple robots can even suffice in a cloud computing environment, but there the Pi5 is not needed.

Carl has achieved a great number of features with his Pi3B+ processor and 7 hour “playtime”. The more I try to push ROSbot GoPiGo3 Dave with increased functionality (2-D mapping, localization, path planning with obstacle avoidance) on a Pi4 with 45-75min playtime (at 100% load and 73C temp), the more evident the GoPiGo3 power system simplicity and Pi4 processor are inconsistent with where I want to get.

Another aspect of the GoPiGo3 simplicity has been critical - the lack of self-protection in the form of an intrinsic bumper and or side and back distance sensors. This causes increased computational load, but most importantly can result in the bot blinking out of existence when an obstacle collision stalls the motors.

My Pi5 thoughts are strongly considering a Create3 base (which would bring a different set of limitations that community has screamed about - message bandwidth to/from the external processor, Pi5 in my plan).

I have learned so much in using the GoPiGo3 over the last seven years, and I was able to embody a lot of functionality in Carl through brute force computing. To take advantage of the robot functionality other people have created, I believe I need ROS 2, the Pi5, and the Create3 robot base.

I also need get over my avoidance of simulation for code development, and eventually I will need to get over my ban of off-platform processing with some sort of “opportunistic off-loading for non-intrinsic functionality”.

3 Likes

@cyclicalobsessive DM’d me that they had stock at Digikey.

When I got there they had 67 8 gig left at $80 each, (max one but you can place multiple one-of orders), and they were completely out of stock of the 4 gig.

Within about five minutes the available stock had dropped to 65. :wink:

I don’t how many they have in stock now, but I grabbed two while the grabbing was good.

P.S.
I cancelled my order at PiShop and was given a full refund on both orders in a matter of hours.

I was “sequenced”, but at the rate it was going I felt like the sequencer was an 8k mainframe from the '50s! :wink:

2 Likes

My 8GB Pi5 just arrived from DigiKey.

Got a note from PiShop that they are starting to ship 4GB Pi5s this week. My order still shows “sequenced”.

2 Likes

Raspberry Pi 5 FIRST BOOT

WOW WOW WOW!!!

Raspberry Pi 5 with PiOS Bookworm automatically configured my USB speaker!!!

Since it doesn’t have an audio jack, I was expecting to have to learn how to remap all the audio from default HDMI, but someone at RaspberryPi was thinking about my “headless” use case.

sudo apt install espeak-ng
espeak-ng "hello, can you hear me now?"

and it just works.

3 Likes

Getting ROS 2 to “just work” on the Pi5 is a whole nother ball game.

I managed to get ROS 2 Humble Desktop/Ubuntu 22.04 running in a Docker container
AND get the listener on the Pi5 to “hear” topics created by HumbleDave, so the basic ROS 2 is working and communicating.

Next I have to learn how to build a custom Docker container with the ROS 2 Humble Desktop plus the nav2 package and whatever else I need installed on ROS to try off-board mapping/localization/navigation - meaning “Distributed ROS 2 Nodes”. This breaks my “self-contained autonomy” concept but in the interest of learning - I’m “in the game”.

BTW @este some folks are running ROS Noetic in a Docker container on their windows boxes, and could also run on any PiOS or Ubuntu you want to run on “RosGo” - but don’t ask me how they do it - I have no clue.

2 Likes

I was wondering when a Docker container would make an appearance in your journey!

I am also intrigued by

have you got a web link to more info?

3 Likes

lots actually

and the official:

https://wiki.ros.org/docker/Tutorials/Docker

3 Likes

Figured that one today! What a bag of worms, having to learn to rebuild Docker containers.

It just is not the same as having ROS installed on the machine. It is another inconvenient layer.

3 Likes

Really rough first test to compare running SLAM-Toolbox asynchronous mapping -

 htop cpu%         | 5min load/4 cores:
- Pi5: 1.5 - 5.3%  |  0% ???
- Pi4:  2 - 15%    |  2% total  

At first seeing that the Pi5 was using 25% less to 300% less of RPi processor(s) seemed really significant, but I decided to recheck the all up total on the Pi4 (these are cpu% and cpu%/4 for total Pi processor):

    htop cpu%               =  percent of whole Pi4
GoPiGo3 Node: 36%           = 9% of Pi4
Odometry Node: 11%          = 3% of Pi4
LIDAR Node: 3%              = 1% of Pi4
Joint/Robot State Nodes: 3% = 1% of Pi4
Teleop_key: 1%              = 0% of Pi4
____________________
  54% cpu                   = 15% of Pi4
async slam: 15%             = 4% of Pi4
--------------------------
  69% cpu                   = about 19% of Pi4

Wait! GoPiGo3, running LIDAR and SLAM async, only takes 20% of a Pi4??

Who needs a Pi5? Pi4 on a ROS GoPiGo3 has headroom

Like I said - real rough.

3 Likes