Emonhub - paho-mqtt fails to install

@borpin and @Vster ,

Thanks for your kind help.
I was able to reload the software and to import previous settings and databases.
I like the new interface!!

I still do not get any readings from any of the sensors.
If I scroll back to the date that is reported on the FEEDS page as the last feed, all my previous readings are still intact. Awesome!.

Feeds on feed/view all shows “inactive”
Input on /input/view are all n/a and NULL

I have no idea where to start.

Could the RPi be faulty,?
Could the emonPi board be faulty?

I do have a Pi 3B + > can I replace it to test?

Any pointers would be appreciated

Kind Regards

Frits

I am not sure if these are any clues

Here you can see the sudden stop of feed on 3 Nov

A dashboard confirming the stop of feed

So the issue is that the emonhub service has not started correctly.

Go to the emonhub page in emoncms and send us the log.

Check the LOGLEVEL is DEBUG.

I have been able to get the emonhub running as per the Admin Systems page, but after a minute or two, the emonhub round indicator on the left goes red again.

After click on “Restart” this is where all gets stuck

Perhaps this provides some info you need:

Please copy and paste the text especially after emonhub restarts

Can you SSH into the EmonPi and type

journalctl -f -u emonhub

I suggest you also try an emoncms ‘full update’ and paste that log file as well.

@borpin ,

I hope I understood the instructions correct: I ran the command and below is the output
I sent “journalctl -f -u emonhub” and had to copy /paste the output.
I had to stop it by Ctrl+c: since it got caught in a repeating-cycle doing that over and over:-

