[SOLVED] Grove Color Sensor Not Working on GrovePi - Error 121

Hello,

Am having trouble with the Grove Color Sensor on the GrovePi. Below is my full error output. Final output is OSError: [Errno 121] Remote I/O error. Have tried with 2 different color sensors and they both give the same output. Also have tested lots of other i2C color sensors on the Grove Pi and they are working fine.

Am running with Rasbian and have setup the grove libs as per your detailed instructions on here.

Any ideas? Thanks.

Traceback (most recent call last):
File “/home/pi/Desktop/GrovePi/Software/Python/grove_i2c_color_sensor/color_sensor_example.py”, line 5, in
color_sensor = grove_i2c_color_sensor.GroveI2CColorSensor()
File “/home/pi/Desktop/GrovePi/Software/Python/grove_i2c_color_sensor/grove_i2c_color_sensor.py”, line 160, in init
self.use_continuous_integration()
File “/home/pi/Desktop/GrovePi/Software/Python/grove_i2c_color_sensor/grove_i2c_color_sensor.py”, line 187, in use_continuous_integration
[self._TIMING_INTEGRATION_MODE_CONTINUOUS | integration_time_reg])
OSError: [Errno 121] Remote I/O error

Hi @s.maam,

I’ve run it on my GrovePi and the Grove Color Sensor worked as expected.
At this moment, I have the latest Raspbian For Robots installed on the Raspberry Pi and the GrovePi has firmware version 1.2.7.

Could you do 2 things:

  1. Run the Troubleshooter for the GrovePi and the copy the log.txt that was created on the Desktop here on the forums.

  2. Run i2cdetect -y 1 with the Grove Color Sensor attached to your GrovePi and make a screenshot of what you get. Then post it here.

That’s all for now.

Thank you!

Hi Robert,

I used the latest version of Raspian for Robots, and the color sensor is still not working. Other i2c sensors do work.

Attached is log.txt file from the Troublshooter, and also a screenshot which shows the error the color sensor is giving, as well as the results of i2cdetect.

Thanks,

Sami

log.txt (5.9 KB)

20170906_121811

Hi @s.maam,

It seems like you have an older version of the firmware on your GrovePi.

old_fw

Can you update the firmware of your GrovePi to version 1.2.7 and then check if the Grove Color Sensor works?

Thank you!

Hi Robert,

Have flashed/reinstalled Rasbian for Robots (Jessie) on the SD card.

Am rerunning the grove_color_example script for the sensor, but still getting the same errors. Also updated the firmware and software via the Desktop ‘DI Software Update’ app, and the sensor is still giving the same error.

Have re run the Troubleshooter ( logfile attached) and it does say the firmware version is now at 1.2.7.

Thanks,

Sami

log (1).txt (5.9 KB)

Hi,

Have also noticed that in the i2cdetect it shows the color sensor address as 29, but in the grove_i2c_color_sensor.py file the address is listed as 0x39 (screenshot attached). Might that be the issue? If I change the address in the script to 29, I get the output:

Continuous integration incomplete
Manual Integration incomplete

and then the script ends. Have attached the script files also. Am using the Grove I2C Color Sensor v2.0.

Thanks,

Sami

20170907_122846

grove_i2c_color_sensor.py (15.3 KB)
color_sensor_example.py (1.5 KB)

Hi @s.maam,


I think you’re not using the correct sensor.

Here’s what address I get when I i2cdetect -y 1 on my Raspberry Pi and with the Grove Color Sensor connected to the I2C port:

PNG

Can you tell us if this is the sensor you’re using:
http://wiki.seeed.cc/Grove-I2C_Color_Sensor/

If it’s this sensor and it still doesn’t work, then, please check the version of the sensor. You can check this by looking on the backside of the sensor.


I’m now reading on Seeed's page and it seems like the newer version of this sensor (like above 2.0 version) uses a different chip that’s found at address 0x29, whereas the older versions ( < 2.0 versions) use another kind of chip that’s found at address 0x39.

If that’s the case and you can confirm this by reading the version label on your sensor, then it means we have to create another library for the more recent version of this Grove Color Sensor.


I’m waiting for your reply on this matter.

Thank you!

Hey,

You can look at my previous reply on this. We noticed the addresses were different also.

Yes we are using the new Grove I2C Color Sensor v2.0

Thanks,

Sami

Hi @s.maam,

DI Light Color Sensor vs Grove Color Sensor

Seeed's new sensor (version 2.0 that you have) is using the same chip as our sensor that we’ve just released.
https://www.dexterindustries.com/shop/light-color-sensor/

Since these 2 use the same sensor, I can recommend you use our library for our sensor on the one you already have.
We also can’t guarantee its total functionality, because all, after all, we are talking about 2 different boards, that have some hardware differences and things may not go right at all times.

Nevertheless, the best thing to do would be to buy our new sensor because we are going to do lots of other stuff with it. Also, we won’t be able to diagnose every sensor that uses the same chip as there may be those differences between them that would make them incompatible. But, for now, let’s experiment and see if it works with yours.

Installing the Sensor Library

In order to install this, you need to type in the following command inside a terminal:
curl https://raw.githubusercontent.com/DexterInd/Raspbian_For_Robots/master/upd_script/fetch_sensors.sh | bash

Using the Sensor Library

An example program for the sensor can be found here:

And the library for this sensor is seen here:

Last Words

Please tell us if this setting works with your Grove Color Sensor.

Thank you!

Hi!

Have tested this out with the libraries you mentioned above, and glad to say its working!

After updating/installing the fetch_sensors.sh file, I actually just cloned your entire DI_Sensors repo, because the color sensor lib had some dependencies from there also.

Your LightColorSensor.py test file only outputs the raw data, so looked at your grovePi/grove_i2c_color_sensor.py file and added conversion to the X, Y values, and added the read_color_name function and COLOR_TABLE to the DI_sensors test file. The colour reading and values seem to be accurate enough. Would be good to have those functions already embedded in your DI_Sensors lib and test file.

Thanks for help!

Sami

Hi @s.maam,

I’m glad to hear our library is working for you. This is some really great news.
Anyhow, our library is a continuous work, so we are going to keep updating it.

Thank you!

This topic was automatically closed after 18 hours. New replies are no longer allowed.