I am running a very old version of OpenEnergyMonitor, and emonhub on a raspberry pi running Buster. Along with some other code that I have written, I’m using it as a thermostat for my boiler which is why I have not felt the need (or had the time) to update to the latest OS.
It has been working very well until just now, when the disk died. I have a disk image backup from a year ago (20 Feb 2025) and I re-installed that image on a new disk. Everything appears to be working except for emonhub.
I am running version 2.1.2 of emonhub (which I appreciate is very old now). A year ago, I attempted to upgrade, but could not get this to work, so I stuck with the old version. Update: After further examination I can see that emonhub.py contains the following “version = “emonHub emon-pi variant v2.1.2” but the version.txt shows 2.7.2 so I am a bit confused.
There is no entry in the emonhub log. Here is the extract from my syslog:
Feb 10 10:46:00 my-pi systemd[1]: Starting emonHub service description...
Feb 10 10:46:00 my-pi systemd[1]: Started emonHub service description.
Feb 10 10:46:02 my-pi emonhub.py[12075]: Traceback (most recent call last):
Feb 10 10:46:02 my-pi emonhub.py[12075]: File "/usr/local/bin/emonhub/emonhub.py", line 35, in <module>
Feb 10 10:46:02 my-pi emonhub.py[12075]: setattr(ehi,name,getattr(getattr(namespace,name),name))
Feb 10 10:46:02 my-pi emonhub.py[12075]: AttributeError: 'module' object has no attribute 'EmonHubTeslaPowerWallInterfacer'
Feb 10 10:46:02 my-pi systemd[1]: emonhub.service: Main process exited, code=exited, status=1/FAILURE
Feb 10 10:46:02 my-pi systemd[1]: emonhub.service: Failed with result 'exit-code'.
I have attempted to re-install, but with no success (i.e. I get the same error).
Typing python -V gives Python 2.7.16
Here is the service definition:
[Unit]
Description=emonHub service description
DefaultDependencies=no
Before=shutdown.target
Conflicts=shutdown.target
Requires=local-fs.target
After=sysinit.target syslog.target local-fs.target
[Service]
User=emonhub
PIDFile=/var/run/emonhub.pid
ExecStart=/usr/local/bin/emonhub/emonhub.py --config-file=/etc/emonhub/emonhub.conf --logfile=/var/log/emonhub/emonhub
.log
PermissionsStartOnly=true
ExecStartPre=/bin/mkdir -p /var/log/emonhub/
ExecStartPre=/bin/chgrp -R emonhub /var/log/emonhub/
ExecStartPre=/bin/chmod 775 /var/log/emonhub/
Type=simple
Restart=always
[Install]
WantedBy=multi-user.target
I appreciate that this is a very old system, but would be very grateful for some advice please (especially as I have no heating at the moment!).