*pi@emonpi:~ $ journalctl -f -u emonhub*
-- Logs begin at Wed 2022-05-18 09:09:56 SAST. --
May 18 16:32:42 emonpi systemd[1]: Starting emonHub data multiplexer...
May 18 16:32:43 emonpi systemd[1]: Started emonHub data multiplexer.
May 18 16:32:45 emonpi emonhub.py[30359]: Traceback (most recent call last):
May 18 16:32:45 emonpi emonhub.py[30359]:   File "/usr/local/bin/emonhub/emonhub                                                                                                                            .py", line 26, in <module>
May 18 16:32:45 emonpi emonhub.py[30359]:     from interfacers import *
May 18 16:32:45 emonpi emonhub.py[30359]:   File "/opt/openenergymonitor/emonhub                                                                                                                            /src/interfacers/EmonHubMqttInterfacer.py", line 33, in <module>
May 18 16:32:45 emonpi emonhub.py[30359]:     import paho.mqtt.client as mqtt
May 18 16:32:45 emonpi emonhub.py[30359]: ModuleNotFoundError: No module named '                                                                                                                            paho'
May 18 16:32:45 emonpi systemd[1]: emonhub.service: Main process exited, code=ex                                                                                                                            ited, status=1/FAILURE
May 18 16:32:45 emonpi systemd[1]: emonhub.service: Failed with result 'exit-cod                                                                                                                            e'.
May 18 16:32:50 emonpi systemd[1]: emonhub.service: Service RestartSec=5s expired, scheduling restart.
May 18 16:32:50 emonpi systemd[1]: emonhub.service: Scheduled restart job, restart counter is at 11603.
May 18 16:32:50 emonpi systemd[1]: Stopped emonHub data multiplexer.
May 18 16:32:50 emonpi systemd[1]: Starting emonHub data multiplexer...
May 18 16:32:51 emonpi systemd[1]: Started emonHub data multiplexer.
May 18 16:32:53 emonpi emonhub.py[30364]: Traceback (most recent call last):
May 18 16:32:53 emonpi emonhub.py[30364]:   File "/usr/local/bin/emonhub/emonhub.py", line 26, in <module>
May 18 16:32:53 emonpi emonhub.py[30364]:     from interfacers import *
May 18 16:32:53 emonpi emonhub.py[30364]:   File "/opt/openenergymonitor/emonhub/src/interfacers/EmonHubMqttInterfacer.py", line 33, in <module>
May 18 16:32:53 emonpi emonhub.py[30364]:     import paho.mqtt.client as mqtt
May 18 16:32:53 emonpi emonhub.py[30364]: ModuleNotFoundError: No module named 'paho'
May 18 16:32:53 emonpi systemd[1]: emonhub.service: Main process exited, code=exited, status=1/FAILURE
May 18 16:32:53 emonpi systemd[1]: emonhub.service: Failed with result 'exit-code'.
May 18 16:32:58 emonpi systemd[1]: emonhub.service: Service RestartSec=5s expired, scheduling restart.
May 18 16:32:58 emonpi systemd[1]: emonhub.service: Scheduled restart job, restart counter is at 11604.
May 18 16:32:58 emonpi systemd[1]: Stopped emonHub data multiplexer.
May 18 16:32:58 emonpi systemd[1]: Starting emonHub data multiplexer...
May 18 16:32:59 emonpi systemd[1]: Started emonHub data multiplexer.
May 18 16:33:01 emonpi emonhub.py[30368]: Traceback (most recent call last):
May 18 16:33:01 emonpi emonhub.py[30368]:   File "/usr/local/bin/emonhub/emonhub.py", line 26, in <module>
May 18 16:33:01 emonpi emonhub.py[30368]:     from interfacers import *
May 18 16:33:01 emonpi emonhub.py[30368]:   File "/opt/openenergymonitor/emonhub/src/interfacers/EmonHubMqttInterfacer.py", line 33, in <module>
May 18 16:33:01 emonpi emonhub.py[30368]:     import paho.mqtt.client as mqtt
May 18 16:33:01 emonpi emonhub.py[30368]: ModuleNotFoundError: No module named 'paho'
May 18 16:33:01 emonpi systemd[1]: emonhub.service: Main process exited, code=exited, status=1/FAILURE
May 18 16:33:01 emonpi systemd[1]: emonhub.service: Failed with result 'exit-code'.
May 18 16:33:06 emonpi systemd[1]: emonhub.service: Service RestartSec=5s expired, scheduling restart.
May 18 16:33:06 emonpi systemd[1]: emonhub.service: Scheduled restart job, restart counter is at 11605.
May 18 16:33:06 emonpi systemd[1]: Stopped emonHub data multiplexer.
May 18 16:33:06 emonpi systemd[1]: Starting emonHub data multiplexer...
May 18 16:33:07 emonpi systemd[1]: Started emonHub data multiplexer.
May 18 16:33:09 emonpi emonhub.py[30372]: Traceback (most recent call last):
May 18 16:33:09 emonpi emonhub.py[30372]:   File "/usr/local/bin/emonhub/emonhub.py", line 26, in <module>
May 18 16:33:09 emonpi emonhub.py[30372]:     from interfacers import *
May 18 16:33:09 emonpi emonhub.py[30372]:   File "/opt/openenergymonitor/emonhub/src/interfacers/EmonHubMqttInterfacer.py", line 33, in <module>
May 18 16:33:09 emonpi emonhub.py[30372]:     import paho.mqtt.client as mqtt
May 18 16:33:09 emonpi emonhub.py[30372]: ModuleNotFoundError: No module named 'paho'
May 18 16:33:09 emonpi systemd[1]: emonhub.service: Main process exited, code=exited, status=1/FAILURE
May 18 16:33:09 emonpi systemd[1]: emonhub.service: Failed with result 'exit-code'.
May 18 16:33:14 emonpi systemd[1]: emonhub.service: Service RestartSec=5s expired, scheduling restart.
May 18 16:33:14 emonpi systemd[1]: emonhub.service: Scheduled restart job, restart counter is at 11606.
May 18 16:33:14 emonpi systemd[1]: Stopped emonHub data multiplexer.
May 18 16:33:14 emonpi systemd[1]: Starting emonHub data multiplexer...
May 18 16:33:15 emonpi systemd[1]: Started emonHub data multiplexer.
May 18 16:33:17 emonpi emonhub.py[30376]: Traceback (most recent call last):
May 18 16:33:17 emonpi emonhub.py[30376]:   File "/usr/local/bin/emonhub/emonhub.py", line 26, in <module>
May 18 16:33:17 emonpi emonhub.py[30376]:     from interfacers import *
May 18 16:33:17 emonpi emonhub.py[30376]:   File "/opt/openenergymonitor/emonhub/src/interfacers/EmonHubMqttInterfacer.py", line 33, in <module>
May 18 16:33:17 emonpi emonhub.py[30376]:     import paho.mqtt.client as mqtt
May 18 16:33:17 emonpi emonhub.py[30376]: ModuleNotFoundError: No module named 'paho'
May 18 16:33:17 emonpi systemd[1]: emonhub.service: Main process exited, code=exited, status=1/FAILURE
May 18 16:33:17 emonpi systemd[1]: emonhub.service: Failed with result 'exit-code'.
May 18 16:33:22 emonpi systemd[1]: emonhub.service: Service RestartSec=5s expired, scheduling restart.
May 18 16:33:22 emonpi systemd[1]: emonhub.service: Scheduled restart job, restart counter is at 11607.
May 18 16:33:22 emonpi systemd[1]: Stopped emonHub data multiplexer.
May 18 16:33:22 emonpi systemd[1]: Starting emonHub data multiplexer...
May 18 16:33:23 emonpi systemd[1]: Started emonHub data multiplexer.
May 18 16:33:25 emonpi emonhub.py[30380]: Traceback (most recent call last):
May 18 16:33:25 emonpi emonhub.py[30380]:   File "/usr/local/bin/emonhub/emonhub.py", line 26, in <module>
May 18 16:33:25 emonpi emonhub.py[30380]:     from interfacers import *
May 18 16:33:25 emonpi emonhub.py[30380]:   File "/opt/openenergymonitor/emonhub/src/interfacers/EmonHubMqttInterfacer.py", line 33, in <module>
May 18 16:33:25 emonpi emonhub.py[30380]:     import paho.mqtt.client as mqtt
May 18 16:33:25 emonpi emonhub.py[30380]: ModuleNotFoundError: No module named 'paho'
May 18 16:33:25 emonpi systemd[1]: emonhub.service: Main process exited, code=exited, status=1/FAILURE
May 18 16:33:25 emonpi systemd[1]: emonhub.service: Failed with result 'exit-code'.
May 18 16:33:31 emonpi systemd[1]: emonhub.service: Service RestartSec=5s expired, scheduling restart.
May 18 16:33:31 emonpi systemd[1]: emonhub.service: Scheduled restart job, restart counter is at 11608.
May 18 16:33:31 emonpi systemd[1]: Stopped emonHub data multiplexer.
May 18 16:33:31 emonpi systemd[1]: Starting emonHub data multiplexer...
May 18 16:33:31 emonpi systemd[1]: Started emonHub data multiplexer.
May 18 16:33:33 emonpi emonhub.py[30384]: Traceback (most recent call last):
May 18 16:33:33 emonpi emonhub.py[30384]:   File "/usr/local/bin/emonhub/emonhub.py", line 26, in <module>
May 18 16:33:33 emonpi emonhub.py[30384]:     from interfacers import *
May 18 16:33:33 emonpi emonhub.py[30384]:   File "/opt/openenergymonitor/emonhub/src/interfacers/EmonHubMqttInterfacer.py", line 33, in <module>
May 18 16:33:33 emonpi emonhub.py[30384]:     import paho.mqtt.client as mqtt
May 18 16:33:33 emonpi emonhub.py[30384]: ModuleNotFoundError: No module named 'paho'
May 18 16:33:34 emonpi systemd[1]: emonhub.service: Main process exited, code=exited, status=1/FAILURE
May 18 16:33:34 emonpi systemd[1]: emonhub.service: Failed with result 'exit-code'.
May 18 16:33:39 emonpi systemd[1]: emonhub.service: Service RestartSec=5s expired, scheduling restart.
May 18 16:33:39 emonpi systemd[1]: emonhub.service: Scheduled restart job, restart counter is at 11609.
May 18 16:33:39 emonpi systemd[1]: Stopped emonHub data multiplexer.
May 18 16:33:39 emonpi systemd[1]: Starting emonHub data multiplexer...
May 18 16:33:39 emonpi systemd[1]: Started emonHub data multiplexer.
May 18 16:33:41 emonpi emonhub.py[30388]: Traceback (most recent call last):
May 18 16:33:41 emonpi emonhub.py[30388]:   File "/usr/local/bin/emonhub/emonhub.py", line 26, in <module>
May 18 16:33:41 emonpi emonhub.py[30388]:     from interfacers import *
May 18 16:33:41 emonpi emonhub.py[30388]:   File "/opt/openenergymonitor/emonhub/src/interfacers/EmonHubMqttInterfacer.py", line 33, in <module>
May 18 16:33:41 emonpi emonhub.py[30388]:     import paho.mqtt.client as mqtt
May 18 16:33:41 emonpi emonhub.py[30388]: ModuleNotFoundError: No module named 'paho'
May 18 16:33:42 emonpi systemd[1]: emonhub.service: Main process exited, code=exited, status=1/FAILURE
May 18 16:33:42 emonpi systemd[1]: emonhub.service: Failed with result 'exit-code'.
May 18 16:33:47 emonpi systemd[1]: emonhub.service: Service RestartSec=5s expired, scheduling restart.
May 18 16:33:47 emonpi systemd[1]: emonhub.service: Scheduled restart job, restart counter is at 11610.
May 18 16:33:47 emonpi systemd[1]: Stopped emonHub data multiplexer.
May 18 16:33:47 emonpi systemd[1]: Starting emonHub data multiplexer...
May 18 16:33:47 emonpi systemd[1]: Started emonHub data multiplexer.
May 18 16:33:50 emonpi emonhub.py[30392]: Traceback (most recent call last):
May 18 16:33:50 emonpi emonhub.py[30392]:   File "/usr/local/bin/emonhub/emonhub.py", line 26, in <module>
May 18 16:33:50 emonpi emonhub.py[30392]:     from interfacers import *
May 18 16:33:50 emonpi emonhub.py[30392]:   File "/opt/openenergymonitor/emonhub/src/interfacers/EmonHubMqttInterfacer.py", line 33, in <module>
May 18 16:33:50 emonpi emonhub.py[30392]:     import paho.mqtt.client as mqtt
May 18 16:33:50 emonpi emonhub.py[30392]: ModuleNotFoundError: No module named 'paho'
May 18 16:33:50 emonpi systemd[1]: emonhub.service: Main process exited, code=exited, status=1/FAILURE
May 18 16:33:50 emonpi systemd[1]: emonhub.service: Failed with result 'exit-code'.
May 18 16:33:55 emonpi systemd[1]: emonhub.service: Service RestartSec=5s expired, scheduling restart.
May 18 16:33:55 emonpi systemd[1]: emonhub.service: Scheduled restart job, restart counter is at 11611.
May 18 16:33:55 emonpi systemd[1]: Stopped emonHub data multiplexer.
May 18 16:33:55 emonpi systemd[1]: Starting emonHub data multiplexer...
May 18 16:33:56 emonpi systemd[1]: Started emonHub data multiplexer.
May 18 16:33:58 emonpi emonhub.py[30396]: Traceback (most recent call last):
May 18 16:33:58 emonpi emonhub.py[30396]:   File "/usr/local/bin/emonhub/emonhub.py", line 26, in <module>
May 18 16:33:58 emonpi emonhub.py[30396]:     from interfacers import *
May 18 16:33:58 emonpi emonhub.py[30396]:   File "/opt/openenergymonitor/emonhub/src/interfacers/EmonHubMqttInterfacer.py", line 33, in <module>
May 18 16:33:58 emonpi emonhub.py[30396]:     import paho.mqtt.client as mqtt
May 18 16:33:58 emonpi emonhub.py[30396]: ModuleNotFoundError: No module named 'paho'
May 18 16:33:58 emonpi systemd[1]: emonhub.service: Main process exited, code=exited, status=1/FAILURE
May 18 16:33:58 emonpi systemd[1]: emonhub.service: Failed with result 'exit-code'.

