LCD1602 i2c waveshare display - not working

Hi, I can’t get the LCD1602 i2c Waveshare (blue background version) to work, even though it is all connected and started up.

Note - I do have a SIM7600X 4G HAT board on top of Raspberry Pi 4b and am running the display from the pass-through pins on the 7600 4G HAT. As far as I can tell the pins i am using are free (not used by the 7600 4G HAT.I checked GPIO PIN use by Hat in 4G and GPS HAT For Raspberry Pi - Waveshare SIM7600X - Tutorial Australia

So with LCD1602 - it is all wired up. LCD is lit up (blue background with one row of squares along the top). So it waiting and ready it seems.

i2c enable and identified as address 3e. Plugged in and unplugged to confirm. Yes.

smbus2 installed, i2c tools installed, libi2c-dev installed,

Checked all the wiring. SCL >SCL, SDA>SDA, GND>GRD, VCC>5V . All correct.

Even tried swapping to another LCD1602 i2c screen - which incidentally has the same 3e address and same problems. so no apparent issues with the screen hardware.

I downloaded various libraries and code and put them in the same folder and tried them with no success.

Tried Waveshare library and code - got lots of errors in the module code. Not sure what the problem was there.(see below)

I did change the i2c address in the waveshare LCD1602.py code to;

LCD_ADDRESS = (0x3e >> 1) # LCD I2C address

So that should not be an issue.

####

Traceback (most recent call last):
File “/home/paul/Downloads/LCD1602_I2C_Module_Demo/Raspberry/python/examples/Character_display.py”, line 7, in
lcd = LCD1602.LCD1602(16, 2)
File “/home/paul/Downloads/LCD1602_I2C_Module_Demo/Raspberry/python/examples/LCD1602.py”, line 55, in init
self.begin(self._row,self._col)
File “/home/paul/Downloads/LCD1602_I2C_Module_Demo/Raspberry/python/examples/LCD1602.py”, line 145, in begin
self.command(LCD_FUNCTIONSET | self._showfunction)
File “/home/paul/Downloads/LCD1602_I2C_Module_Demo/Raspberry/python/examples/LCD1602.py”, line 60, in command
I2C.write_byte_data(LCD_ADDRESS,0x80,cmd)
OSError: [Errno 121] Remote I/O error

######

Tried Toptechboy.com tutorial. Demo lcdDisplay.py code runs with library LCD1602.py in same folder, but shows nothing in the window when code runs in geany then ‘Code 0’. So says it ran and completed the code no errors, but no display on LCD screen.

I also tried: sterlingbeason/LCD-1602-I2C on GitHUB. same result. Code ran with “(program exited with code: 0)” so code completed no errors, but no display on the LCD.

I can see the squares, so the contrast is Ok to see I believe. this version of the screen does not have a screw on the back for contrast adjustment. i believe it is adjustable using coding however.

When I checked the i2c with “lsmod | grep i2c” was active in terminal i got;

i2c_brcmstb 16384 0
i2c_bcm2835 16384 0
i2c_dev 20480 0

I am not sure what the top one means. the second one seems to be the LCD driver??

If anyone can shed some light on why I cannot get this ‘apparently simple’ LCD to work,

it would be hugely appreciated.

cheers

Paul

Hi Paul

I too have a Waveshare 1602 display.that refused to work with the Waveshare library. Displayed the “Waveshare” message but that is all. I was using an Arduino but could be a similar problem.
After playing around for an appreciable time i Gave up and put aside.
Sometime later someone suggested I use a DFRobot library. I have not completely checked it yet but last time I played around it seemed to be OK. I intend to get back to it very soon but I tink the library change did the trick.
Cheers and hope this helps. Bob

Thanks Bob,

Good to know I’m not alone with the problem. I will have a look at DF Robot LCD library. Let me know if you have any breakthroughs.

Cheers Paul