The steps I did:
sudo apt-get update
sudo apt-get install -y mosquitto
sudo nano /etc/mosquitto/mosquitto.conf --> to set `persistence` to false
sudo mkdir /opt/openenergymonitor
cd /opt/openenergymonitor
sudo git clone https://github.com/openenergymonitor/emonhub.git
cd emonhub
sudo git checkout stable
sudo ./install.sh
Some strange things (details further on):
ERROR: launchpadlib 1.10.13 requires testresources, which is not installed.
Installing collected packages: paho-mqtt, pybluez, py-sds011, six, pymodbus, sdm-modbus
Attempting uninstall: six
Found existing installation: six 1.14.0
Not uninstalling six at /usr/lib/python3/dist-packages, outside environment /usr
Can't uninstall 'six'. No files were found to uninstall.
Attempting uninstall: pymodbus
Found existing installation: pymodbus 2.1.0
Not uninstalling pymodbus at /usr/lib/python3/dist-packages, outside environment /usr
Can't uninstall 'pymodbus'. No files were found to uninstall.
Failed to restart emonhub.service: Unit var-log.mount not found.
Detailed output from sudo ./install.sh
(I just hit ‘enter’ on the raspberrypi question)
sudo ./install.sh
Apply raspberrypi serial configuration? 1=yes, 0=no:
You entered
Geraakt:1 http://archive.ubuntu.com/ubuntu focal InRelease
(...etc...)
De volgende extra pakketten zullen geïnstalleerd worden:
libexpat1-dev libpython3-dev libpython3.8-dev python-pip-whl python3-attr python3-automat python3-constantly python3-dev
python3-distutils python3-hamcrest python3-hyperlink python3-incremental python3-lib2to3 python3-openssl python3-pyasn1
python3-pyasn1-modules python3-serial-asyncio python3-service-identity python3-setuptools python3-twisted python3-twisted-bin
python3-wheel python3-zope.interface python3.8-dev zlib1g-dev
Voorgestelde pakketten:
pkg-config python-attr-doc python-configobj-doc python-openssl-doc python3-openssl-dbg python3-wxgtk3.0 | python3-wxgtk
python-setuptools-doc python3-tk python3-pampy python3-qt4 python3-wxgtk2.8 python3-twisted-bin-dbg
De volgende NIEUWE pakketten zullen geïnstalleerd worden:
bluetooth libbluetooth-dev libexpat1-dev libpython3-dev libpython3.8-dev python-pip-whl python3-attr python3-automat python3-configobj
python3-constantly python3-dev python3-distutils python3-hamcrest python3-hyperlink python3-incremental python3-lib2to3 python3-openssl
python3-pip python3-pyasn1 python3-pyasn1-modules python3-pymodbus python3-serial python3-serial-asyncio python3-service-identity
python3-setuptools python3-twisted python3-twisted-bin python3-wheel python3-zope.interface python3.8-dev zlib1g-dev
0 opgewaardeerd, 31 nieuw geïnstalleerd, 0 te verwijderen en 2 niet opgewaardeerd.
Er moeten 10,0 MB aan archieven opgehaald worden.
Na deze bewerking zal er 46,3 MB extra schijfruimte gebruikt worden.
Ophalen:1 http://archive.ubuntu.com/ubuntu focal/universe amd64 bluetooth all 5.53-0ubuntu3 [3.148 B]
(...etc...)
Extraheren van sjablonen uit pakketten: 100%
Voorheen niet geselecteerd pakket bluetooth wordt geselecteerd.
(Database wordt ingelezen ... 281764 bestanden en mappen momenteel geïnstalleerd.)
Uitpakken van .../00-bluetooth_5.53-0ubuntu3_all.deb wordt voorbereid...
(...etc....)
Instellen van python3-attr (19.3.0-2) ...
(...etc...)
Bezig met afhandelen van triggers voor man-db (2.9.1-1) ...
Collecting paho-mqtt
Downloading paho-mqtt-1.5.1.tar.gz (101 kB)
|████████████████████████████████| 101 kB 2.9 MB/s
Requirement already satisfied: requests in /usr/lib/python3/dist-packages (2.22.0)
Collecting pybluez
Downloading PyBluez-0.23.tar.gz (97 kB)
|████████████████████████████████| 97 kB 3.1 MB/s
Collecting py-sds011
Downloading py_sds011-0.9-py3-none-any.whl (3.8 kB)
Collecting sdm_modbus
Downloading sdm_modbus-0.4.4-py3-none-any.whl (8.1 kB)
Requirement already satisfied: pyserial in /usr/lib/python3/dist-packages (from py-sds011) (3.4)
Collecting pymodbus>=2.3.0
Downloading pymodbus-2.5.0-py2.py3-none-any.whl (154 kB)
|████████████████████████████████| 154 kB 5.0 MB/s
Collecting six>=1.15.0
Downloading six-1.15.0-py2.py3-none-any.whl (10 kB)
Building wheels for collected packages: paho-mqtt, pybluez
Building wheel for paho-mqtt (setup.py) ... done
Created wheel for paho-mqtt: filename=paho_mqtt-1.5.1-py3-none-any.whl size=61543 sha256=e94679eaa017ee6089ce6e2ca1ea20ad500760bd28e3668e454c3ee158f20c5f
Stored in directory: /root/.cache/pip/wheels/78/ec/85/b657c03288b6e363c90369c96ee04eea9abb9be78cadb7855b
Building wheel for pybluez (setup.py) ... done
Created wheel for pybluez: filename=PyBluez-0.23-cp38-cp38-linux_x86_64.whl size=139138 sha256=8d71bced211d990a44596a11174bed24f72283dbd35e16a3c6e1292118bdd13a
Stored in directory: /root/.cache/pip/wheels/05/b9/3d/36ace9a7ee80a5c01b1d4910723e0c593d1f3031664e2c9907
Successfully built paho-mqtt pybluez
ERROR: launchpadlib 1.10.13 requires testresources, which is not installed.
Installing collected packages: paho-mqtt, pybluez, py-sds011, six, pymodbus, sdm-modbus
Attempting uninstall: six
Found existing installation: six 1.14.0
Not uninstalling six at /usr/lib/python3/dist-packages, outside environment /usr
Can't uninstall 'six'. No files were found to uninstall.
Attempting uninstall: pymodbus
Found existing installation: pymodbus 2.1.0
Not uninstalling pymodbus at /usr/lib/python3/dist-packages, outside environment /usr
Can't uninstall 'pymodbus'. No files were found to uninstall.
Successfully installed paho-mqtt-1.5.1 py-sds011-0.9 pybluez-0.23 pymodbus-2.5.0 sdm-modbus-0.4.4 six-1.15.0
- installing emonhub.service
Created symlink /etc/systemd/system/multi-user.target.wants/emonhub.service → /opt/openenergymonitor/emonhub/service/emonhub.service.
Created symlink /etc/systemd/system/emonhub.service → /opt/openenergymonitor/emonhub/service/emonhub.service.
Failed to restart emonhub.service: Unit var-log.mount not found.
- Service ActiveState=inactive
The tail -f /var/log/syslog
during the sudo ./install.sh
:
Mar 31 16:21:57 slaptop dbus-daemon[579]: [system] Activating via systemd: service name='org.freedesktop.PackageKit' unit='packagekit.service' requested by ':1.70' (uid=0 pid=2818 comm="/usr/bin/gdbus call --system --dest org.freedeskto" label="unconfined")
Mar 31 16:21:57 slaptop systemd[1]: Starting PackageKit Daemon...
Mar 31 16:21:57 slaptop PackageKit: daemon start
Mar 31 16:21:57 slaptop dbus-daemon[579]: [system] Successfully activated service 'org.freedesktop.PackageKit'
Mar 31 16:21:57 slaptop systemd[1]: Started PackageKit Daemon.
Mar 31 16:22:32 slaptop dbus-daemon[3674]: [session uid=0 pid=3672] AppArmor D-Bus mediation is enabled
Mar 31 16:22:32 slaptop dbus-daemon[3674]: [session uid=0 pid=3672] Activating service name='org.kde.kwalletd5' requested by ':1.0' (uid=0 pid=3668 comm="/usr/bin/python3 /usr/bin/pip3 install paho-mqtt r" label="unconfined")
Mar 31 16:22:32 slaptop org.kde.kwalletd5[3676]: QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
Mar 31 16:22:32 slaptop dbus-daemon[3674]: [session uid=0 pid=3672] Successfully activated service 'org.kde.kwalletd5'
Mar 31 16:22:32 slaptop dbus-daemon[3674]: [session uid=0 pid=3672] Activating service name='org.freedesktop.secrets' requested by ':1.0' (uid=0 pid=3668 comm="/usr/bin/python3 /usr/bin/pip3 install paho-mqtt r" label="unconfined")
Mar 31 16:22:32 slaptop org.freedesktop.secrets[3680]: GNOME_KEYRING_CONTROL=/root/.cache/keyring-N74200
Mar 31 16:22:32 slaptop dbus-daemon[3674]: [session uid=0 pid=3672] Successfully activated service 'org.freedesktop.secrets'
Mar 31 16:22:41 slaptop systemd[1]: Reloading.
Mar 31 16:22:41 slaptop systemd[1]: /lib/systemd/system/dbus.socket:5: ListenStream= references a path below legacy directory /var/run/, updating /var/run/dbus/system_bus_socket → /run/dbus/system_bus_socket; please update the unit file accordingly.
Mar 31 16:23:52 slaptop kernel: [ 1194.098076] perf: interrupt took too long (4974 > 4961), lowering kernel.perf_event_max_sample_rate to 40000
Conclusion
I guess the line
Failed to restart emonhub.service: Unit var-log.mount not found.
needs some attention as this var-log.mount is mentioned in
cat /etc/systemd/system/emonhub.service
as:
Requires=var-log.mount
After=var-log.mount network.target