FULL UPDATE Log:

LAST ENTRIES ON THE LOG FILE
Starting update via service-runner-update.sh (v3.0) >
Filesystem Size Used Avail Use% Mounted on
/dev/root 20G 2.1G 17G 11% /
devtmpfs 430M 0 430M 0% /dev
tmpfs 462M 0 462M 0% /dev/shm
tmpfs 462M 6.2M 456M 2% /run
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 462M 0 462M 0% /sys/fs/cgroup
tmpfs 1.0M 0 1.0M 0% /var/tmp
tmpfs 1.0M 0 1.0M 0% /var/lib/php/sessions
tmpfs 30M 16K 30M 1% /tmp
/dev/mmcblk0p3 9.9G 3.8M 9.4G 1% /var/opt/emoncms
/dev/mmcblk0p1 253M 49M 204M 20% /boot
log2ram 50M 1.5M 49M 3% /var/log
tmpfs 93M 0 93M 0% /run/user/1000
- emonSD version: emonSD-02Oct19
- supported images: emonSD-21Jul21 emonSD-08May21 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: Tue 17 May 12:53:46 BST 2022
EUID: 1000
openenergymonitor_dir: /opt/openenergymonitor
type: all
serial_port: ttyAMA0
firmware: emonpi
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:
python-colorzero
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 /usr/local/lib/python3.7/dist-packages (4.3.1)
Exception:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/_internal/cli/base_command.py", line 143, in main
status = self.run(options, args)
File "/usr/lib/python3/dist-packages/pip/_internal/commands/install.py", line 338, in run
resolver.resolve(requirement_set)
File "/usr/lib/python3/dist-packages/pip/_internal/resolve.py", line 102, in resolve
self._resolve_one(requirement_set, req)
File "/usr/lib/python3/dist-packages/pip/_internal/resolve.py", line 261, in _resolve_one
check_dist_requires_python(dist)
File "/usr/lib/python3/dist-packages/pip/_internal/utils/packaging.py", line 55, in check_dist_requires_python
if not check_requires_python(requires_python):
File "/usr/lib/python3/dist-packages/pip/_internal/utils/packaging.py", line 33, in check_requires_python
return python_version in requires_python_specifier
File "/usr/share/python-wheels/packaging-19.0-py2.py3-none-any.whl/packaging/specifiers.py", line 676, in __contains__
return self.contains(item)
File "/usr/share/python-wheels/packaging-19.0-py2.py3-none-any.whl/packaging/specifiers.py", line 681, in contains
item = parse(item)
File "/usr/share/python-wheels/packaging-19.0-py2.py3-none-any.whl/packaging/version.py", line 28, in parse
return Version(version)
File "/usr/share/python-wheels/packaging-19.0-py2.py3-none-any.whl/packaging/version.py", line 219, in __init__
match = self._regex.search(version)
TypeError: expected string or bytes-like object
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
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
-------------------------------------------------------------
Updating /opt/openenergymonitor/emonhub
- current branch: stable
- local changes: no
- git fetch: Fetching origin
Already on 'stable'
- git checkout: Your branch is up to date with 'origin/stable'.
- git pull: Already up to date.
- database update: no changes
- running module install/update script
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~deb10u2+rpt1).
libbluetooth-dev is already the newest version (5.50-1.2~deb10u2+rpt1).
python3-pip is already the newest version (18.1-5+rpt1).
The following package was automatically installed and is no longer required:
python-colorzero
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
Collecting paho-mqtt
Using cached https://www.piwheels.org/simple/paho-mqtt/paho_mqtt-1.6.1-py3-none-any.whl
Requirement already satisfied: requests in /usr/lib/python3/dist-packages (2.21.0)
Exception:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/_internal/cli/base_command.py", line 143, in main
status = self.run(options, args)
File "/usr/lib/python3/dist-packages/pip/_internal/commands/install.py", line 338, in run
resolver.resolve(requirement_set)
File "/usr/lib/python3/dist-packages/pip/_internal/resolve.py", line 102, in resolve
self._resolve_one(requirement_set, req)
File "/usr/lib/python3/dist-packages/pip/_internal/resolve.py", line 261, in _resolve_one
check_dist_requires_python(dist)
File "/usr/lib/python3/dist-packages/pip/_internal/utils/packaging.py", line 55, in check_dist_requires_python
if not check_requires_python(requires_python):
File "/usr/lib/python3/dist-packages/pip/_internal/utils/packaging.py", line 33, in check_requires_python
return python_version in requires_python_specifier
File "/usr/share/python-wheels/packaging-19.0-py2.py3-none-any.whl/packaging/specifiers.py", line 676, in __contains__
return self.contains(item)
File "/usr/share/python-wheels/packaging-19.0-py2.py3-none-any.whl/packaging/specifiers.py", line 681, in contains
item = parse(item)
File "/usr/share/python-wheels/packaging-19.0-py2.py3-none-any.whl/packaging/version.py", line 28, in parse
return Version(version)
File "/usr/share/python-wheels/packaging-19.0-py2.py3-none-any.whl/packaging/version.py", line 219, in __init__
match = self._regex.search(version)
TypeError: expected string or bytes-like object
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)
Adding user `emonhub' to group `gpio' ...
Adding user emonhub to group gpio
Done.
Unit /etc/systemd/system/[email protected] is masked, ignoring.
useradd: user 'emonhub' already exists
- installing emonhub.service
- Service ActiveState=active
- component updated

