[Errno 121] Remote I/O error

Can Somebody help me about following error ?

%Run Home_Weather_Display.py
Traceback (most recent call last):
File “/home/pi/Dexter/GrovePi/Projects/Home_Weather_Display/Home_Weather_Display.py”, line 50, in
setRGB(0,255,0)
File “/usr/local/lib/python3.7/dist-packages/grovepi-1.4.1-py3.7.egg/grove_rgb_lcd.py”, line 43, in setRGB
bus.write_byte_data(DISPLAY_RGB_ADDR,0,0)
OSError: [Errno 121] Remote I/O error

1 Like

Code is as below

from grovepi import *
from grove_rgb_lcd import *
from time import sleep
from math import isnan

dht_sensor_port = 7 # connect the DHt sensor to port 7
dht_sensor_type = 0 # use 0 for the blue-colored sensor and 1 for the white-colored sensor

setRGB(0,255,0)

while True:
try:
# get the temperature and Humidity from the DHT sensor
[ temp,hum ] = dht(dht_sensor_port,dht_sensor_type)
print(“temp =”, temp, “C\thumidity =”, hum,“%”)

	# check if we have nans
	# if so, then raise a type error exception
	if isnan(temp) is True or isnan(hum) is True:
		raise TypeError('nan error')

	t = str(temp)
	h = str(hum)

    # instead of inserting a bunch of whitespace, we can just insert a \n
    # we're ensuring that if we get some strange strings on one line, the 2nd one won't be affected
	setText_norefresh("Temp:" + t + "C\n" + "Humidity :" + h + "%")

except (IOError, TypeError) as e:
	print(str(e))
	# and since we got a type error
	# then reset the LCD's text
	setText("")

except KeyboardInterrupt as e:
	print(str(e))
	# since we're exiting the program
	# it's better to leave the LCD with a blank text
	setText("")
	break

# wait some time before re-updating the LCD
sleep(0.05)
1 Like

Can you tell us what setup, what software, along with the operating system and version you are using?

hi @jimrh Thanks for your reply, Acutally I resolved the problem by trial-error and by chance , I will summarize as below what I have done.

PRETTY_NAME=“Raspbian GNU/Linux 10 (buster)”
NAME=“Raspbian GNU/Linux”
VERSION_ID=“10”
VERSION=“10 (buster)”
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL=“http://www.raspbian.org/
SUPPORT_URL=“RaspbianForums - Raspbian
BUG_REPORT_URL=“RaspbianBugs - Raspbian

i tried "grovepi_lcd_dht.py " and “Home_Weather_Display.py”

For both them I got the following error as attached.
IMG_0775

BUT AFTER REMOVING “setRGB(0,255,0)” from the code, Then Everything works fine.
IMG_0777
IMG_0776

2 Likes

So, what display did you want to send a color command to?  The LCD?

Did you try changing the temperature (by putting it somewhere else), or the humidity, (by breathing on it), to see if the readings changed in a reasonable way?

Thanks for sharing!

1 Like

So, what display did you want to send a color command to? The LCD?
** I tried for followings **

Did you try changing the temperature (by putting it somewhere else), or the humidity, (by breathing on it), to see if the readings changed in a reasonable way?
**Correct , I tested with lighter and values were changed **

Thanks for sharing!

1 Like

The RGB commands might be for a specific display or a display using a different interface.

If you want to set colors, you will need to look up the specific display commands for your specific display hardware, the ports used, and modify the display class accordingly.

The reason for this is that these libraries were written years ago, (likely for hardware that no longer exists!), and you will need to update it to use new hardware.

Idea,
If you can fork the GitHub repo for that software, modify the driver class for the new hardware to make it work, (and rename it!), you can send @cleoqc a pull request to the main repo.  She often includes contributions like this.

We’ve all tossed things her way.  She can’t think of everything, new hardware is manufactured all the time and she is willing to consider/include relevant and useful contributions.

1 Like