[RGB LCD] Error 121

We have started with a training/course and all got a Pi B3+ with the GrovePi starter kit.
Running with Raspbian and we alle seem to get an Error 121 when running the LCD scripts.

i2cdetect -y 1 gives us different outputs on the last line. Sometimes none, sometimes 70, someties 74 and 75.
Any help on this?

1 Like

Hi @tijmenschoemaker,

Can you tell us what LCD scripts you are running, precisely?
And at the same time, tell us what devices/sensors you have connected to the GrovePi or to the Raspberry Pi for that matter?

Thank you!

1 Like

We were running with temp + hum sensor, 2 leds and running the standard python grove_rgb_lcd scripts.

-edit-
Just turned on my pi again.
i2cdetect -y 1 before execution of script:

root@pi-tijmen:/home/pi/Dexter/GrovePi/Software/Python# i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          03 -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- 38 -- -- -- -- -- 3e --
40: -- -- -- -- -- 45 46 -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- 62 -- -- -- -- -- -- -- -- -- -- -- -- --
70: 70 -- -- -- -- -- -- --
root@pi-tijmen:/home/pi/Dexter/GrovePi/Software/Python# i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          03 -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- 38 -- -- -- -- -- 3e --
40: -- 41 42 -- 44 45 -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- 62 -- -- -- -- -- -- -- -- -- -- -- -- --
70: 70 -- -- -- -- -- -- --

This time, with just the 7" LCD, GrovePi board en the RGB_LCD. Ran the example.py from the software folder:

root@pi-tijmen:/home/pi/Dexter/GrovePi/Software/Python/grove_rgb_lcd# python example.py
Traceback (most recent call last):
  File "example.py", line 43, in <module>
    setRGB(c,255-c,0)
  File "/home/pi/Dexter/GrovePi/Software/Python/grove_rgb_lcd/grove_rgb_lcd.py", line 46, in setRGB
    bus.write_byte_data(DISPLAY_RGB_ADDR,4,r)
  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: 121

Display does light up and says: Hellow World LCT Test but then the script exits

i2cdetect -y 1 after execution of the script:

root@pi-tijmen:/home/pi/Dexter/GrovePi/Software/Python/grove_rgb_lcd# i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          03 -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- 38 39 -- -- -- -- 3e --
40: -- -- -- -- -- 45 -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- 62 -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

1 Like

@RobertLucian
running the lcd.sh in Shell folder also errors:

root@pi-tijmen:/home/pi/Dexter/GrovePi/Software/Shell/Grove - LCD RGB Backlight# ./lcd.sh
Error: Write failed
Error: Write failed
Error: Write failed

1 Like

Are you somehow running multiple scripts at the same time that access the same I2C device?

1 Like

Iā€™m having the same problem.
Using :

  • Raspberry Pi 4 Model B (Linux raspberrypi 5.10.17-v7l+ #1403 SMP Mon Feb 22 11:33:35 GMT 2021 armv7l GNU/Linux)
  • GrovePi+ HAT (updated as of 7th March 2021)
  • Grove LCD RGB Backlight v4.0
  • Temperature Humidity Sensor v1.2

Getting error 121

Please help.

import math
import datetime
import grovepi
from grove_rgb_lcd import *

try:
    setRGB(255,255,255)
    setText("Initializing...")
    
    time.sleep(2)
    
    sensor = 4
    blue = 0
    
    while True:
        try:
            [temp,humidity] = grovepi.dht(sensor,blue)
            mytxt = "T = {}C H = {}% ";
            if math.isnan(temp) == False and math.isnan(humidity) == False:
                nnow = datetime.datetime.now().strftime("%X")
                setText_norefresh(mytxt.format(temp,humidity) + nnow)
                print(mytxt.format(temp,humidity) + nnow)
            time.sleep(1)
        except IOError as io_error:
            print("io_error = " + str(io_error))
            raise IOError
    
    
except KeyboardInterrupt:
    setRGB(0,0,255)
    setText("Exit OK")
except IOError as ioerror:
    print(ioerror)
    setRGB(255,0,0)
    setText("IO Error")

====

1 Like