Using GoPiGo3 with Raspbian Stretch

gopigo3
stretch

#1

Is it possible to use the GoPiGo3 robot with Raspbian Stretch? Specifically I have a program that I have written in C++. I have looked at the SPI protocol for talking to the GoPiGo3 add on board (the red board) and have implemented this in my C++ program. For those that are involved in such things, I have written subset of the First Robotics wpilib library and want to use the GoPiGo 3 to each new students about programming robots in First without having code mistakes crash a 120 pound robot into a student.

All of this works great with the Jessy based image provided by Dexter Industries. However, I woiuld prefer to use Raspbian Stretch. So, I install Stretch on the microSD card, setup net networking, go to the raspi-config program and turn on the I2C and SPI bus, and try to run my program. The SPI communication happens as the microcontroller on the red board returns the manufacturer and product name correctly. However, I cannot ever get the motors to turn on. I have several theories but no way right now to prove any. Looking at the source to the code running on the microcontroller on the red board would probably help resolve this mystery, but I cannot find the source to this code. Is it available publicly?

Also note, when I turn on the robot with the power switch (on the red board), the green light that usually blinks to start and they glows solid, just blinks indefinitely.

It could be that with the release from dexter industries there is some type of daemon/service that runs that “enables” functionality and this daemon/service is missing on the vanilla stretch release.

It could be some packages that I need to “apt install” under stretch that I am missing.

It could be something else I have not thought of?

Help?

Thanks
Butch


#2

Another note, running my code under the beta of DexterOS 2.0 works just fine as well. Dexter OS 2.0 seems to be based on stretch (or at least something newer than jessy).


#3

Hi @butchg,

Looking at the source to the code running on the microcontroller on the red board would probably help resolve this mystery, but I cannot find the source to this code. Is it available publicly?

The source code for the firmware is closed source and we can fully assure you there’s no bug with GoPiGo3’s firmware. It has the proof of time that it has passed.

Now, the beta of DexterOS 2.0 runs on a Stretch distribution and we haven’t encountered any issues with a GoPiGo3 - none, whatsoever.

When you installed GoPiGo3 on your Pi, did you run the following command? (mind the sudo command):

curl -kL dexterindustries.com/update_gopigo3 | sudo bash

It could be that with the release from dexter industries there is some type of daemon/service that runs that “enables” functionality and this daemon/service is missing on the vanilla stretch release.

There’s no daemon that the GoPiGo3 needs for it, so we can exclude that.

However, I cannot ever get the motors to turn on

When you say this, I start wondering if you, for some reason, don’t have the latest library installed. The above command will get you the latest installed.

Also, can you tell us what is the output of this script on your machine?

And last of all, a question that isn’t that important, but might be necessary in tests, can you tell us what is the exact image of Stretch that you used? Can you point us a link to Raspian’s archive?

Thank you!


#4

I am using Raspbian Stretch 2018-03-13. Running the curl command you gave above fixed my problem. I am fairly new to this and am not really using the robot in the way you guys intended so forgive my ignorance on this topic.

I see from the code that you talk from the raspberry PI to the custom code on the microcontroller via the SPI port. I have my own code that opens /dev/spidev0.1 myself and writes commands based on the protocol I pulled from the python and C code you guys provide. What I am having a hard time understanding is what is it that got installed that would have changed the behavior of the robot. Clearly something did, but is it some that runs at boot time? Or is there some initialization sequence I am missing?

My code is located at https://github.com/errorcodexero/robotdev/tree/master/robots/gopigo3/gopigo3hw if you want to take a look. It is fairly straight forward and just provides an object that is a low level interface to the robot.

Thanks
Butch


#5

Hi @butchg,

Have you thought of using our library that’s written in C++? We already have one and if you don’t like using ours, you can still use it for developing your own library. You just have to take a look at how we have implemented those private methods.

Thank you!