Start emoncms update:
-------------------------------------------------------------
Update Emoncms Core
-------------------------------------------------------------
Updating /var/www/emoncms
- current branch: stable
- local changes: no
- git fetch: Fetching origin
Already on 'stable'
- git checkout: Your branch is up to date with 'origin/stable'.
- git pull: Already up to date.
- database update: no changes
- component updated
-------------------------------------------------------------
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
- current branch: stable
- local changes: no
- git fetch: Fetching origin
Already on 'stable'
- git checkout: Your branch is up to date with 'origin/stable'.
- git pull: Already up to date.
- database update: no changes
- component updated
Updating /var/www/emoncms/Modules/config
- current branch: stable
- local changes: no
- git fetch: Fetching origin
Already on 'stable'
- git checkout: Your branch is up to date with 'origin/stable'.
- git pull: Already up to date.
- database update: no changes
- component updated
Updating /var/www/emoncms/Modules/dashboard
- current branch: stable
- local changes: no
- git fetch: Fetching origin
Already on 'stable'
- git checkout: Your branch is up to date with 'origin/stable'.
- git pull: Already up to date.
- database update: no changes
- component updated
Updating /var/www/emoncms/Modules/device
- current branch: stable
- local changes: no
- git fetch: Fetching origin
Already on 'stable'
- git checkout: Your branch is up to date with 'origin/stable'.
- git pull: Already up to date.
- database update: no changes
- component updated
Updating /var/www/emoncms/Modules/graph
- current branch: stable
- local changes: no
- git fetch: Fetching origin
Already on 'stable'
- git checkout: Your branch is up to date with 'origin/stable'.
- git pull: Already up to date.
- database update: no changes
- component updated
Updating /var/www/emoncms/Modules/setup
- current branch: stable
- local changes: no
- git fetch: Fetching origin
Already on 'stable'
- git checkout: Your branch is up to date with 'origin/stable'.
- git pull: Already up to date.
- database update: no changes
- component updated
Updating /var/www/emoncms/Modules/wifi
- current branch: stable
- local changes: no
- git fetch: Fetching origin
Already on 'stable'
- git checkout: Your branch is up to date with 'origin/stable'.
- git pull: Already up to date.
- database update: no changes
- component updated
Updating /opt/emoncms/modules/backup
- current branch: stable
- local changes: no
- git fetch: Fetching origin
Already on 'stable'
- git checkout: Your branch is up to date with 'origin/stable'.
- git pull: Already up to date.
- database update: no changes
- running module install/update script
- config.cfg already exists, left unmodified
- 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
- restarting apache
- component updated
Updating /opt/emoncms/modules/demandshaper
- current branch: stable
- local changes: no
- git fetch: Fetching origin
Already on 'stable'
- git checkout: Your branch is up to date with 'origin/stable'.
- git pull: Already up to date.
- database update: no changes
- running module install/update script
- reinstalling demandshaper.service
- demandshaper service: ActiveState=active
- component updated
Updating /opt/emoncms/modules/postprocess
- current branch: stable
- local changes: no
- git fetch: Fetching origin
Already on 'stable'
- git checkout: Your branch is up to date with 'origin/stable'.
- git pull: Already up to date.
- database update: no changes
- component updated
Updating /opt/emoncms/modules/sync
- current branch: stable
- local changes: no
- git fetch: Fetching origin
Already on 'stable'
- git checkout: Your branch is up to date with 'origin/stable'.
- git pull: Already up to date.
- database update: no changes
- component updated
Updating /opt/emoncms/modules/usefulscripts
- current branch: stable
- local changes: no
- git fetch: Fetching origin
Already on 'stable'
- git checkout: Your branch is up to date with 'origin/stable'.
- git pull: Already up to date.
- database update: no changes
- component updated
/opt/openenergymonitor/EmonScripts/sudoers.d/wifi-sudoers: parsed OK
wifi sudoers entry updated

