Emonpi 2 OLED display not found

Hi,

I recently migrated my emon base to a emon pi 2. Everything except the OLED display is working (it is stuck displaying starting)

The service wont start as it cannot find the OLED module:-

2021-07-21 11:50:13,570 ERROR I2C LCD NOT DETECTED on either 0x[‘27’, ‘3f’] …exiting LCD script

The OLED Module is present at i2c address 3c
pi@emonpi:/var/log/emonpilcd $ sudo i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – – – – – – – – – – – – –
10: – – – – – – – – – – – – – – – –
20: – – – – – – – – – – – – – – – –
30: – – – – – – – – – – – – 3c – – –
40: – – – – – – – – – – – – – – – –
50: – – – – – – – – – – – – – – – –
60: – – – – – – – – – – – – – – – –
70: – – – – – – – –

The script looks like it should look for the oled at 3c

pi@emonpi:/var/log/emonpilcd $#!/usr/bin/env python
import sys
import smbus

Find LCD (alternative to i2cdetect)

bus = smbus.SMBus(1)
for address in [‘0x27’,‘0x3f’,‘0x3c’]:
try:

Using a fresh SD card image brings the OLED to life, but importing the backup from the old card kills it again.

Sorry, but I am running out of things to try, any advise would be greatly appreciated!

Kind regards

James

Hello @James_Hill

Could you try the following via command line,hopefully it will clarify what the error is:

sudo systemctl stop emonPiLCD.service
python3 /opt/openenergymonitor/emonPiLCD/emonPiLCD.py

HI!,

My directory structure seems a little different?

pi@emonpi:~ $ cd /opt/openenergymonitor/emonpi/lcd
pi@emonpi:/opt/openenergymonitor/emonpi/lcd $ ls
datasheet      emonPiLCD2.py        emonPiLCD.py         enablessh.sh        lcd_test.py
disablessh.sh  emonPiLCD.cfg        emonPiLCD.service    gsmhuaweistatus.py  __pycache__
emonPiLCD      emonPiLCD_detect.py  emonPiLCD_update.py  install.sh          README.md
emonPiLCD1.py  emonPiLCD_detect.sh  emonPiLCD_write.py   lcddriver.py        testing
pi@emonpi:/opt/openenergymonitor/emonpi/lcd $ python3 emonPiLCD.py
Traceback (most recent call last):
  File "emonPiLCD.py", line 19, in <module>
    import emonPiLCD2
  File "/opt/openenergymonitor/emonpi/lcd/emonPiLCD2.py", line 26, in <module>
    from PIL import Image, ImageDraw, ImageFont
ModuleNotFoundError: No module named 'PIL'
pi@emonpi:/opt/openenergymonitor/emonpi/lcd $

Hopefully this helps!

James

Thanks, it looks like your running an older image? Did you download and use emonSD-01Feb24?

Hi,

Yes, I did, and the OLED works fine, however restoring the backup from the old SD card breaks it again for some reason.

The I have tried updating them emonpilcd to the current version on github but no luck.

Best REgards

James

That’s strange. Could you let me know what the result is of the following:

ls -lh /opt/openenergymonitor/

No problem here it is:-

pi@emonpi:/opt/openenergymonitor/emonpi/lcd $ ls -lh /opt/openenergymonitor/
total 24K
drwxr-xr-x 3 pi pi 4.0K Jul 21 2021 avrdude-rpi
drwxr-xr-x 3 pi pi 4.0K Jul 21 2021 data
drwxr-xr-x 8 pi pi 4.0K Oct 4 17:26 emonhub
drwxr-xr-x 16 pi pi 4.0K Jan 21 2024 emonpi
drwxr-xr-x 10 pi pi 4.0K Oct 4 17:25 EmonScripts
drwxr-xr-x 7 pi pi 4.0K Jan 21 2024 RFM2Pi
pi@emonpi:/opt/openenergymonitor/emonpi/lcd $

I should say, this is back on the old SD card, as the data import did cause some other issues in trends.

Ah ok, that explains it. What were the other issues with the import?

For some reason, my preconfigured trends were there, but non of the data would load. I cannot remember the exact error sorry.

If you wouldn’t mind pointing me at the latest image I should use (in case I got the wrong one somehow) I will try it again and give the information from the latest image if that’s the best route.

The display not working isn’t the end of the world as everything else does currently but it would be nice to get it sorted.

Thanks for your help!

James

Here’s the latest image: https://openenergymonitor.org/files/emonSD-01Feb24.zip

I would recommend trying the import using SD card reader approach Import / Backup / Restore / Update — OpenEnergyMonitor 0.0.1 documentation. Hopefully that will give better results

Thanks, I will tray another fresh image and see how it goes, thankyou for your help!

1 Like

Hi,

Everything is now working as it should with the new image and a restored configuration database directly from my old card.

I think the issue was I was restoring to a same size SD card and the import was running out of space, I mistakenly thought is was complete.

A bigger SD card and expanding before importing has resolved the issue.

Thanks for your help!

James