【Help】I2C becomes invalid

When “Home_Weather_Display” in Grovepi Projects is activated, the following error occurs.

-------------------------------------------------------------------------------------- ------------------------------
Traceback (most recent call last):
  File "Home_Weather_Display.py", line 51, in <module>
    setRGB (0, 255, 0)
  File "build / bdist.linux-armv7l / egg / grove_rgb_lcd.py", line 43, in set RGB
  File "/usr/local/lib/python2.7/dist-packages/smbus_cffi-0.5.1-py2.7-linux-armv7l.egg/smbus/util.py", line 59, in validator
    return fn (* args, ** kwdefaults)
  File "/usr/local/lib/python2.7/dist-packages/smbus_cffi-0.5.1-py2.7-linux-armv7l.egg/smbus/smbus.py", line 145, in write_byte_data
    raise IOError (ffi.errno)
IOError: 5
-------------------------------------------------------------------------------------- ------------------------------

As I guess, I think that I2C will be invalid if it is a program that activates LCD_RGB and other sensors (eg DHT 11).

As the grounds before the program execution I2C is connected as follows.

    0 1 2 3 4 5 6 7 8 9 a b c d e f
00: 03 04 - - - - - - - - - - -
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: - - - - - - - - - - - - - - - -
30: - - - - - - - - - - - - - - 3e -
40: - - - - - - - - - - - - - - - -
50: - - - - - - - - - - - - - - - -
60: - - - 62 - - - - - - - - - - - - -
70: 70 - - - - - - -

However, after the program is started, it becomes an error and becomes invalid.

    0 1 2 3 4 5 6 7 8 9 a b c d e f
00: - - - - - - - - - - - - -
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: - - - - - - - - - - - - - - - -
30: - - - - - - - - - - - - - - - -
40: - - - - - - - - - - - - - - - -
50: - - - - - - - - - - - - - - - -
60: - - - - - - - - - - - - - - - -
70: - - - - - - - -

In addition, additionally, LCD_RGB and DHT 11 will boot without any problems.

grove_rgb_lcd example.py: Launch OK
grove_dht_pro.py: Launch OK
Home_Weather_Display: Launch NG

In the above situation, please tell me if there is a fix part if any.

Reference
RaspberryPi: Raspberry Pi 3 MODEL B
Installation: Quickstart Directions

When did you last update the GrovePi’s library with curl -kL ... command and are you using other I2C devices alongside the GrovePi?

Thank you!

Thank you for contacting us.
The library was updated on 2/19.
If you have logs to check for updates please check them.

I2C uses only GrovePi.

I seem to have the same Problem. I tried reinstalling everything but after i run any python script no device is detected in i2c.
I have Raspbian for Robots and a grovepi+ board. The only Sensor that produces an output is the temperature and humidity sensor (weirdly enough it still works even if nothing is detected with i2cdetect). Everything else i tried failed with traceback and IOError 5. The LED script runs without error but the LED does nothing.
i2cdetect

running on Raspberry Pi 3 B+

I have exact same problem. Using pi 3B+ and GrovePI+ kit. Happens with both

Raspbian For Robots Image (latest as of Feb 26 2019) with all updates applied and

fresh Raspbian image (latest as of Feb 26 2019) with “curl -kL dexterindustries.com/update_grovepi | bash” installed and all updates applied

Some new info:
If you just install Raspbian For Robots Image (latest as of Feb 26 2019) and DONT apply any updates (including firmware update), I2C works!

Oh yeah, it’s because of a fix we haven’t integrated just yet. It works, it has been tested and we just need to merge it.

Check out this thread here: False readings from Digital ports

Use the suggestions I gave that guy there and see if it makes everything work as before.

Thank you!

Thanks Robert.
When will this fix available as a regular upgrade?

Hello RobertLucian

applying the hotfix from your hotfix/sw_i2c_on_hw branch does not fix the problem.

Here is what I did:

My hardware in Raspberry Pi 3B+ and GrovePi+

  1. Install latest Rasbian from “https://www.raspberrypi.org/downloads/raspbian/” (Version: November 2018 Release date: 2018-11-13 Kernel version: 4.14)
    After install update Rasbian at first boot.
  2. Install GrovePi+ software using Quickstart Directions at “https://www.dexterindustries.com/GrovePi/get-started-with-the-grovepi/setting-software/
    This is basically “sudo curl -kL dexterindustries.com/update_grovepi | bash” and sudo reboot
  3. After reboot, sudo i2cdetect -y 1 detects GrovePi correctly
  4. Update firmware using directions at “https://www.dexterindustries.com/GrovePi/get-started-with-the-grovepi/updating-firmware/
  5. After reboot, sudo i2cdetect -y 1 detects GrovePi correctly
  6. Apply hotfix using your directions from thread “False readings from Digital ports”
  7. After reboot, sudo i2cdetect -y 1 detects GrovePi correctly
  8. run the Home_Weather_Display project. Get this error:
    Traceback (most recent call last):
    File “Home_Weather_Display.py”, line 51, in
    setRGB (0, 255, 0)
    File “build / bdist.linux-armv7l / egg / grove_rgb_lcd.py”, line 43, in set RGB
    File “/usr/local/lib/python2.7/dist-packages/smbus_cffi-0.5.1-py2.7-linux-armv7l.egg/smbus/util.py”, line 59, in validator
    return fn (* args, ** kwdefaults)
    File “/usr/local/lib/python2.7/dist-packages/smbus_cffi-0.5.1-py2.7-linux-armv7l.egg/smbus/smbus.py”, line 145, in write_byte_data
    raise IOError (ffi.errno)
    IOError: 5

Hi @kaddi,

By looking at the steps you have followed/applied, I don’t see where the hotfix/sw_i2c_on_hw patch is applied. Assuming that the patch doesn’t get in, then it’s no wonder why this won’t fix your problem.

Regardless, the patch has just been accepted into the master branch, so now, you can just update your GrovePi the regular way and the fix should get in too this time. Please do that. Here’s the command you need to run once more:

curl -kL dexterindustries.com/update_grovepi | bash

Thank you!

Thanks for reply.
Step 6 in above is where I applied hotfix.
Any way, will try the regular update path and let you know.