ThomDietrich/miflora-mqtt-daemon

running as service in python3.10

Closed this issue · 3 comments

hi all,

i see the following error

sudo systemctl status miflora.service
● miflora.service - Xiaomi Mi Flora Plant Sensor MQTT Client/Daemon
   Loaded: loaded (/etc/systemd/system/miflora.service; disabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2022-05-25 16:26:24 CEST; 7s ago
     Docs: https://github.com/ThomDietrich/miflora-mqtt-daemon
  Process: 936 ExecStart=/usr/bin/python3 /opt/miflora-mqtt-daemon/miflora-mqtt-daemon.py (code=exited, status=1/FAILURE)
 Main PID: 936 (code=exited, status=1/FAILURE)

May 25 16:26:24 raspberrypi systemd[1]: Failed to start Xiaomi Mi Flora Plant Sensor MQTT Client/Daemon.
May 25 16:26:24 raspberrypi systemd[1]: miflora.service: Service RestartSec=100ms expired, scheduling restart.
May 25 16:26:24 raspberrypi systemd[1]: miflora.service: Scheduled restart job, restart counter is at 5.
May 25 16:26:24 raspberrypi systemd[1]: Stopped Xiaomi Mi Flora Plant Sensor MQTT Client/Daemon.
May 25 16:26:24 raspberrypi systemd[1]: miflora.service: Start request repeated too quickly.
May 25 16:26:24 raspberrypi systemd[1]: miflora.service: Failed with result 'exit-code'.
May 25 16:26:24 raspberrypi systemd[1]: Failed to start Xiaomi Mi Flora Plant Sensor MQTT Client/Daemon.

I just upgrade my python version from 3.7.3 to 3.9 and also i tried 3.10 but with both versions its not starting.
When i run it manually it works

Executing this on the console works?

/usr/bin/python3 /opt/miflora-mqtt-daemon/miflora-mqtt-daemon.py

If so, this sounds like a systemd issue

Executing this on the console works?

/usr/bin/python3 /opt/miflora-mqtt-daemon/miflora-mqtt-daemon.py

If so, this sounds like a systemd issue

i get this

/usr/bin/python3 /opt/miflora-mqtt-daemon/miflora-mqtt-daemon.py
Traceback (most recent call last):
  File "/opt/miflora-mqtt-daemon/miflora-mqtt-daemon.py", line 11, in <module>
    from colorama import init as colorama_init
ModuleNotFoundError: No module named 'colorama'

never mind i fixed it by linking python3 to the correct python version in de /usr/bin directory
you can close the ticket

ixed it by linking python3 to the correct python version in de /usr/bin directory