LCD Error: OSError: 121

grovepi
#1

hi,

i have a new grovePi and the code runs some seconds and
then comes the OSError: 121 - and it seems, that there
are problems with the Grove-LCD RGB.

below is the error message.

i only show data on the LCD but this stops after some seconds.
i try to use it for the omxplayer with timers.

i am using Raspbian GNU/Linux 9 (stretch) Linux rpi_grove 4.14.98-v7+
the newest firmware 1.3

any solutions?

thanks,
alex

PS all the time when i reboot the rPI the red light (reset) is also on.
so i must always execute: avrdude -c gpio -p m328p
i tried 3 different power supplies and also a second grovePi board - but no success!

Error:

Exception in thread Thread-16:
Traceback (most recent call last):
  File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.5/threading.py", line 1180, in run
    self.function(*self.args, **self.kwargs)
  File "./grove_player.py", line 102, in doVideo
    setText(str(myText))
  File "/usr/local/lib/python3.5/dist-packages/grovepi-1.0.4-py3.5.egg/grove_rgb_lcd.py", line 56, in setText
    textCommand(0x01) # clear display
  File "/usr/local/lib/python3.5/dist-packages/grovepi-1.0.4-py3.5.egg/grove_rgb_lcd.py", line 52, in textCommand
    bus.write_byte_data(DISPLAY_TEXT_ADDR,0x80,cmd)
  File "/usr/local/lib/python3.5/dist-packages/smbus_cffi-0.5.1-py3.5-linux-armv7l.egg/smbus/util.py", line 59, in validator
    return fn(*args, **kwdefaults)
  File "/usr/local/lib/python3.5/dist-packages/smbus_cffi-0.5.1-py3.5-linux-armv7l.egg/smbus/smbus.py", line 145, in write_byte_data
    raise IOError(ffi.errno)
OSError: 121
#2

Are you locking the access to the resource (I2C bus and device) every time you initiate a set of transfers (like analogRead, digitalWrite, etc)?

The library for the GrovePi is not thread-safe, so you have to implement your own mechanisms for sharing the I2C device resource across multiple threads.

Thank you!