-------------------------------------------------------------
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.6.2-1).
python3-rpi.gpio is already the newest version (0.7.0-0.1~bpo10+4).
The following package was automatically installed and is no longer required:
python-colorzero
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 /usr/local/lib/python3.7/dist-packages (4.3.1)
Exception:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/_internal/cli/base_command.py", line 143, in main
status = self.run(options, args)
File "/usr/lib/python3/dist-packages/pip/_internal/commands/install.py", line 338, in run
resolver.resolve(requirement_set)
File "/usr/lib/python3/dist-packages/pip/_internal/resolve.py", line 102, in resolve
self._resolve_one(requirement_set, req)
File "/usr/lib/python3/dist-packages/pip/_internal/resolve.py", line 261, in _resolve_one
check_dist_requires_python(dist)
File "/usr/lib/python3/dist-packages/pip/_internal/utils/packaging.py", line 55, in check_dist_requires_python
if not check_requires_python(requires_python):
File "/usr/lib/python3/dist-packages/pip/_internal/utils/packaging.py", line 33, in check_requires_python
return python_version in requires_python_specifier
File "/usr/share/python-wheels/packaging-19.0-py2.py3-none-any.whl/packaging/specifiers.py", line 676, in __contains__
return self.contains(item)
File "/usr/share/python-wheels/packaging-19.0-py2.py3-none-any.whl/packaging/specifiers.py", line 681, in contains
item = parse(item)
File "/usr/share/python-wheels/packaging-19.0-py2.py3-none-any.whl/packaging/version.py", line 28, in parse
return Version(version)
File "/usr/share/python-wheels/packaging-19.0-py2.py3-none-any.whl/packaging/version.py", line 219, in __init__
match = self._regex.search(version)
TypeError: expected string or bytes-like object
- reinstalling emonPiLCD.service
Removed /etc/systemd/system/multi-user.target.wants/emonPiLCD.service.
Removed /etc/systemd/system/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
-------------------------------------------------------------
emonPi_discrete_jeelib Firmware Upload
-------------------------------------------------------------
Downloading firmware from:
https://github.com/openenergymonitor/emonpi/releases/download/2.9.3/firmware.hex

Downloaded file:
-rw-r--r-- 1 pi pi 53K Dec 7 17:54 /opt/openenergymonitor/data/firmware/emonPi_discrete_jeelib.hex

Uploading emonPi_discrete_jeelib on serial port ttyAMA0
Attempt 1...


avrdude-original: Version 6.3-20171130
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch

System wide configuration file is "/etc/avrdude.conf"
User configuration file is "/root/.avrduderc"
User configuration file does not exist or is not a regular file, skipping

Using Port : /dev/ttyAMA0
Using Programmer : arduino
Overriding Baud Rate : 115200
avrdude-original: Using autoreset DTR on GPIO Pin 7
avrdude-original: stk500_getsync() attempt 1 of 10: not in sync: resp=0x1c
avrdude-original: stk500_getsync() attempt 2 of 10: not in sync: resp=0xe0
avrdude-original: stk500_getsync() attempt 3 of 10: not in sync: resp=0x1c
avrdude-original: stk500_getsync() attempt 4 of 10: not in sync: resp=0xfc
avrdude-original: stk500_getsync() attempt 5 of 10: not in sync: resp=0x7e
avrdude-original: stk500_getsync() attempt 6 of 10: not in sync: resp=0xc7
avrdude-original: stk500_getsync() attempt 7 of 10: not in sync: resp=0xfc
avrdude-original: stk500_getsync() attempt 8 of 10: not in sync: resp=0x0e
avrdude-original: stk500_getsync() attempt 9 of 10: not in sync: resp=0xff
avrdude-original: stk500_getsync() attempt 10 of 10: not in sync: resp=0xfc

avrdude-original done. Thank you.

strace: |autoreset: Broken pipe
ERROR: Not in sync
Attempt 2...


avrdude-original: Version 6.3-20171130
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch

System wide configuration file is "/etc/avrdude.conf"
User configuration file is "/root/.avrduderc"
User configuration file does not exist or is not a regular file, skipping

Using Port : /dev/ttyAMA0
Using Programmer : arduino
Overriding Baud Rate : 115200
avrdude-original: Using autoreset DTR on GPIO Pin 7
AVR Part : ATmega328P
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PC2
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :

Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 65 20 4 0 no 1024 4 0 3600 3600 0xff 0xff
flash 65 6 128 0 yes 32768 128 256 4500 4500 0xff 0xff
lfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
efuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
lock 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00

Programmer Type : Arduino
Description : Arduino
Hardware Version: 3
Firmware Version: 4.4
Vtarget : 0.3 V
Varef : 0.3 V
Oscillator : 28.800 kHz
SCK period : 3.3 us

avrdude-original: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude-original: Device signature = 0x1e950f (probably m328p)
avrdude-original: NOTE: "flash" memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude-original: erasing chip
avrdude-original: reading input file "/opt/openenergymonitor/data/firmware/emonPi_discrete_jeelib.hex"
avrdude-original: input file /opt/openenergymonitor/data/firmware/emonPi_discrete_jeelib.hex auto detected as Intel Hex
avrdude-original: writing flash (19260 bytes):

Writing | ################################################## | 100% 2.70s

avrdude-original: 19260 bytes of flash written
avrdude-original: verifying flash memory against /opt/openenergymonitor/data/firmware/emonPi_discrete_jeelib.hex:
avrdude-original: load data flash data from input file /opt/openenergymonitor/data/firmware/emonPi_discrete_jeelib.hex:
avrdude-original: input file /opt/openenergymonitor/data/firmware/emonPi_discrete_jeelib.hex auto detected as Intel Hex
avrdude-original: input file /opt/openenergymonitor/data/firmware/emonPi_discrete_jeelib.hex contains 19260 bytes
avrdude-original: reading on-chip flash data:

Reading | ################################################## | 100% 2.04s

avrdude-original: verifying ...
avrdude-original: 19260 bytes of flash verified
strace: |autoreset: Broken pipe
strace: |autoreset: Broken pipe
strace: |autoreset: Broken pipe
strace: |autoreset: Broken pipe
strace: |autoreset: Broken pipe

avrdude-original done. Thank you.

strace: |autoreset: Broken pipe
SUCCESS: flash verifed

Starting emonPi LCD service..


-------------------------------------------------------------
System update done: Tue 17 May 12:56:19 BST 2022
-------------------------------------------------------------
restarting service-runner

@TrystanLea - could be a bug see below.

@Frits could you please try

sudo pip3 install paho-mqtt requests pybluez py-sds011 sdm_modbus minimalmodbus

and copy and paste the output

note

For future reference, 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

[edit]
Just for completeness (and not for you @Frits), the issue is that the Python module paho-mqtt is not being installed. I suspect because sudo pip3 is being used. I do not now how to fix (other than stop using sudo with pip and rebuilding the base image) :frowning: and do not know why this has not appeared before :man_shrugging:

@TrystanLea

From the install log

- running module install/update script
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~deb10u2+rpt1).
libbluetooth-dev is already the newest version (5.50-1.2~deb10u2+rpt1).
python3-pip is already the newest version (18.1-5+rpt1).
The following package was automatically installed and is no longer required:
python-colorzero
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
Collecting paho-mqtt
Using cached https://www.piwheels.org/simple/paho-mqtt/paho_mqtt-1.6.1-py3-none-any.whl
Requirement already satisfied: requests in /usr/lib/python3/dist-packages (2.21.0)
Exception:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/_internal/cli/base_command.py", line 143, in main
status = self.run(options, args)
File "/usr/lib/python3/dist-packages/pip/_internal/commands/install.py", line 338, in run
resolver.resolve(requirement_set)
File "/usr/lib/python3/dist-packages/pip/_internal/resolve.py", line 102, in resolve
self._resolve_one(requirement_set, req)
File "/usr/lib/python3/dist-packages/pip/_internal/resolve.py", line 261, in _resolve_one
check_dist_requires_python(dist)
File "/usr/lib/python3/dist-packages/pip/_internal/utils/packaging.py", line 55, in check_dist_requires_python
if not check_requires_python(requires_python):
File "/usr/lib/python3/dist-packages/pip/_internal/utils/packaging.py", line 33, in check_requires_python
return python_version in requires_python_specifier
File "/usr/share/python-wheels/packaging-19.0-py2.py3-none-any.whl/packaging/specifiers.py", line 676, in __contains__
return self.contains(item)
File "/usr/share/python-wheels/packaging-19.0-py2.py3-none-any.whl/packaging/specifiers.py", line 681, in contains
item = parse(item)
File "/usr/share/python-wheels/packaging-19.0-py2.py3-none-any.whl/packaging/version.py", line 28, in parse
return Version(version)
File "/usr/share/python-wheels/packaging-19.0-py2.py3-none-any.whl/packaging/version.py", line 219, in __init__
match = self._regex.search(version)
TypeError: expected string or bytes-like object
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)

I think this is coming from this line in the script

[edit]
@TrystanLea @glyn.hudson I think using sudo with pip is coming back to bite you (I refer you back to my previous notes about not doing that). Arch with python-pip: TypeError: expected string or bytes-like object · Issue #9348 · pypa/pip · GitHub especially this comment Arch with python-pip: TypeError: expected string or bytes-like object · Issue #9348 · pypa/pip · GitHub

pi@emonpi:~ $ sudo pip3 install paho-mqtt requests pybluez py-sds011 sdm_modbus minimalmodbus
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting paho-mqtt
  Using cached https://www.piwheels.org/simple/paho-mqtt/paho_mqtt-1.6.1-py3-none-any.whl
Requirement already satisfied: requests in /usr/lib/python3/dist-packages (2.21.0)
Exception:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pip/_internal/cli/base_command.py", line 143, in main
    status = self.run(options, args)
  File "/usr/lib/python3/dist-packages/pip/_internal/commands/install.py", line 338, in run
    resolver.resolve(requirement_set)
  File "/usr/lib/python3/dist-packages/pip/_internal/resolve.py", line 102, in resolve
    self._resolve_one(requirement_set, req)
  File "/usr/lib/python3/dist-packages/pip/_internal/resolve.py", line 261, in _resolve_one
    check_dist_requires_python(dist)
  File "/usr/lib/python3/dist-packages/pip/_internal/utils/packaging.py", line 55, in check_dist_requires_python
    if not check_requires_python(requires_python):
  File "/usr/lib/python3/dist-packages/pip/_internal/utils/packaging.py", line 33, in check_requires_python
    return python_version in requires_python_specifier
  File "/usr/share/python-wheels/packaging-19.0-py2.py3-none-any.whl/packaging/specifiers.py", line 676, in __contains__
    return self.contains(item)
  File "/usr/share/python-wheels/packaging-19.0-py2.py3-none-any.whl/packaging/specifiers.py", line 681, in contains
    item = parse(item)
  File "/usr/share/python-wheels/packaging-19.0-py2.py3-none-any.whl/packaging/version.py", line 28, in parse
    return Version(version)
  File "/usr/share/python-wheels/packaging-19.0-py2.py3-none-any.whl/packaging/version.py", line 219, in __init__
    match = self._regex.search(version)
TypeError: expected string or bytes-like object
pi@emonpi:~ $

I think I got it right this time : :slight_smile:

Yes you did.

Can you try the same command without the sudo please?

pi@emonpi:~ $ pip3 install paho-mqtt requests pybluez py-sds011 sdm_modbus minimalmodbus
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting paho-mqtt
  Downloading https://www.piwheels.org/simple/paho-mqtt/paho_mqtt-1.6.1-py3-none-any.whl (75kB)
    100% |████████████████████████████████| 81kB 186kB/s
Requirement already satisfied: requests in /usr/lib/python3/dist-packages (2.21.0)
Exception:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pip/_internal/cli/base_command.py", line 143, in main
    status = self.run(options, args)
  File "/usr/lib/python3/dist-packages/pip/_internal/commands/install.py", line 338, in run
    resolver.resolve(requirement_set)
  File "/usr/lib/python3/dist-packages/pip/_internal/resolve.py", line 102, in resolve
    self._resolve_one(requirement_set, req)
  File "/usr/lib/python3/dist-packages/pip/_internal/resolve.py", line 261, in _resolve_one
    check_dist_requires_python(dist)
  File "/usr/lib/python3/dist-packages/pip/_internal/utils/packaging.py", line 55, in check_dist_requires_python
    if not check_requires_python(requires_python):
  File "/usr/lib/python3/dist-packages/pip/_internal/utils/packaging.py", line 33, in check_requires_python
    return python_version in requires_python_specifier
  File "/usr/share/python-wheels/packaging-19.0-py2.py3-none-any.whl/packaging/specifiers.py", line 676, in __contains__
    return self.contains(item)
  File "/usr/share/python-wheels/packaging-19.0-py2.py3-none-any.whl/packaging/specifiers.py", line 681, in contains
    item = parse(item)
  File "/usr/share/python-wheels/packaging-19.0-py2.py3-none-any.whl/packaging/version.py", line 28, in parse
    return Version(version)
  File "/usr/share/python-wheels/packaging-19.0-py2.py3-none-any.whl/packaging/version.py", line 219, in __init__
    match = self._regex.search(version)
TypeError: expected string or bytes-like object
pi@emonpi:~ $

There you go!!

If it is going to be easier for you, I can give you TeamViewer access

No sorry it won’t help.

All I can suggest is flashing a new image.

Start it up and see if it works. If it does do an update and see if it is still OK.

If so import your backup.

It needs @TrystanLea or @glyn.hudson to fix. Surprised you are the first with the issue unless the image has been updated recently.

[edit]

I had an issue with paho and fixed it like this:

On a re-install, I was getting Emonhub failed to start due to no module named paho to do with mqtt. This was fixed by typing cd /usr/local/bin/emonhub then sudo pip install paho-mqtt -t ./

Maybe worth trying…

1 Like

Thanks, good (and bad) to know it is not an isolated incident.

I wonder if this will break when the update script is run.

I thought I’d do it anyway, as I have nothing to lose.

is this the command to run?

sudo pip install paho-mqtt -t ./

I get:- “command not found error”

Hi Borpin,

Just to clarify:-

I tried the image first and then the emonhub screen showed “Booting Please wait” and never changed.
I tried it for a second time and the same happened.

Then I decided to flash with buster and run the script form github.

Let me try the emonhub image again. It does not take that long.

I will just be attending a two hour meeting to start in a minute and will then do it.

Thanks for all your support!

Well that is fairly fundamental information!!!