LCD Display Error

Mycodo 8.11.0
HiLetgo 2004 20X4 LCD Display

-Removed the old LCD setup from mycodo in setup/LCD
-Added a new function for generic LCD 20x4 (i2C)
-Configured the new function with the same I2C (0x27) and I2C bus (1) that was previously used. I2Cdetect shows the device at 0x27.
-Added the same 4 lines that were previously setup

  • restarted mycodo. A few minutes later the following error is written to the log file:

2021-07-28 13:12:39,305 - ERROR - mycodo.controllers.controller_function_5897a2e1 - Exception while running loop(): [Errno 121] Remote I/O error
Traceback (most recent call last):
File “/var/mycodo-root/mycodo/controllers/controller_function.py”, line 71, in loop
self.run_function.loop()
File “/home/pi/Mycodo/mycodo/functions/display_generic_lcd_20x4_i2c.py”, line 434, in loop
lines_display[0], lines_display[1], lines_display[2], lines_display[3])
File “/var/mycodo-root/mycodo/devices/lcd_generic.py”, line 119, in lcd_write_lines
self.lcd_string_write(line_2, 2)
File “/var/mycodo-root/mycodo/devices/lcd_generic.py”, line 113, in lcd_string_write
self.lcd_byte(ord(message[i]), self.LCD_CHR)
File “/var/mycodo-root/mycodo/devices/lcd_generic.py”, line 97, in lcd_byte
self.lcd_toggle_enable(bits_low)
File “/var/mycodo-root/mycodo/devices/lcd_generic.py”, line 102, in lcd_toggle_enable
self.bus.write_byte(self.I2C_ADDR, (bits | self.ENABLE))
File “/var/mycodo-root/env/lib/python3.7/site-packages/smbus2/smbus2.py”, line 414, in write_byte
ioctl(self.fd, I2C_SMBUS, msg)
OSError: [Errno 121] Remote I/O error

The function 5897a2e1 is the ID of this new function. What is interesting is this same LCD setup is working on our second system.

What should I do to correct?

The following notice is at the top of the LCD page:

LCD controllers have been deprecated. If you would like to control a display/LCD, go to the Setup → Function page and add a supported Display Function.

Therefore, there will be no work put into any issues related to this deprecated feature. If you find an issue with LCD Functions, you’re welcome to submit a bug report.

Sorry for the confusion. That is what I did. I removed the old LCD display setup and added a new one under the Function page. Now I’m getting the error on one of our two systems.

Have you swapped your LCDs to determine if it’s a hardware or software issue?

No I haven’t swapped LCD panels. What is interesting is the display panel is working. We would not have known there was an error without the log file. That log file error only occurs every few hours.

I will try a new display panel today and report back.

New panel didn’t change the error. The only LCD object setup is in the function area. I checked today to make sure the old LCD (setup/LCD) had been deleted when this new LCD panel under Functions was added. Yet the error continues. Also restarted the raspberry pi. It is interesting that after disabling the LCD function, the LCD screen displays Mycodo 8.11.0, LCD Disabled.

The error is referencing the ID of the LCD panel setup under Functions. I’ll let it run for a few hours with the LCD function disabled to see if the error persists. The LCD

The LCD function wrote an error to the log file 6 minutes after activating that function:

2021-07-30 14:16:14,144 - INFO - mycodo.controllers.controller_function_5897a2e1 - Activated in 140.4 ms
2021-07-30 14:23:05,202 - ERROR - mycodo.controllers.controller_function_5897a2e1 - Exception while running loop(): [Errno 121] Remote I/O error
Traceback (most recent call last):
File “/var/mycodo-root/mycodo/controllers/controller_function.py”, line 71, in loop
self.run_function.loop()
File “/home/pi/Mycodo/mycodo/functions/display_generic_lcd_20x4_i2c.py”, line 434, in loop
lines_display[0], lines_display[1], lines_display[2], lines_display[3])
File “/var/mycodo-root/mycodo/devices/lcd_generic.py”, line 121, in lcd_write_lines
self.lcd_string_write(line_3, 3)
File “/var/mycodo-root/mycodo/devices/lcd_generic.py”, line 113, in lcd_string_write
self.lcd_byte(ord(message[i]), self.LCD_CHR)
File “/var/mycodo-root/mycodo/devices/lcd_generic.py”, line 97, in lcd_byte
self.lcd_toggle_enable(bits_low)
File “/var/mycodo-root/mycodo/devices/lcd_generic.py”, line 102, in lcd_toggle_enable
self.bus.write_byte(self.I2C_ADDR, (bits | self.ENABLE))
File “/var/mycodo-root/env/lib/python3.7/site-packages/smbus2/smbus2.py”, line 414, in write_byte
ioctl(self.fd, I2C_SMBUS, msg)
OSError: [Errno 121] Remote I/O error
2021-07-30 14:46:42,774 - INFO - mycodo.controllers.controller_conditional_bcbe5d75 - Tomato - EC is okay at 2752.0. pH is 6.205. Should be < 6.2. Dispensing acid (pH down)

Thanks,
Kevin

So, if after replacing the LCD on the system that produces errors in the log with an LCD from a system that doesn’t produce errors in the log, and the errors persist, it suggests to me the issue is related to the system (Pi, power supply, wiring, circuits, interference in the environment, etc.) that produces the errors, and not necessarily the fault of the LCD or the software (Mycodo).