Getting Started with GoPiGo OS Update Failure

I really appreciate the thoroughness of your answer. More information.
These are for community college NASA Fellowships.
The GoPiGo3 OS has a few too many guardrails, etc, External wireless antenna issues.
I have decided to try the path of CycloObsessive and the Setup GoPi5Go_Dave.
I have a Pi 4 and have tried the setup script with the 32-bit Bookworm. No errors. So far so good.
read_info.py works.
However, the motors won’t move.
Any tips?

3 Likes

At this point you should be able to update the system via

sudo apt-get update  <== this refreshes the list of available packages
sudo apt-get upgrade  <== This examines the system to see what needs to be updated.

If you get a bunch of errors during apt-get update, make sure you have a good network connection that’s connected to the external Internet and that the clock is set to the correct time.  You must resolve any network issues before you continue.

Apt-get upgrade will offer you a long list of things to update.  Allow it to continue.

Note that this will take a long time to complete with the time being longer or shorter depending on your network speed.&nbsp: Now is a good time to:
(One or more of the following)

  • Get a cup of tea or coffee and read.
  • Run errands for your wife/girlfriend.
  • Cut the grass.
  • Do laundry.
  • Finish homework for classes or attend that lab session you’ve been putting off forever.
  • Study for the exam that’s going to be 50% of your final grade.
  • Etc.

Once the update is complete, do the following two things:

sudo apt-get autoremove.  <== select "yes"
sudo apt-get clean

This cleans up the package cache which is a desirable maintenance thing periodically.

==============================

OPTIONAL (but highly recommended)

One of the things I recommend for systems like this, is to set up a periodic forced disk check, just in case something begins to go wrong.  It’s cheap insurance.

I am assuming that you’re using a SD card plugged into the Raspberry Pi directly.  If not, use “mount” in a terminal window to find out what the root device is.

My root device is set to:
/dev/mmcblk0p2 on / type ext4 (rw,noatime,discard)
(Yours probably won’t say “discard”.  That’s a further refinement that we can discuss later if you wish.)

In this case, “/dev/mmcblk0p2” is the device/partition the ext-4 filesystem is mounted on.  Yours should be virtually identical to mine if you are running a stock GoPiGo O/S image.

Execute the following command in a terminal window:

sudo tune2fs -c 5 -C 6 -i 5 -e remount-ro /dev/mmcblk0p2

Translation:

  • tune2fs is a utility that allows you to set various important parameters of the filesystem that define how it works.  For example, you can change the UUID if you need to, to prevent signature collisions.
  • -c 5  This sets the maximum number of times the filesystem can be mounted before forcing a fsck.  After five reboots, the filesystem will automatically check itself for any discrepancies that might have crept in.
  • -C 6  This sets the current mount count - that is, you are telling the system that the filesystem has already been mounted six times since the last fsck - and this will force a fsck the very next time the robot boots up.  (a good idea)
  • -i 5  This tells the system that, no matter how many times the filesystem has been mounted, if five days have passed without a fsck, do one now.
    This protects the system against “bit rot” if the system is left idle for days at a time.
  • -e remount-ro  This sets what happens if the filesystem fails a fsck in a way that cannot be repaired, or the system detects an error when the system is running.  This tells the system to remount the root filesystem read-only.

Note that these are very conservative settings designed to provide the maximum protection for the filesystem.

Also note that, especially for a school project or something else important, frequent periodic backups are essential as systems can go pear-shaped for seemingly unknown reasons.

At this point you can reboot the robot and prepare to have fun with it.

Next: Other things you can do.

2 Likes

The following things are ideas or suggestions that you can use to make your life easier, depending on your particular use-case.

The first and most important rule is that this is supposed to be fun.  If it stops being fun, and especially if you feel like throwing the robot against a wall, (:man_facepalming:), it’s time to take a break.

Especially if this is going to be a shared project, I would strongly suggest a GitHub repository for collaborative effort.

I would also suggest that everyone work on the robot remotely using something like Visual Studio Code.  This will allow a seamless collaborative effort among team members.  If each team member has his own robot, (and GitHub repo), Visual Studio Code is still a great idea as it make interfacing with the version control system repository, (that’s where GitHub comes in), almost trivially easy when fully set up.

Note that a discussion of both version control systems and Visual Studio Code is beyond the scope of this thread, I can refer you to a Stack Overflow article I wrote on this very subject, located here:

If you are interested in extended-length commit messages and descriptions at the original commit time, this might be useful:

Please, please, please remember that you are not alone!

Frustration and problems happen.  Share frustrations and problems here - we can help.

1 Like

NASA fellowship?  You lucky dog!

External wireless antenna issues on a Pi-4?  I have NEVER experienced that.  The only wireless issues I’ve experienced are when I’m a forgetful idiot and don’t enter the SSID or the passphrase correctly.

You’re way out of my league with that.  I usually suggest GoPiGo O/S unless there is a specific and pressing need for ROS(x).  @cyclicalobsessive would be your main contact person for that.

Are you using batteries?  What’s the battery voltage?

If the battery voltage at the controllers power connector is too low, the wheels won’t move.[1] [2]

Also, make sure the motor connectors are fully inserted.  Sometimes it takes a bit of effort for them to fully seat home.

========== Footnotes ==========

  1. Make sure you’re using the power connector on the GoPiGo controller board and not the Raspberry Pi’s power connector.

  2. If you are going to be spending a lot of time coding on the robot, battery power may not be adequate and may run out too quickly.
     
    I use a 12v laptop/NAS device power supply that looks like a brick and supplies several amps, (mine supplies 3.3 amps, but isn’t used for continuously driving the wheels).  Do not a “wall wart” as it needs to be well filtered and charger-type devices usually aren’t.  Use that to power the GoPiGo robot.
     
    If you need to test motion in a generalized way, put the robot up on a couple of pieces of wood to lift the wheels off the ground until you are ready to actually test it on the floor.

2 Likes

Interesting that you chose my Pi5 setup for a Pi4 - I have no idea if it works.

I did succeed on Pi4 for both Bookworm 32-bit desktop and Bookworm 64-bit desktop with:

2 Likes

I second this line of thought. Most often cause of “robot works, motors don’t move”

2 Likes

Very good info. Thanks. I have not spent more than an hour in the last two years on GoPiGo OS. Allowing updating is a major improvement over the now obsolete Dexter OS. I’m going to stay out of GoPiGo OS threads - really nothing to offer. I also do not like to shutdown Carl (My only bot that can run Dexter OS now).

2 Likes

This looks like what I am looking for. I only tried the Pi5 setup because I didn’t see this.
I will report back.

3 Likes

Dexter O/S?!!

Surely you mean GoPiGo O/S.  Dexter O/S is locked down so tightly that it can’t even burp.  Raspbian for Robots was better, but lacked useful features, (IMHO).

I have to confess fussing at Nicole about, somehow, being able to install the features of Dexter O/S into Raspbian for Robots, (and kept failing miserably, but I think Nicole admired my gumption).  I can’t say I was the specific cause, but not long thereafter when they released the original GoPiGo O/S, I got my wish.

@loringw
One of the things I do, (not having a Ph.D. in rocket science or robots), is use Bloxter as a sandbox for experiments if the application is something I haven’t messed with before, like the IMU unit.

What I’ll do is, (using the IMU as an example, or say I wire in a GPS), is fire up Bloxter, verify the sensors are actually sending messages, (you can do that in Bloxter without any code at all), and then experiment with trying to get reasonable readings out of them.

Once I get it behaving reasonably closely to what I expect, I “flip” to see the resultant Python code, copy-and-paste into a file, and then start working on it in pure Python.

The advantage of this to me is that:

  • It’s guaranteed to work instead of me banging my head wondering what I did wrong or if the sensor went pear-shaped.
  • I see what the actual, working code looks like.
  • And since it works like that, I have a reasonable foundation to build on.
2 Likes

Regardless of the operating system you ultimately decide to use, you would do well to find - and read - everything written by @cyclicalobsessive as he is a true wellspring of knowledge about both robotics and programming.

(One of these days I gotta’ find all his messages and posts, copy 'em all down, index them, and use them to publish a book.  It would be the definitive guide to the GoPiGo3 robot.)

His mistakes are both glorious and instructive and his successes are even more so.

Not so.  (IMHO)

IMHO your “nothing” is a lot more instructive than many people’s “something”.

2 Likes

Right - Was focused on replacing the two heavy 12v 9Ah sealed lead acids in my UPS to prepare for hurricane season.

2 Likes

cyclicalobsessive is the man!
On the bookworm setup script, I am not sure how to set the bme280 to use the hardware IC2. A bit beyond my paygrade.
I went with the setup_gopigo3_on_32-bit_Bullseye.sh
The setup script got stuck after

echo “Status of the new service”
systemctl status pigpiod.service

To solve it, I copied the rest of the script into a second setup file.

It works with the bme280.

I really appreciate the script to get my GoPiGo to work with a newer OS!

I live in Nebraska, we have hail, high winds, and tornados.

The NASA fellowships are typically my 2nd year students, as we are a community college. The idea with the GoPiGo is to do sensing for environment and navigation. We use cv2 for imaging.
I want to use a Lidar. I need a bit more research to find one that works with Python 3.9 on Buster. I found one that appears to work, YDLIDAR X4.

Thanks cyclicalobsessive for breathing more life into our GoPiGo3 fleet! (4 of them.)

3 Likes

I have a GitHub repository where I have my work with the GoPiGo3.

It contains some of the code and tutorials I have developed.

3 Likes

Yes - they tied that sensor tightly to software I2C through the I2C connectors or AD1/AD2. For Bookworm I only “fixed” the DistanceSensor() and EasyDistanceSensor() to use Hardware I2C.

You are the first taker on that GoPiGo3 on Bullseye repo - cool.

Interesting. Have you tried the status command on your completed configuration? I can’t remember what actually needs the pigpiod daemon. That package was really full featured but was not maintained as the new processors emerged.

I added an explicit update/upgrade/reboot step before the setup_GoPiGo3 step to the README and tested setting up on my “Desktop Pi4” (not installed on a GoPiGo3 robot). The script asked for some confirmations but always continued to completion. I don’t have an explanation for why yours did not. Glad you were able to workaround the problem.

It will be interesting to see how you all make out with that on the Pi4. I did some OpenCV line recognition and bright spot tracking - success but not impressive performance.

My Bullseye OpenCV, and PiCamera tests and performance results are nestled under:

I use the YDLIDAR X4 LIDAR but have only used it with Ubuntu. I added a separate 5v power off the GoPiGo3 battery for the LIDAR. Some folks on other robot platforms have gotten away with powering the X4 LIDAR through the Pi4 USB but I don’t know if the GoPiGo3 power supply has enough oomph.

It is really exciting to have you teaching with the GoPiGo3. Nothing beats getting experience with the reality of physical sensors. Simulated sensors in simulated worlds cannot touch the excitement of setting your robot loose before your eyes.

2 Likes

Absolutely!

STRONGLY agree.

I have had situations where the contacts between the GoPiGo controller board and the Raspberry Pi were questionable, and when the Pi wanted juice, the 5+ would droop to the point that I’d get the undervolt warning.

I solved that problem by wiring a 3A buck converter across the barrel connector on the GoPiGo controller and attaching the output to a USB connector I scavenged, plugging it into the Raspberry Pi’s power connector.

This shows both the buck converter and the circuit connection to make it automatically turn on and off with the robot.

There are some other posts, but I haven’t found them yet.

If you feel like engaging in some SMD component rework, you can recalibrate the state of charge lights on the TalentCell batteries by substituting three resistors.

Only if you feel confident soldering small parts and can get three 510Ω surface mount resistors per battery.

2 Likes

I appreciate the tips.
I have done some surface mount soldering, but I don’t feel comfortable modifying the battery or GoPiGo.
I think I will go with a separate battery for the LIDAR. I probably won’t get to the LIDAR until fall.
Thanks!

3 Likes

Smart move!

Fight one dragon at a time.
:wink:

2 Likes

Maybe before then I can convince you to try my ROS 2 Humble GoPiGo3 image and introduction to ROS 2 tutorial… To just use the LIDAR as a 360 degree range sensor one don’t need ROS. I’m not familiar with any non-ROS LIDAR systems.

Something to put in the back of your mind from my experience with the YDLidar X4 - it may not return range data for every angle on every scan. I haven’t dug into this to characterize when or why, primarily because ROS 2 deals with unreliable sensor data under the covers somewhat.

2 Likes

I have everything working on Bullseye that I had working on Buster, including the addition of a PS4 controller.

3 Likes

Did you use a wireless dongle or bluetooth connectivity? (I have had success with the wireless dongle route, but no success on the two bluetooth controllers I tried with many years ago.)

2 Likes