I just assembled and follow the installation instruction for the Gopigo3 (following this :https://github.com/DexterInd/GoPiGo3) . my problem is i cannot use the i2c sensors. everythings working : motors, servo motors, leds, eyes… but when i connect a i2c sensor (line follower, distance sensor and Imu sensor) nothing happen : i do i2cdetect -y 1 : i only have dashes.
i did Troubleshooting Script
GoPiGo3 Troubleshooting Script log
Checking for hardware, and checking hardware and firmware version.
==================================================================
Manufacturer : Dexter Industries
Board : GoPiGo3
Serial Number : 3D25ADD2514E4C47324B2020FF04211B
Hardware version: 3.1.3
Firmware version: 0.3.2
Battery voltage : 8.026
5v voltage : 5.073
Can you tell us to which port are you trying to connect the I2C devices? If you’re connecting them to the AD1 or AD2 ports they won’t show up, but they will if they’re connected to an I2C port. You can see the hardware references here.
Do you have any foam attached to your GoPiGo3 on the header pins? It should be black and if it’s there, please remove it as it makes the I2C non-functional.
Can you check with sudo raspi-config that you have the I2C interface enabled? If I2C is disabled you shouldn’t be able to run i2cdetect -y 1, but nonetheless, we should check just because.
Yes the ports used are I2C ports, not serial and not AD1 or AD2.
the foam you mean is the one put on the males pins for protect it when I received the GoPiGo? or the one in plastic receiving the raspberry pi males pins?
I did sudo raspi-config, enabled (ARM) i2c interface and then reboot.
One thing maybe not linked but when I start the line follower “basic_example.py” program, it told me “importerror no module named smbus” (using python 3.6.3) but when i want to install it, it says its already installed.
the foam you mean is the one put on the males pins for protect it when I received the GoPiGo? or the one in plastic receiving the raspberry pi males pins?
Yes, the first option is correct. It’s the foam that’s put on the male pins (aka header pins) of the GoPiGo. If it’s there, remove it otherwise, you’ll have trouble.
Second of all, the import error no module named smbus is quite important - without it, you can’t interface with your GoPiGo, but still, this has nothing to do with what you get on i2cdetect -y 1.
Therefore, I would recommend you use Python2 instead of Python3 until we get it to work. After that, if you request it, I can write a fix for the library so it can also support Python3.
I finally suceed to have my i2c ports working by move to another raspberry pi (I don’t know if its a true victory or just a give up ). I use python3.4 and it okay. (some programs use python3 i was not able to not use it).
So my distance sensor and mi IMU sensor work fine! That’s great and I thank you.
But one last thing. I’m not able to use the line follower. when I try basic_example.py nothing append (same for line_follower_basic_example) and I add this line
That’s because the line follower sensor is installed along with the GoPiGo2 library. In order to have the line follower installed you have to run the following command in a terminal:
The line follower sensor is a part of the GoPiGo2 library because it was originally developed for it and since we’re going to have a better line follower sensor in the future, we decided to keep it in there.
Okay, I did it, and when I do python check_line_sensor.py
It says “Line Sensor Found” this is okay, but nothing else ; and each time it try a program ( line_threshold_set.py, basic_example.py …) nothing appears or append.
When I Ctrl+C the code stoped each time at l0,l1,l2,l3,l4=get_sensorval().
Look like its waiting to have values thats never come…
Here a screenshot :
When I do i2cget -y 1 0x06 : I have 0x01 as answer (on white or black surface).
P.S: Are you going to make a library for GoPiGo3 in the future? I would like to use the line sensor, the distance sensor and the IMU sensor all together in the same code.
So you did the update, you did detect it with i2cdetect -y 1, but when you try reading from the sensor, you get nothing. Judging the screenshot you’ve posted, it looks like the script has an error at writing a block of I2C data.
That only thing I can think of is a kernel issue that prevents the script from communicating with the sensor. Fortunately, we’ve already encountered such an issue, though it would only happen when we would want to issue a read command on the I2C and not a write command. Bottom line is that with newer versions of the kernel, the line follower no longer works and that’s because the implementation of the I2C protocol has changed.
In order to determine whether you have a newer version, please enter the following command in a terminal:
uname -a
If you see anything above 4.4.50-v7+, then your line follower won’t work with what you have.
If you have a newer one (that’s more recent than the 4.4.50-v7+), please run the following command in order to downgrade it: