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
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:
Run the Troubleshooter for the GrovePi and the copy the log.txt that was created on the Desktop here on the forums.
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.
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.
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.
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:
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.
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.
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.
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.