Hello guys! I just got my GoPiGo3 and I was about to test the basic movements. I updated the firmware to the latest version but the error that I got suggests that I should downgrade to 0.3.x. Is this downgrade necessary or is there a different way to use the movement commands with firmware 1.0.x?
Hardware: Raspberry Pi 3B+ with Raspbian Buster
Error:
(venv) pi@gopigo:~/gopi/code_v1 $ python3 MovementTest.py
Loading library without distance sensor
FATAL ERROR:
To update the firmware on Raspbian for Robots you need to run DI Software Update and choose Update Robot
Traceback (most recent call last):
File âMovementTest.pyâ, line 7, in
gpg = EasyGoPiGo3()
File â/home/pi/gopi/venv/lib/python3.7/site-packages/easygopigo3.pyâ, line 129, in init
raise e
File â/home/pi/gopi/venv/lib/python3.7/site-packages/easygopigo3.pyâ, line 123, in init
super(self.class, self).init()
File â/home/pi/gopi/venv/lib/python3.7/site-packages/gopigo3.pyâ, line 232, in init
% (FIRMWARE_VERSION_REQUIRED, vfw))
gopigo3.FirmwareVersionError: GoPiGo3 firmware needs to be version 0.3.x but is currently version 1.0.0
I have never, and I mean NEVER EVER, seen an error asking for a firmware DOWNGRADE.
Are you sure your 'bot didnât get into someoneâs stash of weed or down an entire bottle of âHappy Jackâ Daniels?Â
(You gotta tell me what you did to make it do that - it is just too strange to believe. . .)
How did you install the libraries? The path youâre using: /home/pi/gopi/venv/lib/python3.7/site-packages/easygopigo3.py,
is absolutely unusual.
Are you using GoPiGo OS? (Based on that path, my bet is âNoâ)
Unless you are doing something particular that has a special requirement for something else, (like running ROS over Ubuntu), GoPiGo O/S is the way to go. You download it, flash it to a waiting SD card, pop it into your GoPiGo-3, and âbadda-bing, badda-boom!â, youâre ready to go.
After installing Raspbian Buster and made a folder called gopi with an virtual environment venv. In this environment I am installing everything that I need for my work with python.
I just fixed a problem with my environment where the pi couldnât find python modules that where install outside the environment. Other then that, I donât know what could cause this error.
The code I wanted to run is just the default gopigo tutorial:
import time
from easygopigo3 import EasyGoPiGo3
gpg will be the GoPiGo3 object.
gpg = EasyGoPiGo3()
print(âMove the motors forward freely for 1 second.â)
gpg.forward()
time.sleep(1)
gpg.stop()
Why are you doing such a customized installation with virtual environments?
The GoPiGo libraries expect things to be installed in certain places an to be run by the âpiâ user. I do not know if it supports virtual environments.
Letâs take a step back and why donât you give us âthe big pictureâ. What is it that you want to accomplish overall, and what are the requirements for it?
I am writing my bachelors degree and my job is to build a robot that is able to detect lanes, drives through them and avoids certain obstacles. My hardware is the raspberry pi 3b+ with the raspberry pi cam v2 and the gopigo3.
I never intended to use Buster in the first place. I started using Raspbian Bullseye but that bugged the s*** out of the Raspberry Pi Cam. So I switched to the provided microSD and used the OS that is preinstalled on it (GoPiGo OS, i guess). That resulted in an OS that couldnât be updated and that I couldât install anything on it (i donât really know why). So I installed Buster, which my cam really likes, but now the GoPiGo hates me.
I donât know what was on the SD card you received. If you bought it recently, it should have been GoPiGo OS.
================
GoPiGo O/S. right out of the box, is designed to be a stand-alone access point that can be used by teachers in the classroom.
You can set up the GoPiGo to use a local network.
Instructions on how to do that can be found here:
IMPORTANTÂ WARNING
Once you get the GoPiGo connected to the network, do NOT update the software as that may cause the robotic functionality to fail.
If you ABSOLUTELY MUST update the software, you must open a terminal window first and apt-mark hold pigpio pgpio-tools pigpiod to prevent them from being touched. I am currently researching this issue and I cannot guarantee that this wonât affect the robot somehow.
If you do update the robot, and you have problems that didnât exist before updating, please post here and let us know.
curl -kL dexterindustries.com/update_sensors | bash
I am not using Dexter sensors, but I got this error before âNo module named âdi_sensorsâ
Importing di_sensors error: No module named âdi_sensorsââ
curl -kL dexterindustries.com/update_gopigo3 | bash -s â --user-local --bypass-gui-installation
I got this error:
TEST FAILED: /home/pi/.local/lib/python3.7/site-packages/ does NOT support .pth files
error: bad install directory or PYTHONPATH
You are attempting to install a package to a directory that is not
on PYTHONPATH and which Python does not read â.pthâ files from. The
installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
/home/pi/.local/lib/python3.7/site-packages/
and your PYTHONPATH environment variable currently contains:
ââ
I âfixedâ that with this: export PYTHONPATH="/home/pi/.local/lib/python3.7/site-packages
After that the virtual environment installation went through with no errors.
Now when I am testing the movement of the GoPiGo, I get this error:
from easygopigo3 import EasyGoPiGo3
Traceback (most recent call last):
File ââ, line 1, in
File â/home/pi/.local/lib/python3.7/site-packages/gopigo3-1.3.0-py3.7.egg/easygopigo3.pyâ, line 13, in
except ImportError:
File â/home/pi/.local/lib/python3.7/site-packages/gopigo3-1.3.0-py3.7.egg/easysensors.pyâ, line 1, in
ImportError: cannot import name âMutexâ from âI2C_mutexâ (/home/pi/gopi/venv/lib/python3.7/site-packages/I2C_mutex.py
To be fair, I2C was disabled, but after the reboot this beautiful error is back:
(venv) pi@gopigo:~/gopi/code_v1 $ python3 MovementTest.py
Loading library without distance sensor
FATAL ERROR:
To update the firmware on Raspbian for Robots you need to run DI Software Update and choose Update Robot
Traceback (most recent call last):
File âMovementTest.pyâ, line 7, in
gpg = EasyGoPiGo3()
File â/home/pi/gopi/venv/lib/python3.7/site-packages/easygopigo3.pyâ, line 129, in init
raise e
File â/home/pi/gopi/venv/lib/python3.7/site-packages/easygopigo3.pyâ, line 123, in init
super(self.class, self).init()
File â/home/pi/gopi/venv/lib/python3.7/site-packages/gopigo3.pyâ, line 232, in init
% (FIRMWARE_VERSION_REQUIRED, vfw))
gopigo3.FirmwareVersionError: GoPiGo3 firmware needs to be version 0.3.x but is currently version 1.0.0
In my virtual environment the module EasyGoPiGo3 isnât available
(venv) pi@gopigo:~/gopi/code_v1 $ python3
Python 3.7.3 (default, Jan 22 2021, 20:04:44)
[GCC 8.3.0] on linux
Type âhelpâ, âcopyrightâ, âcreditsâ or âlicenseâ for more information.
import EasyGoPiGo3
Traceback (most recent call last):
File ââ, line 1, in
ModuleNotFoundError: No module named âEasyGoPiGo3â
@superbam,
You are doing your work on the robot itself, arenât you? Youâre not trying to simulate the robot on a different system?
I am struggling to understand the need for a virtual environment. If you download and install the latest GoPiGo O/S and configure it to work on your local network as noted above, it should work wonderfully. It seems to me that you are making things needlessly complex for reasons that I donât understand.
Before you try getting complicated, try the simple method, use the software as-is, and see what you accomplish. Then try the more complex methods.
Yes, the robot should do all the calculations and computer vision.
Well, I am using the venv to keep the code clean and seperate from future projekts or files. The question is if switching to GoPiGo OS would help me in the long run or if I could make it work with some tweaks
The best way to keep projects separate is to maintain separate media - one SD for this project, another SD for another, and so on.
This way you avoid all the complications of running virtual environments.
In my case, I want to have my cake and eat it too - separate environments, but access to a central project file store - so what I did was to take a large, (500 gb), external SSD, (large capacity, small size), and make it into a multiple-boot device with more than one operating system.
Though that might be useful in the long run, I would suggest you start with a simple setup - a high-quality 32gb SD card by SanDisk, a copy of GoPiGo O/S, and see what happens.
@jimrh, EVERYONE but you and I use virtual environments. It is the recommended approach to allow various configurations. Letâs say one test needs OpenCV3.x and one needs OpenCV4.x, or one needs Python 3.2 and another 3.5 or better.
RobertLucian used to work with the venv folk to get setup. It works, we just donât know how to do it.
This would be useful, but he may actually have real work to do thatâs on a schedule.
Bite the bullet, use the system as-is, and use different SD cards instead of virtual environments.
Maybe thatâs not as âcoolâ or up-to-date as venv, but it works.
IMHO, right now he should concentrate on âit worksâ than getting venv to work on an operating system (buster) that may have itâs own issues.
That is, unless his project has a hard dependency on using a virtual environment - as in the project will either loose massive credit or not be acceptable without it.
My Opinion - GoPiGo OS might give you problem when updating the OS.
There is another way to create the virtual environments though - that is get the GoPiGo3 installed in the system level, then create your venv with copy system.
Thank you very much, you two! I appreciate both of you. Since the time is ticking for me and my degree, I have to find a solution that is as less time consuming as possible. I donât really know if the venv is really necessary, but since itâs the ârightâ way I would consider keeping it. I need to find a fast way to get the gopigo going.
@cyclicalobsessive you mentioned a way to get the venv running a different way? I have to say though, that I had to fix a missing module error. I needed to remove libs from outside the venv and install it back inside the venv. So if I remove the venv and start it back up. This error would need fixing again, I guess
Stock 3.0.1 GoPiGo OS with @jimrh guidance on how to allow updating
or
install GoPiGo3 software over the Legacy Buster based PiOS (âLegacy PiOSâ available under other in the latest official Pi Imager application) the follow my how to with tests for proper install
Setup GoPiGo3 Over Legacy (2021-12-02) PiOS
(with VNC setup for Mac OS Remote Desktop)
(and installation tests) Setup_GoPiGo3_Over_PiOS_Legacy.txt (6.3 KB)
Â
Note: The gopigo3 OS route will have a version of TFlite on it and is the âofficialâ OS now for GoPiGo, but it may have a problem when a user updates the OSâŚ
It also has the advantage that @jimrh is running it so might be able to reproduce any problems you encounter.
Edited:
Never mind. yes I can repro this. Something changed with Buster and Python 3.7.
Honestly, in the Pi community, not too many people use virtual environments as itâs so easy to just swap SD cards - which become your venv in a sense. It would be completely different with a full-fledged computer though. I use venv all the time on my laptop, but never on a Pi.
Anyway, Iâll take a look at this but I canât give you a time or date as Iâm totally swamped at the moment.
What I just canât get my head around is the fact, that my files arenât up to date. But I canât get them to be updated . I remember the first time I used this command: âsudo curl -kL dexterindustries.com/update_gopigo3 | bashâ I used it in my home directory and not in my venv⌠Maybe this is the reason why I canât update them in my venvâŚ