This is a Raspberry Pi 2 Model B Rev 1.1 running Buster. It’s a standard emonPi from many years ago.
I suspect it would be much more reliable to build a debian package for this and let apt deal with the mosquitto/python/etc dependencies. That’s outside my expertise for now but I may be learning how to do this for work in the new year!
If we are to go down the path of deprecating support for older versions, there are some other bits which would welcome a cleaup (interfacer modules with the wrong name, for example). There’s almost 5000 lines of code, a lot of which is repeated, and newer python features could make this smaller and more readable. All that might be more effort than it’s worth, though, unless someone smarter than me can come up with a test suite!
Anyway, the python3 port has been running on my system for about 12 hours now.
Hi @borpin, good work, thank you very much. I’ve fixed that bug and bumped the version to 3 (hope that doesn’t step on any toes, it matches the compatible python version and it’s not like we’ll run out of numbers…). Thanks, Bruce
git checkout -b bwduncan-python3 emon-pi
git pull https://github.com/bwduncan/emonhub.git python3
sudo service emonhub restart
I get the error:
emonhub.service: Failed with result 'exit-code'.
Running emonhub manually:
[email protected]:/opt/openenergymonitor/emonhub $ /usr/local/bin/emonhub/emonhub.py --config-file=/etc/emonhub/emonhub.conf
Traceback (most recent call last):
File "/usr/local/bin/emonhub/emonhub.py", line 23, in <module>
import emonhub_setup as ehs
File "/opt/openenergymonitor/emonhub/src/emonhub_setup.py", line 13, in <module>
from configobj import ConfigObj
ModuleNotFoundError: No module named 'configobj'
I must be missing a step or testing the wrong version?
I think the python3-configobj package isn’t installed. The install.sh script installs this package and I think I was relying on that script being run as part of the update to get all the modules. Not sure if that’s a valid assumption. Anyway, can you try running the script and see if it works?