EmonPi failed update & feeds not showing

Hi All,

I’ve had an emonpi running quite happily for about 6 months now on a solar home setup (one emonpi and 2 x CTs).

It was a pretty straightforward setup and left it to run quite nicely (is actually at my parents house so mainly manager / moinitor remotely).

But about a week ago it just stopped getting current readings. There may have been a power cut around that time. I’ve visited and tried to get it working again but with no luck. Originally the EmonHub light was red (under setup > Admin). All of those lights are now green.

Here are the latest logs (update and emonhub).

The one bit I couldn’t figure out is how to actually run “apt --fix-broken install’”. Tried it in the terminal shell after I had done the other bit it asked for (sudo dpkg --configure -a) but didn’t seem to like it.

Any advice gratefully received.
I do have a new SD card from Amazon coming and will be installing pi update onto that and then copying across, may or may not solve it but welcome any help here first.
It does seem that it gets stuck on the emonhub on RFM2Pi interfacer not sure how to correct this. I did a fresh copy of the emonHub config file and that didn’t help.

Thanks
Henry

UPDATE LOG

LAST ENTRIES ON THE LOG FILE
Starting update via service-runner-update.sh (v3.0) >
- emonSD version: emonSD-17Oct19
- supported images: emonSD-24Jul20 emonSD-02Oct19 emonSD-17Oct19
- emonSD base image check passed...continue update
git pull /opt/openenergymonitor/EmonScripts
master
* stable
On branch stable
Your branch is up to date with 'origin/stable'.

nothing to commit, working tree clean
Already up to date.
-------------------------------------------------------------
Main Update Script
-------------------------------------------------------------
Date: Sun 18 Oct 14:46:19 BST 2020
EUID: 1000
openenergymonitor_dir: /opt/openenergymonitor
type: emonhub
firmware: none
Reading package lists...
Building dependency tree...
Reading state information...
python3-pip is already the newest version (18.1-5+rpt1).
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
python3-twisted : Depends: python3-twisted-bin (>= 18.9.0-3) but it is not going to be installed
Depends: python3-service-identity but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: redis in /home/pi/.local/lib/python3.7/site-packages (3.5.3)
Hardware detected: EmonPi
Stopping emonPiLCD service
Display update message on LCD
Running apt-get update
Hit:1 http://archive.raspberrypi.org/debian buster InRelease
Hit:2 http://raspbian.raspberrypi.org/raspbian buster InRelease
Reading package lists...
Start emonhub update script:
-------------------------------------------------------------
emonHub update
-------------------------------------------------------------
git fetch --all --prune -v
Fetching origin
From https://github.com/openenergymonitor/emonhub
= [up to date] stable -> origin/stable
= [up to date] MQTTSubscriberInterfacer -> origin/MQTTSubscriberInterfacer
= [up to date] emon-pi -> origin/emon-pi
= [up to date] env_example -> origin/env_example
= [up to date] include_serial_number -> origin/include_serial_number
= [up to date] lanip-status -> origin/lanip-status
= [up to date] master -> origin/master
= [up to date] new_config_format -> origin/new_config_format
= [up to date] redis_config_interface -> origin/redis_config_interface
= [up to date] unitless_decoder -> origin/unitless_decoder
git status
On branch stable
Your branch is up to date with 'origin/stable'.

Untracked files:
(use "git add ..." to include in what will be committed)

src/src

nothing added to commit but untracked files present (use "git add" to track)
git pull origin stable
From https://github.com/openenergymonitor/emonhub
* branch stable -> FETCH_HEAD
Already up to date.

