I’m having Error 121 problem.
Currently I am 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")
====