emonPiLCD not working after update Oct18 base image

Hi,

I have the same issue but “systemctl status emonPiLCD.service” and rebooting a few times didn’t solve it. What do you suggest?

image

Thanks,

Kevin.

Have you run an update? I think a couple of changes have been made to the LCD script and it may be that?

What is the output from systemctl status emonPiLCD.service?

Hi Brian,

Thanks for your reply.

Yes I ran the update yesterday, it started showing as exited halfway through the update and hasn’t worked since.

Here’s the output…

[email protected]:~ $ systemctl status emonPiLCD.service
● emonPiLCD.service - LSB: emonPi LCD controller
Loaded: loaded (/etc/init.d/emonPiLCD; generated; vendor preset: enabled)
Active: active (exited) since Sun 2020-08-09 17:48:49 UTC; 15h ago
Docs: man:systemd-sysv-generator(8)
Process: 1181 ExecStop=/etc/init.d/emonPiLCD stop (code=exited, status=0/SUCCE
Process: 1189 ExecStart=/etc/init.d/emonPiLCD start (code=exited, status=0/SUC
CGroup: /system.slice/emonPiLCD.service

Aug 09 17:48:49 emonpi systemd[1]: Starting LSB: emonPi LCD controller…
Aug 09 17:48:49 emonpi emonPiLCD[1189]: Starting system emonPiLCD daemon:.
Aug 09 17:48:49 emonpi systemd[1]: Started LSB: emonPi LCD controller.
lines 1-11/11 (END)…skipping…
● emonPiLCD.service - LSB: emonPi LCD controller
Loaded: loaded (/etc/init.d/emonPiLCD; generated; vendor preset: enabled)
Active: active (exited) since Sun 2020-08-09 17:48:49 UTC; 15h ago
Docs: man:systemd-sysv-generator(8)
Process: 1181 ExecStop=/etc/init.d/emonPiLCD stop (code=exited, status=0/SUCCESS)
Process: 1189 ExecStart=/etc/init.d/emonPiLCD start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/emonPiLCD.service

Aug 09 17:48:49 emonpi systemd[1]: Starting LSB: emonPi LCD controller…
Aug 09 17:48:49 emonpi emonPiLCD[1189]: Starting system emonPiLCD daemon:.
Aug 09 17:48:49 emonpi systemd[1]: Started LSB: emonPi LCD controller.
~
~
~

Thanks,

Kevin.

Can you post the update log, please? Also if you widen the SSH window, there is probably more info.

For future reference, when posting code or bash output, put in 3 ‘backticks’ (found at the top left of the keyboard normally) on a line on their own, then the code, then 3 more backticks on a line following the code.

    ```
    code
    ```

If it is something like php you can add a language identifier that after the first 3 backticks so ```php

Hi Brian,

Thanks again for your help on this.

I widened the putty window…

[email protected]:~ $ systemctl status emonPiLCD.service
● emonPiLCD.service - LSB: emonPi LCD controller
   Loaded: loaded (/etc/init.d/emonPiLCD; generated; vendor preset: enabled)
   Active: active (exited) since Sun 2020-08-09 17:48:49 UTC; 19h ago
     Docs: man:systemd-sysv-generator(8)
  Process: 1181 ExecStop=/etc/init.d/emonPiLCD stop (code=exited, status=0/SUCCESS)
  Process: 1189 ExecStart=/etc/init.d/emonPiLCD start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/emonPiLCD.service

Aug 09 17:48:49 emonpi systemd[1]: Starting LSB: emonPi LCD controller...
Aug 09 17:48:49 emonpi emonPiLCD[1189]: Starting system emonPiLCD daemon:.
Aug 09 17:48:49 emonpi systemd[1]: Started LSB: emonPi LCD controller.

Heres the update log…

Starting update via service-runner-update.sh (v2.0) >
- emonSD version: emonSD-30Oct18
emonSD base image check passed...continue update
git pull /home/pi/emonpi
  enable-ssh
  enable-ssh-button
  gpiozero-enable-ssh
  greeebs-patch-1
* master
  python-systemd-servicerunner
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working tree clean
Already up-to-date.
-------------------------------------------------------------
Main Update Script
-------------------------------------------------------------
Date: Sun 9 Aug 16:49:28 UTC 2020
EUID: 1000
usrdir: /home/pi
type: all
firmware: none
Checking environment:
- pi user found

EUID: 1000
Hardware detected: EmonPi
Stopping emonPiLCD service
Display update message on LCD
-------------------------------------------------------------
Hit:1 http://archive.raspberrypi.org/debian stretch InRelease
Hit:2 http://raspbian.raspberrypi.org/raspbian stretch InRelease
Hit:3 https://deb.nodesource.com/node_12.x stretch InRelease
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
rng-tools is already the newest version (2-unofficial-mt.14-1).
python-gpiozero is already the newest version (1.5.0).
python-rpi.gpio is already the newest version (0.6.5~stretch-1).
0 upgraded, 0 newly installed, 0 to remove and 177 not upgraded.
Requirement already up-to-date: paho-mqtt in /usr/local/lib/python2.7/dist-packages
-------------------------------------------------------------
git pull /home/pi/RFM2Pi
* master
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working tree clean
Already up-to-date.

git pull /home/pi/usefulscripts
* master
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working tree clean
Already up-to-date.

git pull /home/pi/huawei-hilink-status
* master
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working tree clean
Already up-to-date.

git pull /home/pi/oem_node-red
* master
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working tree clean
Already up-to-date.

Start emonhub update script:
-------------------------------------------------------------
emonHub update started
-------------------------------------------------------------
- usr directory: /home/pi
git pull /home/pi/emonhub
* emon-pi
On branch emon-pi
Your branch is up-to-date with 'origin/emon-pi'.
Untracked files:
  (use "git add <file>..." to include in what will be committed)

	src/src

nothing added to commit but untracked files present (use "git add" to track)
Already up-to-date.
Creating emonhub logfile
Symlinking emonhub.conf to /etc/emonhub/emonhub.conf
emonhub.service already installed

Running emonhub automatic node addition script
[[5]]
Node 5 already present
[[6]]
Node 6 already present
[[7]]
Node 7 already present
[[8]]
Node 8 already present
[[9]]
Node 9 already present
[[10]]
Node 10 already present
[[11]]
Node 11 already present
[[12]]
Node 12 already present
[[13]]
Node 13 already present
[[14]]
Node 14 already present
[[15]]
Node 15 already present
[[16]]
Node 16 already present
[[19]]
Node 19 already present
[[20]]
Node 20 already present
[[21]]
Node 21 already present
[[22]]
Node 22 already present
[[23]]
Node 23 already present
[[24]]
Node 24 already present
[[25]]
Node 25 already present
[[26]]
Node 26 already present

Start emoncms update:

-------------------------------------------------------------
Emoncms update started
Emoncms update script V1.3 (26th March 2019)
-------------------------------------------------------------
- usr directory: /home/pi
- emoncms directory: /var/www/emoncms

current settings.php md5: 59e80f731935867f5f93753d49c0fe86
Default settings.php md5: 59e80f731935867f5f93753d49c0fe86
settings.php has NOT been user modifed

Checking status of /var/www/emoncms git repository
Fetching origin
- git branch: stable
- no local changes
- running: git pull origin stable

Branch stable set up to track remote branch stable from origin.
Already up-to-date.

NEW default settings.php md5: 59e80f731935867f5f93753d49c0fe86
settings.php not updated

-------------------------------------------------------------
Updating Emoncms Modules
-------------------------------------------------------------

------------------------------------------
Updating /var/www/emoncms/Modules/app module
------------------------------------------
Fetching origin
- git branch: stable
- git tags: 2.1.6
- no local changes
- running: git pull origin stable

Branch stable set up to track remote branch stable from origin.
Already up-to-date.

------------------------------------------
Updating /var/www/emoncms/Modules/config module
------------------------------------------
Fetching origin
- git branch: stable
- git tags: 2.0.5-6-gd28ff1e
- no local changes
- running: git pull origin stable

Branch stable set up to track remote branch stable from origin.
Already up-to-date.

------------------------------------------
Updating /var/www/emoncms/Modules/dashboard module
------------------------------------------
Fetching origin
- git branch: stable
- git tags: 2.0.8
- no local changes
- running: git pull origin stable

Branch stable set up to track remote branch stable from origin.
Already up-to-date.

------------------------------------------
Updating /var/www/emoncms/Modules/device module
------------------------------------------
Fetching origin
- git branch: stable
- git tags: 2.0.6
- no local changes
- running: git pull origin stable

Branch stable set up to track remote branch stable from origin.
Already up-to-date.

------------------------------------------
Updating /var/www/emoncms/Modules/graph module
------------------------------------------
Fetching origin
- git branch: stable
- git tags: 2.0.9-3-g6c18b0c
- no local changes
- running: git pull origin stable

Branch stable set up to track remote branch stable from origin.
Already up-to-date.

------------------------------------------
Updating /var/www/emoncms/Modules/wifi module
------------------------------------------
Fetching origin
- git branch: stable
- git tags: 2.0.3
- no local changes
- running: git pull origin stable

Branch stable set up to track remote branch stable from origin.
Already up-to-date.

------------------------------------------
Updating postprocess module
------------------------------------------
Fetching origin
- git branch: stable
- git tags: 2.1.4
- no local changes
- running: git pull origin stable

Branch stable set up to track remote branch stable from origin.
Already up-to-date.

------------------------------------------
Updating sync module
------------------------------------------
Fetching origin
- git branch: stable
- git tags: 2.0.5-3-g109816f
- no local changes
- running: git pull origin stable

Branch stable set up to track remote branch stable from origin.
Already up-to-date.

------------------------------------------
Updating backup module
------------------------------------------
Fetching origin
- git branch: stable
- git tags: 2.2.4
- no local changes
- running: git pull origin stable

Branch stable set up to track remote branch stable from origin.
Already up-to-date.

------------------------------------------
Auto Installation of Emoncms Modules
------------------------------------------
- graph module already installed
- device module already installed
- postprocess module already installed
- sync module already installed
- backup module already installed

/home/pi/emonpi/sudoers.d/emoncms-rebootbutton: parsed OK

emoncms-rebootbutton sudoers entry installed
/home/pi/emonpi/sudoers.d/emoncms-filesystem: parsed OK

emoncms-filesystem sudoers entry installed
/home/pi/emonpi/sudoers.d/wifi-sudoers: parsed OK

wifi-sudoers sudoers entry installed
www-data : www-data video systemd-journal

------------------------------------------
SERVICES
------------------------------------------
emoncms_mqtt.service already installed
feedwriter.service already installed
service-runner.service already installed
------------------------------------------
Reloading systemctl deamon
Update Emoncms database
[]

Restarting Services...
- sudo systemctl restart feedwriter.service
--- ActiveState=active ---
- sudo systemctl restart emoncms_mqtt.service
--- ActiveState=active ---
- sudo systemctl restart emonhub.service
--- ActiveState=active ---
Symlinking emonpiupdate.log
Installing emoncms logrotate...

Now setting up Logrotate...
Backing up old logrotate configuration...
Linked to new logrotate configuration...
Backing up old logrotate cron job...
mv: cannot stat '/etc/cron.daily/logrotate': No such file or directory
Linked to new logrotate cron job...

Completed


Completed

Running logrotate...

set log rotate config owner to root

------------------------------------------
Emoncms update script complete
------------------------------------------


Starting emonPi LCD service..


-------------------------------------------------------------
emonPi update done: Sun  9 Aug 16:50:32 UTC 2020
-------------------------------------------------------------
restarting service-runner
service-runner: no process found

Thank-you,

Kevin.

I moved topic because this is a different issue I suspect.

The update seems to have worked but this is the older stretch image and that may be causing issues (@TrystanLea note).

The simplest solution is to get a new SD Card, flash the new image and import all your data dashboards etc. Beware, on first boot, wait a good long while for updates to complete.

There are now a lot of changes to the underlying structure, Python version etc that are getting increasingly difficult to ensure work on the Oct18 image.

As I don’t have that image and there are no obvious errors anywhere, I’m not sure where the issue lies.

Thanks Brian, I will give it a go and report back.

FYI

@borpin I have just encountered a similar issue, having just done an update but, noting your comment

getting increasingly difficult to ensure work on the Oct18 image.

this is on emonpiRelease: emonSD-17Oct19, so not an old one.

I’ve read the split topic, so…

[email protected]:~ $ systemctl status emonPiLCD.service
● emonPiLCD.service - emonPi LCD driver
   Loaded: loaded (/opt/openenergymonitor/emonpi/lcd/emonPiLCD.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2020-09-23 15:25:39 BST; 18min ago
  Process: 717 ExecStartPre=/bin/mkdir -p ${LOG_PATH}/ (code=exited, status=0/SUCCESS)
  Process: 719 ExecStartPre=/bin/chgrp -R pi ${LOG_PATH}/ (code=exited, status=0/SUCCESS)
  Process: 720 ExecStartPre=/bin/chmod 775 ${LOG_PATH}/ (code=exited, status=0/SUCCESS)
  Process: 721 ExecStart=/usr/bin/python3 /opt/openenergymonitor/emonpi/lcd/emonPiLCD.py --logfile=${LOG_PATH}/emonpilcd.log (c
 Main PID: 721 (code=exited, status=1/FAILURE)

Sep 23 15:25:39 emonpi systemd[1]: emonPiLCD.service: Service RestartSec=100ms expired, scheduling restart.
Sep 23 15:25:39 emonpi systemd[1]: emonPiLCD.service: Scheduled restart job, restart counter is at 5.
Sep 23 15:25:39 emonpi systemd[1]: Stopped emonPi LCD driver.
Sep 23 15:25:39 emonpi systemd[1]: emonPiLCD.service: Start request repeated too quickly.
Sep 23 15:25:39 emonpi systemd[1]: emonPiLCD.service: Failed with result 'exit-code'.
Sep 23 15:25:39 emonpi systemd[1]: Failed to start emonPi LCD driver.
lines 1-15/15 (END)

I can post the whole update log if needed, but the LCD Update section might be a help in diagnosing?

-------------------------------------------------------------
EmonPi LCD Update
-------------------------------------------------------------
Reading package lists...
Building dependency tree...
Reading state information...
i2c-tools is already the newest version (4.1-1).
The following additional packages will be installed:
  python3-colorzero python3-spidev rpi.gpio-common
Suggested packages:
  python-gpiozero-docs python-spidev-doc
The following NEW packages will be installed:
  python3-colorzero python3-gpiozero python3-rpi.gpio python3-smbus
  python3-spidev rpi.gpio-common
0 upgraded, 6 newly installed, 0 to remove and 159 not upgraded.
Need to get 166 kB of archives.
After this operation, 887 kB of additional disk space will be used.
Get:1 http://archive.raspberrypi.org/debian buster/main armhf rpi.gpio-common armhf 0.7.0-0.1~bpo10+1 [5,776 B]
Get:2 http://archive.raspberrypi.org/debian buster/main armhf python3-rpi.gpio armhf 0.7.0-0.1~bpo10+1 [20.7 kB]
Get:3 http://archive.raspberrypi.org/debian buster/main armhf python3-spidev armhf 20190221~182651-1 [11.2 kB]
Get:4 http://archive.raspberrypi.org/debian buster/main armhf python3-colorzero all 1.1 [21.5 kB]
Get:5 http://archive.raspberrypi.org/debian buster/main armhf python3-gpiozero all 1.5.1 [94.9 kB]
Get:6 http://raspbian.mirror.uk.sargasso.net/raspbian buster/main armhf python3-smbus armhf 4.1-1 [11.7 kB]
debconf: unable to initialize frontend: Dialog
debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (This frontend requires a controlling tty.)
debconf: falling back to frontend: Teletype
dpkg-preconfigure: unable to re-open stdin: 
Fetched 166 kB in 0s (383 kB/s)
E: Sub-process /usr/bin/dpkg received a segmentation fault.
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting redis
  Downloading https://files.pythonhosted.org/packages/a7/7c/24fb0511df653cf1a5d938d8f5d19802a88cef255706fdda242ff97e91b7/redis-3.5.3-py2.py3-none-any.whl (72kB)
Requirement already satisfied: paho-mqtt in /usr/local/lib/python3.7/dist-packages (1.5.0)
Collecting xmltodict
  Downloading https://files.pythonhosted.org/packages/28/fd/30d5c1d3ac29ce229f6bdc40bbc20b28f716e8b363140c26eff19122d8a5/xmltodict-0.12.0-py2.py3-none-any.whl
Requirement already satisfied: requests in /usr/lib/python3/dist-packages (2.21.0)
Installing collected packages: redis, xmltodict
Successfully installed redis-3.5.3 xmltodict-0.12.0
- reinstalling emonPiLCD.service
Removed /etc/systemd/system/multi-user.target.wants/emonPiLCD.service.
- installing emonPiLCD.service
Created symlink /etc/systemd/system/multi-user.target.wants/emonPiLCD.service → /opt/openenergymonitor/emonpi/lcd/emonPiLCD.service.
Created symlink /etc/systemd/system/emonPiLCD.service → /opt/openenergymonitor/emonpi/lcd/emonPiLCD.service.
- Service ActiveState=active
Stopping emonPiLCD service
Display update message on LCD

Starting emonPi LCD service..


-------------------------------------------------------------
emonPi update done: Wed 23 Sep 14:56:19 BST 2020
-------------------------------------------------------------
restarting service-runner

I was just about to update to the latest emonSD image anyway, so it’s not a problem but I thought you would like to know it’s a potential problem with Oct19 too.

Thanks

Couple things to try if the system is still up.

python3 /opt/openenergymonitor/emonpi/lcd/emonPiLCD.py

Does it generate an error? This might be seen in syslog from the service restarts.

Secondly, try running the update a second time?

Cheers

Yes system is still up.

[email protected]:~ $ python3 /opt/openenergymonitor/emonpi/lcd/emonPiLCD.py
Traceback (most recent call last):
  File "/opt/openenergymonitor/emonpi/lcd/emonPiLCD.py", line 20, in <module>
    from gpiozero import Button
ModuleNotFoundError: No module named 'gpiozero'

Not sure what you mean, sorry not that competent.

Ready to run update again…

It looks like gpiozero is not installed.

try

 sudo apt-get install python3-gpiozero

then rerun the LCD command

Oh dear. Might be time for new emonSD image…
Odd though, I only reinstalled quite recently.

[email protected]:~ $ sudo apt-get install python3-gpiozero
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  python3-colorzero python3-rpi.gpio python3-spidev rpi.gpio-common
Suggested packages:
  python-gpiozero-docs python-spidev-doc
The following NEW packages will be installed:
  python3-colorzero python3-gpiozero python3-rpi.gpio python3-spidev rpi.gpio-common
0 upgraded, 5 newly installed, 0 to remove and 159 not upgraded.
Need to get 0 B/154 kB of archives.
After this operation, 836 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
E: Sub-process /usr/bin/dpkg exited unexpectedly

Could be. Check free space. Backups were going to the wrong partition at one point.

Free space is ok. I’ll try the newest image on a fresh SD card, and import from SD card…

Thanks for looking into it.

1 Like

Many thanks @borpin - this worked for me.

1 Like