Running emonhub install & update script emonSD_pi_env:1
--------------------------------------------------------------------
Reading package lists...
Building dependency tree...
Reading state information...
python3-configobj is already the newest version (5.0.6-3).
python3-pymodbus is already the newest version (2.1.0+dfsg-1).
python3-serial is already the newest version (3.4-4).
bluetooth is already the newest version (5.50-1.2~deb10u1+rpt2).
libbluetooth-dev is already the newest version (5.50-1.2~deb10u1+rpt2).
python3-pip is already the newest version (18.1-5+rpt1).
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
python3-twisted : Depends: python3-twisted-bin (>= 18.9.0-3) but it is not going to be installed
Depends: python3-service-identity but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: paho-mqtt in /usr/local/lib/python3.7/dist-packages (1.5.1)
Requirement already satisfied: requests in /usr/lib/python3/dist-packages (2.21.0)
Requirement already satisfied: pybluez in /usr/local/lib/python3.7/dist-packages (0.23)
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: RPi.GPIO in /usr/lib/python3/dist-packages (0.7.0)
The user `emonhub' is already a member of `gpio'.
Unit /etc/systemd/system/[email protected] is masked, ignoring.
useradd: user 'emonhub' already exists
- installing emonhub.service
- Service ActiveState=active
--------------------------------------------------------------------
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
Added node 12 to emonhub.conf
[[13]]
Node 13 already present
[[14]]
Node 14 already present
Added node 15 to emonhub.conf
Added node 16 to emonhub.conf
[[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


Starting emonPi LCD service..


-------------------------------------------------------------
emonPi update done: Sun 18 Oct 14:47:23 BST 2020
-------------------------------------------------------------

emonhub log

2020-10-18 15:12:36,222 DEBUG MainThread Setting MQTT pubchannels: [‘ToRFM12’]
2020-10-18 15:12:36,222 DEBUG MainThread Setting MQTT subchannels: [‘ToEmonCMS’]
2020-10-18 15:12:36,222 INFO MainThread Setting MQTT node_format_enable: 1
2020-10-18 15:12:36,223 INFO MainThread Setting MQTT nodevar_format_enable: 1
2020-10-18 15:12:36,223 INFO MainThread Setting MQTT nodevar_format_basetopic: emon/
2020-10-18 15:12:36,224 INFO MainThread Creating EmonHubEmoncmsHTTPInterfacer ‘emoncmsorg’
2020-10-18 15:12:36,225 DEBUG MainThread Setting emoncmsorg pubchannels: [‘ToRFM12’]
2020-10-18 15:12:36,225 DEBUG MainThread Setting emoncmsorg subchannels: [‘ToEmonCMS’]
2020-10-18 15:12:36,225 WARNING MainThread Setting emoncmsorg apikey: obscured
2020-10-18 15:12:36,226 INFO MainThread Setting emoncmsorg url: https://emoncms.org
2020-10-18 15:12:36,226 INFO MainThread Setting emoncmsorg senddata: 1
2020-10-18 15:12:36,226 INFO MainThread Setting emoncmsorg sendstatus: 1
2020-10-18 15:21:19,202 INFO MainThread EmonHub emonHub (emon-pi variant) v2.1.5
2020-10-18 15:21:19,202 INFO MainThread Opening hub…
2020-10-18 15:21:19,203 INFO MainThread Logging level set to DEBUG
2020-10-18 15:21:19,203 INFO MainThread Creating EmonHubJeeInterfacer ‘RFM2Pi’
2020-10-18 15:21:19,204 ERROR MainThread Unable to create ‘RFM2Pi’ interfacer: module ‘serial’ has no attribute ‘SerialException’
2020-10-18 15:21:19,204 INFO MainThread Creating EmonHubMqttInterfacer ‘MQTT’
2020-10-18 15:21:19,206 DEBUG MainThread Setting MQTT pubchannels: [‘ToRFM12’]
2020-10-18 15:21:19,207 DEBUG MainThread Setting MQTT subchannels: [‘ToEmonCMS’]
2020-10-18 15:21:19,207 INFO MainThread Setting MQTT node_format_enable: 1
2020-10-18 15:21:19,207 INFO MainThread Setting MQTT nodevar_format_enable: 1
2020-10-18 15:21:19,207 INFO MainThread Setting MQTT nodevar_format_basetopic: emon/
2020-10-18 15:21:19,208 INFO MainThread Creating EmonHubEmoncmsHTTPInterfacer ‘emoncmsorg’
2020-10-18 15:21:19,209 DEBUG MainThread Setting emoncmsorg pubchannels: [‘ToRFM12’]
2020-10-18 15:21:19,210 DEBUG MainThread Setting emoncmsorg subchannels: [‘ToEmonCMS’]
2020-10-18 15:21:19,210 WARNING MainThread Setting emoncmsorg apikey: obscured
2020-10-18 15:21:19,210 INFO MainThread Setting emoncmsorg url: https://emoncms.org
2020-10-18 15:21:19,211 INFO MainThread Setting emoncmsorg senddata: 1
2020-10-18 15:21:19,211 INFO MainThread Setting emoncmsorg sendstatus: 1

That command is not relevant to emoncms as it was not installed via apt. I know it is in the log.

Did you do a full update or just emonhub? That could be the issue. click on full update (and be patient it sometimes takes a while).

image

I suspect it simply is not getting any data which is why it has stopped. Note this is the emonhub log not the emoncms log.

Did you run the update when you visited today?

What we really need is the output from the admin page which I realise in not local to you.

When you visit, can you click on the button Copy as Markdown next to Server Information on the Admin page and paste into a reply here please (no further formatting required).

If all the services are green, Then the next thing is the log file. Under the Disk section look and see if /var/log is over 50% full.

I’m around most days now so if you put up a message when you are going to visit then I’ll try and help. Late afternoons are best for me.

@borpin Thanks. I’m visiting for a few days so here is some stuff.

I did try a full update today. I’ve done both full update and emonhub update. Initially didn’t have much luck, but then went into terminal shell and ran “sudo dpkg --configure -a” which helped and it went a few more steps along (and got all the service lights green).

Disk - var log is on 3%

Server Information

Server Information

Services

  • emonhub :- Active Running
  • emoncms_mqtt :- Active Running
  • feedwriter :- Active Running - sleep 300s 0 feed points pending write
  • service-runner :- Active Running
  • emonPiLCD :- Active Running
  • redis-server :- Active Running
  • mosquitto :- Active Running
  • demandshaper :- Active Running

Emoncms

Server

  • OS :- Linux 4.19.75-v7+
  • Host :- emonpi | emonpi | (192.168.1.116)
  • Date :- 2020-10-18 17:42:40 BST
  • Uptime :- 17:42:40 up 2:17, 0 users, load average: 0.06, 0.04, 0.00

Memory

  • RAM :- Used: 18.73%
    • Total :- 975.62 MB
    • Used :- 182.69 MB
    • Free :- 792.93 MB
  • Swap :- Used: 0.00%
    • Total :- 100 MB
    • Used :- 0 B
    • Free :- 100 MB
      Write Load Period

Disk

  • / :- Used: 51.14%
    • Total :- 3.92 GB
    • Used :- 2.01 GB
    • Free :- 1.72 GB
    • Write Load :- 126.59 B/s (2 hours 8 mins)
  • /boot :- Used: 20.55%
    • Total :- 252.05 MB
    • Used :- 51.79 MB
    • Free :- 200.26 MB
    • Write Load :- 0 B/s (2 hours 8 mins)
  • /var/opt/emoncms :- Used: 0.52%
    • Total :- 9.98 GB
    • Used :- 53.6 MB
    • Free :- 9.42 GB
    • Write Load :- 0.13 B/s (2 hours 8 mins)
  • /var/log :- Used: 3.11%
    • Total :- 50 MB
    • Used :- 1.55 MB
    • Free :- 48.45 MB
    • Write Load :- n/a

HTTP

  • Server :- Apache/2.4.38 (Raspbian) HTTP/1.1 CGI/1.1 80

MySQL

  • Version :- 5.5.5-10.3.17-MariaDB-0+deb10u1
  • Host :- localhost:6379 (127.0.0.1)
  • Date :- 2020-10-18 17:42:40 (UTC 01:00‌​)
  • Stats :- Uptime: 8490 Threads: 13 Questions: 3832 Slow queries: 0 Opens: 48 Flush tables: 1 Open tables: 40 Queries per second avg: 0.451

Redis

  • Version :-
    • Redis Server :- 5.0.3
    • PHP Redis :- 5.0.2
  • Host :- localhost:6379
  • Size :- 172 keys (823.71K)
  • Uptime :- 0 days

MQTT Server

  • Version :- Mosquitto 1.5.7
  • Host :- localhost:1883 (127.0.0.1)

PHP

  • Version :- 7.3.9-1~deb10u1 (Zend Version 3.3.9)
  • Modules :- apache2handlercalendar Core ctype curl date dom v20031129exif fileinfo filter ftp gd gettext hash iconv json v1.7.0libxml mbstring mosquitto v0.4.0mysqli mysqlnd vmysqlnd 5.0.12-dev - 20150407 - $Id: 7cc7cc96e675f6d72e5cf0f267f48e167c2abb23 $openssl pcre PDO pdo_mysql Phar posix readline redis v5.0.2Reflection session shmop SimpleXML sockets sodium SPL standard sysvmsg sysvsem sysvshm tokenizer wddx xml xmlreader xmlwriter xsl Zend OPcache zlib

Pi

  • Model :- Raspberry Pi 3 Model B Rev 1.2 - 1GB (Sony UK)

  • Serial num. :- 76E6A80B

  • CPU Temperature :- 48.31°C

  • GPU Temperature :- 48.9°C

  • emonpiRelease :- emonSD-17Oct19

  • File-system :- read-write

Client Information

Client Information

HTTP

  • Browser :- Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36
  • Language :- en-GB,en-US;q=0.9,en;q=0.8

Window

  • Size :- 1665 x 971

Screen

  • Resolution :- 1680 x 1050

That really should not be required :frowning:

Could you do this please

sudo systemctl status {emonhub.service,feedwriter.service,emoncms_mqtt.service,service_runner.service}

When posting code or bash output, please 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

I was slightly surprised that it had got that bad myself, but that is what it said in the update log this morning, I had guessed that the SD card had gone bad, possible power cut or something.

I think that this is the script you asked for. It seems to repeat mutliple times but those 3 paragraphs are the same each time.

Unit service_runner.service could not be found.
● emonhub.service - emonHub data multiplexer
   Loaded: loaded (/opt/openenergymonitor/emonhub/service/emonhub.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2020-10-18 17:44:45 BST; 45min ago
 Main PID: 3669 (python3)
    Tasks: 3 (limit: 2319)
   Memory: 17.1M
   CGroup: /system.slice/emonhub.service
           └─3669 python3 /usr/local/bin/emonhub/emonhub.py --config-file=/etc/emonhub/emonhub.conf --logfile=/var/log/emonhub/emonhub.log

Oct 18 17:44:45 emonpi systemd[1]: Starting emonHub data multiplexer...
Oct 18 17:44:45 emonpi systemd[1]: Started emonHub data multiplexer.

● feedwriter.service - Emoncms feedwriter script
   Loaded: loaded (/var/www/emoncms/scripts/services/feedwriter/feedwriter.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2020-10-18 17:44:45 BST; 45min ago
     Docs: https://github.com/emoncms/emoncms/blob/master/scripts/services/install-service-feedwriter.md
 Main PID: 3639 (php)
    Tasks: 1 (limit: 2319)
   Memory: 4.1M
   CGroup: /system.slice/feedwriter.service
           └─3639 /usr/bin/php /var/www/emoncms/scripts/feedwriter.php

Oct 18 17:44:45 emonpi systemd[1]: Started Emoncms feedwriter script.

● emoncms_mqtt.service - Emoncms emoncms_mqtt script
   Loaded: loaded (/var/www/emoncms/scripts/services/emoncms_mqtt/emoncms_mqtt.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2020-10-18 17:44:45 BST; 45min ago
     Docs: https://github.com/emoncms/emoncms/blob/master/docs/RaspberryPi/MQTT.md
 Main PID: 3660 (php)
    Tasks: 1 (limit: 2319)
   Memory: 4.9M
   CGroup: /system.slice/emoncms_mqtt.service
           └─3660 /usr/bin/php /var/www/emoncms/scripts/services/emoncms_mqtt/emoncms_mqtt.php

Oct 18 17:44:45 emonpi systemd[1]: Started Emoncms emoncms_mqtt script.

Can you try and power down the emonPi. remove power completely (and the AC/AC if you have it.

Connect AC/AC and then the 5v power.

Just did a full power cycle as suggested but didn’t seem to change anything.

Server Information

Server Information

Services

  • emonhub :- Active Running
  • emoncms_mqtt :- Active Running
  • feedwriter :- Active Running - sleep 300s 0 feed points pending write
  • service-runner :- Active Running
  • emonPiLCD :- Active Running
  • redis-server :- Active Running
  • mosquitto :- Active Running
  • demandshaper :- Active Running

Emoncms

Server

  • OS :- Linux 4.19.75-v7+
  • Host :- emonpi | emonpi | (192.168.1.116)
  • Date :- 2020-10-18 21:02:45 BST
  • Uptime :- 21:02:45 up 7 min, 0 users, load average: 0.13, 0.24, 0.16

Memory

  • RAM :- Used: 18.40%
    • Total :- 975.62 MB
    • Used :- 179.56 MB
    • Free :- 796.06 MB
  • Swap :- Used: 0.00%
    • Total :- 100 MB
    • Used :- 0 B
    • Free :- 100 MB
      Write Load Period

Disk

  • / :- Used: 51.14%
    • Total :- 3.92 GB
    • Used :- 2.01 GB
    • Free :- 1.72 GB
    • Write Load :- 134.9 B/s (5 mins)
  • /var/opt/emoncms :- Used: 0.52%
    • Total :- 9.98 GB
    • Used :- 53.6 MB
    • Free :- 9.42 GB
    • Write Load :- 0 B/s (5 mins)
  • /boot :- Used: 20.55%
    • Total :- 252.05 MB
    • Used :- 51.79 MB
    • Free :- 200.26 MB
    • Write Load :- 0 B/s (5 mins)
  • /var/log :- Used: 3.41%
    • Total :- 50 MB
    • Used :- 1.7 MB
    • Free :- 48.3 MB
    • Write Load :- n/a

HTTP

  • Server :- Apache/2.4.38 (Raspbian) HTTP/1.1 CGI/1.1 80

MySQL

  • Version :- 5.5.5-10.3.17-MariaDB-0+deb10u1
  • Host :- localhost:6379 (127.0.0.1)
  • Date :- 2020-10-18 21:02:44 (UTC 01:00‌​)
  • Stats :- Uptime: 497 Threads: 13 Questions: 905 Slow queries: 0 Opens: 46 Flush tables: 1 Open tables: 40 Queries per second avg: 1.820

Redis

  • Version :-
    • Redis Server :- 5.0.3
    • PHP Redis :- 5.0.2
  • Host :- localhost:6379
  • Size :- 172 keys (823.66K)
  • Uptime :- 0 days

MQTT Server

  • Version :- Mosquitto 1.5.7
  • Host :- localhost:1883 (127.0.0.1)

PHP

  • Version :- 7.3.9-1~deb10u1 (Zend Version 3.3.9)
  • Modules :- apache2handlercalendar Core ctype curl date dom v20031129exif fileinfo filter ftp gd gettext hash iconv json v1.7.0libxml mbstring mosquitto v0.4.0mysqli mysqlnd vmysqlnd 5.0.12-dev - 20150407 - $Id: 7cc7cc96e675f6d72e5cf0f267f48e167c2abb23 $openssl pcre PDO pdo_mysql Phar posix readline redis v5.0.2Reflection session shmop SimpleXML sockets sodium SPL standard sysvmsg sysvsem sysvshm tokenizer wddx xml xmlreader xmlwriter xsl Zend OPcache zlib

Pi

  • Model :- Raspberry Pi 3 Model B Rev 1.2 - 1GB (Sony UK)

  • Serial num. :- 76E6A80B

  • CPU Temperature :- 49.39°C

  • GPU Temperature :- 48.9°C

  • emonpiRelease :- emonSD-17Oct19

  • File-system :- read-write

Client Information

Client Information

HTTP

  • Browser :- Mozilla/5.0 (iPad; CPU OS 13_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/86.0.4240.93 Mobile/15E148 Safari/604.1
  • Language :- en-gb

Window

  • Size :- 1024 x 653

Screen

  • Resolution :- 768 x 1024

Log from emonhub if useful


2020-10-18 20:54:08,237 DEBUG    MainThread Signal 15 received.
2020-10-18 20:54:08,400 INFO     MainThread Exiting hub...
2020-10-18 20:54:08,439 INFO     MainThread Exit completed
2020-10-18 20:54:43,557 INFO     MainThread EmonHub emonHub (emon-pi variant) v2.1.5
2020-10-18 20:54:43,558 INFO     MainThread Opening hub...
2020-10-18 20:54:43,559 INFO     MainThread Logging level set to DEBUG
2020-10-18 20:54:43,559 INFO     MainThread Creating EmonHubJeeInterfacer 'RFM2Pi'
2020-10-18 20:54:43,560 ERROR    MainThread Unable to create 'RFM2Pi' interfacer: module 'serial' has no attribute 'SerialException'
2020-10-18 20:54:43,560 INFO     MainThread Creating EmonHubMqttInterfacer 'MQTT'
2020-10-18 20:54:43,562 DEBUG    MainThread Setting MQTT pubchannels: ['ToRFM12']
2020-10-18 20:54:43,562 DEBUG    MainThread Setting MQTT subchannels: ['ToEmonCMS']
2020-10-18 20:54:43,563 INFO     MainThread Setting MQTT node_format_enable: 1
2020-10-18 20:54:43,563 INFO     MainThread Setting MQTT nodevar_format_enable: 1
2020-10-18 20:54:43,563 INFO     MainThread Setting MQTT nodevar_format_basetopic: emon/
2020-10-18 20:54:43,564 INFO     MainThread Creating EmonHubEmoncmsHTTPInterfacer 'emoncmsorg'
2020-10-18 20:54:43,565 DEBUG    MainThread Setting emoncmsorg pubchannels: ['ToRFM12']
2020-10-18 20:54:43,565 DEBUG    MainThread Setting emoncmsorg subchannels: ['ToEmonCMS']
2020-10-18 20:54:43,566 WARNING  MainThread Setting emoncmsorg apikey: obscured
2020-10-18 20:54:43,566 INFO     MainThread Setting emoncmsorg url: https://emoncms.org
2020-10-18 20:54:43,566 INFO     MainThread Setting emoncmsorg senddata: 1
2020-10-18 20:54:43,567 INFO     MainThread Setting emoncmsorg sendstatus: 1

So the problem is this line (@TrystanLea note)

ERROR    MainThread Unable to create 'RFM2Pi' interfacer: module 'serial' has no attribute 'SerialException'

I’m not too sure how to debug it. @bwduncan any ideas?

[edit]

Can you try this please

sudo apt-get install -y python3-serial
sudo systemctl restart emonhub.service

and check the emonhub log.

Tried those two commands and unfortunately the log looks much the same.

New SD card arriving today so planning on downloading new package onto that and installing that this afternoon/evening.

Here is a copy from terminal shell

pi@emonpi:~ $ sudo apt-get install -y python3-serial
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python3-serial is already the newest version (3.4-4).
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 python3-twisted : Depends: python3-twisted-bin (>= 18.9.0-3) but it is not going to be installed
                   Depends: python3-service-identity but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
pi@emonpi:~ $ sudo systemctl restart emonhub.service
pi@emonpi:~ $ apt --fix-broken install
E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?
pi@emonpi:~ $ 

and here is the log

2020-10-19 10:32:07,735 DEBUG    MainThread Signal 15 received.
2020-10-19 10:32:07,852 INFO     MainThread Exiting hub...
2020-10-19 10:32:07,972 INFO     MainThread Exit completed
2020-10-19 10:32:11,990 INFO     MainThread EmonHub emonHub (emon-pi variant) v2.1.5
2020-10-19 10:32:11,991 INFO     MainThread Opening hub...
2020-10-19 10:32:11,991 INFO     MainThread Logging level set to DEBUG
2020-10-19 10:32:11,992 INFO     MainThread Creating EmonHubJeeInterfacer 'RFM2Pi'
2020-10-19 10:32:11,993 ERROR    MainThread Unable to create 'RFM2Pi' interfacer: module 'serial' has no attribute 'SerialException'
2020-10-19 10:32:11,993 INFO     MainThread Creating EmonHubMqttInterfacer 'MQTT'
2020-10-19 10:32:11,995 DEBUG    MainThread Setting MQTT pubchannels: ['ToRFM12']
2020-10-19 10:32:11,995 DEBUG    MainThread Setting MQTT subchannels: ['ToEmonCMS']
2020-10-19 10:32:11,996 INFO     MainThread Setting MQTT node_format_enable: 1
2020-10-19 10:32:11,996 INFO     MainThread Setting MQTT nodevar_format_enable: 1
2020-10-19 10:32:11,996 INFO     MainThread Setting MQTT nodevar_format_basetopic: emon/
2020-10-19 10:32:11,997 INFO     MainThread Creating EmonHubEmoncmsHTTPInterfacer 'emoncmsorg'
2020-10-19 10:32:11,998 DEBUG    MainThread Setting emoncmsorg pubchannels: ['ToRFM12']
2020-10-19 10:32:11,998 DEBUG    MainThread Setting emoncmsorg subchannels: ['ToEmonCMS']
2020-10-19 10:32:11,999 WARNING  MainThread Setting emoncmsorg apikey: obscured
2020-10-19 10:32:11,999 INFO     MainThread Setting emoncmsorg url: https://emoncms.org
2020-10-19 10:32:11,999 INFO     MainThread Setting emoncmsorg senddata: 1
2020-10-19 10:32:12,000 INFO     MainThread Setting emoncmsorg sendstatus: 1

Run that as sudo

Sounds like your package installs are messed up. Please can you paste the output of

$ python3
>>> import serial
>>> serial

Also, have a look towards the end of /var/log/dpkg.log. This might give some clues. If something went wrong during the upgrade there is probably more than just serial that’s broken…

Bruce

Thanks for all the help so far,

This was all I got from import serial and serial.

pi@emonpi:~ $ python3
Python 3.7.3 (default, Jul 25 2020, 13:03:44) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import serial
>>> serial
<module 'serial' from '/usr/local/lib/python3.7/dist-packages/serial/__init__.py'>
>>> 

Sorry but I’m not sure, how does one view dpkg.log?

Also tried running fix-broken instrall as sudo and here’s the output:

pi@emonpi:~ $ sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  python3-service-identity python3-twisted-bin
Suggested packages:
  python3-twisted-bin-dbg
The following NEW packages will be installed:
  python3-service-identity python3-twisted-bin
0 upgraded, 2 newly installed, 0 to remove and 155 not upgraded.
1 not fully installed or removed.
Need to get 0 B/28.2 kB of archives.
After this operation, 102 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
E: Invalid archive signature
E: Internal error, could not locate member control.tar.{zstlz4gzxzbz2lzma}
E: Prior errors apply to /var/cache/apt/archives/python3-twisted-bin_18.9.0-3_armhf.deb
E: Invalid archive signature
E: Internal error, could not locate member control.tar.{zstlz4gzxzbz2lzma}
E: Prior errors apply to /var/cache/apt/archives/python3-service-identity_16.0.0-2_all.deb
debconf: apt-extracttemplates failed: No such file or directory
dpkg-deb: error: '/var/cache/apt/archives/python3-twisted-bin_18.9.0-3_armhf.deb' is not a Debian format archive
dpkg: error processing archive /var/cache/apt/archives/python3-twisted-bin_18.9.0-3_armhf.deb (--unpack):
 dpkg-deb --control subprocess returned error exit status 2
dpkg-deb: error: '/var/cache/apt/archives/python3-service-identity_16.0.0-2_all.deb' is not a Debian format archive
dpkg: error processing archive /var/cache/apt/archives/python3-service-identity_16.0.0-2_all.deb (--unpack):
 dpkg-deb --control subprocess returned error exit status 2
Errors were encountered while processing:
 /var/cache/apt/archives/python3-twisted-bin_18.9.0-3_armhf.deb
 /var/cache/apt/archives/python3-service-identity_16.0.0-2_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Hey,

Do

sudo apt clean
sudo apt update
sudo apt upgrade

Then try again

Sorry, on mobile. It’s raining lol

So I managed to get through the apt upgrade, ands it went through a very long update process (about 1h, did do it all which seemed encouraging).
It is now running the full update without too many errors.

Still getting the serial error on the emonhub log.
Tried running Python3 import serial, serial. and this is the output.

pi@emonpi:~ $ python3
Python 3.7.3 (default, Jul 25 2020, 13:03:44) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import serial
>>> serial
<module 'serial' from '/usr/local/lib/python3.7/dist-packages/serial/__init__.py'>
>>> 

LAST ENTRIES ON THE LOG FILE
Starting update via service-runner-update.sh (v3.0) >
- emonSD version: emonSD-17Oct19
- supported images: emonSD-24Jul20 emonSD-02Oct19 emonSD-17Oct19
- emonSD base image check passed...continue update
git pull /opt/openenergymonitor/EmonScripts
master
* stable
On branch stable
Your branch is up to date with 'origin/stable'.

nothing to commit, working tree clean
Already up to date.
-------------------------------------------------------------
Main Update Script
-------------------------------------------------------------
Date: Mon 19 Oct 21:34:48 BST 2020
EUID: 1000
openenergymonitor_dir: /opt/openenergymonitor
type: all
firmware: none
Reading package lists...
Building dependency tree...
Reading state information...
python3-pip is already the newest version (18.1-5+rpt1).
The following package was automatically installed and is no longer required:
rpi-eeprom-images
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: redis in /home/pi/.local/lib/python3.7/site-packages (3.5.3)
Hardware detected: EmonPi
Stopping emonPiLCD service
Display update message on LCD
Running apt-get update
Hit:1 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:2 http://archive.raspberrypi.org/debian buster InRelease
Reading package lists...
git pull /opt/openenergymonitor/emonpi
* master
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
Fetching origin
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
error: non-monotonic index .git/objects/pack/pack-928a90103b8f7fe560e9f5f87fb69e08821ffb38.idx
Already up to date.
git pull /opt/openenergymonitor/RFM2Pi
* master
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
Fetching origin
Already up to date.
Start emonhub update script:
-------------------------------------------------------------
emonHub update
-------------------------------------------------------------
git fetch --all --prune -v
Fetching origin
From https://github.com/openenergymonitor/emonhub
= [up to date] stable -> origin/stable
= [up to date] MQTTSubscriberInterfacer -> origin/MQTTSubscriberInterfacer
= [up to date] emon-pi -> origin/emon-pi
= [up to date] env_example -> origin/env_example
= [up to date] include_serial_number -> origin/include_serial_number
= [up to date] lanip-status -> origin/lanip-status
= [up to date] master -> origin/master
= [up to date] new_config_format -> origin/new_config_format
= [up to date] redis_config_interface -> origin/redis_config_interface
= [up to date] unitless_decoder -> origin/unitless_decoder
git status
On branch stable
Your branch is up to date with 'origin/stable'.

Untracked files:
(use "git add ..." to include in what will be committed)

src/src

nothing added to commit but untracked files present (use "git add" to track)
git pull origin stable
From https://github.com/openenergymonitor/emonhub
* branch stable -> FETCH_HEAD
Already up to date.

Running emonhub install & update script emonSD_pi_env:1
--------------------------------------------------------------------
Reading package lists...
Building dependency tree...
Reading state information...
python3-configobj is already the newest version (5.0.6-3).
python3-pymodbus is already the newest version (2.1.0+dfsg-1).
python3-serial is already the newest version (3.4-4).
bluetooth is already the newest version (5.50-1.2~deb10u1+rpt2).
libbluetooth-dev is already the newest version (5.50-1.2~deb10u1+rpt2).
python3-pip is already the newest version (18.1-5+rpt1).
The following package was automatically installed and is no longer required:
rpi-eeprom-images
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: paho-mqtt in /usr/local/lib/python3.7/dist-packages (1.5.1)
Requirement already satisfied: requests in /usr/lib/python3/dist-packages (2.21.0)
Requirement already satisfied: pybluez in /usr/local/lib/python3.7/dist-packages (0.23)
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: RPi.GPIO in /usr/lib/python3/dist-packages (0.7.0)
The user `emonhub' is already a member of `gpio'.
Unit /etc/systemd/system/[email protected] is masked, ignoring.
useradd: user 'emonhub' already exists
- installing emonhub.service
- Service ActiveState=active
--------------------------------------------------------------------
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:
-------------------------------------------------------------
Update Emoncms Core
-------------------------------------------------------------


Checking status of /var/www/emoncms git repository
- git branch: stable
fatal: Unknown index entry format 74720000
- no local changes
- running: git pull origin stable

fatal: Unknown index entry format 74720000
fatal: Unknown index entry format 74720000

Update Emoncms database
[]

-------------------------------------------------------------
Update Emoncms Services
-------------------------------------------------------------
emoncms_mqtt.service already installed
feedwriter.service already installed
service-runner.service already installed

Reloading systemctl deamon
Restarting Services...
- sudo systemctl restart feedwriter.service
--- ActiveState=active ---
- sudo systemctl restart emoncms_mqtt.service
--- ActiveState=active ---
- sudo systemctl restart emonhub.service
--- ActiveState=active ---
/opt/openenergymonitor/EmonScripts/sudoers.d/emoncms-rebootbutton: parsed OK
emonPi emoncms admin reboot button sudoers updated

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

Fetching origin
Already on 'stable'
Your branch is up to date with 'origin/stable'.
Already up to date.

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

Fetching origin
Already on 'stable'
Your branch is up to date with 'origin/stable'.
Already up to date.

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

Fetching origin
Already on 'stable'
Your branch is up to date with 'origin/stable'.
Already up to date.

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

Fetching origin
Already on 'stable'
Your branch is up to date with 'origin/stable'.
Already up to date.

------------------------------------------
Updating /var/www/emoncms/Modules/graph module
------------------------------------------
- git branch: stable
- git tags: 2.0.9-3-g6c18b0c
fatal: Unknown index entry format 6a730000
- no local changes
- running: git pull origin stable

Fetching origin
fatal: Unknown index entry format 6a730000
error: Could not fetch origin
fatal: Unknown index entry format 6a730000
fatal: Unknown index entry format 6a730000

------------------------------------------
Updating /var/www/emoncms/Modules/setup module
------------------------------------------
- git branch: stable
fatal: No names found, cannot describe anything.
- git tags:
- no local changes
- running: git pull origin stable

Fetching origin
Already on 'stable'
Your branch is up to date with 'origin/stable'.
Already up to date.

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

Fetching origin
Already on 'stable'
Your branch is up to date with 'origin/stable'.
Already up to date.

/opt/openenergymonitor/EmonScripts/sudoers.d/wifi-sudoers: parsed OK
wifi sudoers entry updated
------------------------------------------
Updating /opt/emoncms/modules/backup module
------------------------------------------
- git branch: stable
- git tags: 2.2.4-2-g50ee951
- no local changes
- running: git pull origin stable

Already up to date.
Already on 'stable'
Your branch is up to date with 'origin/stable'.

------------------------------------------
Updating /opt/emoncms/modules/demandshaper module
------------------------------------------
- git branch: stable
- git tags: 2.0.1
- no local changes
- running: git pull origin stable

Already up to date.
Already on 'stable'
Your branch is up to date with 'origin/stable'.

------------------------------------------
Updating /opt/emoncms/modules/postprocess module
------------------------------------------
- git branch: stable
- git tags: 2.1.4
- no local changes
- running: git pull origin stable

Already up to date.
Already on 'stable'
Your branch is up to date with 'origin/stable'.

------------------------------------------
Updating /opt/emoncms/modules/sync module
------------------------------------------
- git branch: stable
- git tags: 2.0.5-3-g109816f
- no local changes
- running: git pull origin stable

Already up to date.
Already on 'stable'
Your branch is up to date with 'origin/stable'.

------------------------------------------
Updating /opt/emoncms/modules/usefulscripts module
------------------------------------------
- git branch: stable
fatal: No names found, cannot describe anything.
- git tags:
- no local changes
- running: git pull origin stable

Already up to date.
Already on 'stable'
Your branch is up to date with 'origin/stable'.

--------------------------------------------
Backup module installation and update script
--------------------------------------------
- Loading EmonScripts config.ini
- Copying default.config.cfg to config.cfg
- Setting config.cfg settings
- Backup module symlink already exists
- PHP Version: 7.3
- Creating /etc/php/7.3/mods-available/emoncmsbackup.ini
post_max_size = 3G
upload_max_filesize = 3G
upload_tmp_dir = /var/opt/emoncms/backup/uploads
- phpenmod emoncmsbackup
- /var/opt/emoncms/backup already exists
- /var/opt/emoncms/backup/uploads already exists
- restarting apache

Update Emoncms database
[]

-------------------------------------------------------------
EmonPi LCD Update
-------------------------------------------------------------
Reading package lists...
Building dependency tree...
Reading state information...
i2c-tools is already the newest version (4.1-1).
python3-smbus is already the newest version (4.1-1).
python3-gpiozero is already the newest version (1.5.1).
python3-rpi.gpio is already the newest version (0.7.0-0.1~bpo10+1).
The following package was automatically installed and is no longer required:
rpi-eeprom-images
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: redis in /home/pi/.local/lib/python3.7/site-packages (3.5.3)
Requirement already satisfied: paho-mqtt in /usr/local/lib/python3.7/dist-packages (1.5.1)
Requirement already satisfied: xmltodict in /home/pi/.local/lib/python3.7/site-packages (0.12.0)
Requirement already satisfied: requests in /usr/lib/python3/dist-packages (2.21.0)
- reinstalling emonPiLCD.service
Removed /etc/systemd/system/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: Mon 19 Oct 21:36:37 BST 2020
-------------------------------------------------------------
restarting service-runner

I’ve never seen this error. I think your SD card is toasted.

That looks like the right serial module. You could see what it says if you enter serial.SerialException or even serial.Serial. You should get sensible outputs, not exceptions. I suspect this is a side-effect of the previously mentioned trip of the SD card through a toaster…

We can probably get things working well enough to make it go again and rescue the data, but if you can replace the SD card I would do that. It could be that this was a one-off power glitch during an update, but I would be inclined not to trust this card any more. Sorry.

I’m in agreement.

Highly likely, but stop using the card.

Good point. If the power cut came at an inappropriate time, that could cause the issues. As I have said on numerous occasions, I’ve never had an issue with a Pi when I have simply powered off. IMHO, I think it is the associated spikes of a power cut that do for the cards. Personally all my Pis are behind a surge protector.

Thank you both @borpin and @bwduncan for the advice.
Pretty sure it was a corrupt SD card from something. I ended up doing a fresh install and all setup again pretty quickly and on the 2020 pi version now.

I made the mistake of ordering a replacement SD card not microSD so couldn’t import the setting, but all up and running again pretty quickly and all mainly done from an iPad!

2 Likes