ironsheep / RPi-Reporter-MQTT2HA-Daemon

Linux service to collect and transfer Raspberry Pi data via MQTT to Home Assistant (for RPi Monitoring)
GNU General Public License v3.0
442 stars 62 forks source link

requests package now required, but not in requirements.txt #78

Closed jonwaland closed 1 year ago

jonwaland commented 1 year ago

Checklist:

Release with the issue: 1.7.2

Last working release (if known): 1.6.2

Hardware, Operating System, Python version: Python 3.5.3

Description of problem:

pi@LocationPI-M:~ $ cd /opt/RPi-Reporter-MQTT2HA-Daemon
pi@LocationPI-M:/opt/RPi-Reporter-MQTT2HA-Daemon $ sudo systemctl stop isp-rpi-reporter.service
pi@LocationPI-M:/opt/RPi-Reporter-MQTT2HA-Daemon $ sudo git pull
remote: Enumerating objects: 20, done.
remote: Counting objects: 100% (20/20), done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 20 (delta 8), reused 20 (delta 8), pack-reused 0
Unpacking objects: 100% (20/20), done.
From https://github.com/ironsheep/RPi-Reporter-MQTT2HA-Daemon
   99efef9..f35c698  master     -> origin/master
 * [new tag]         v1.2.9     -> v1.2.9
 * [new tag]         v1.7.2     -> v1.7.2
 * [new tag]         v1.7.0     -> v1.7.0
 * [new tag]         v1.7.1     -> v1.7.1
Updating 99efef9..f35c698
Fast-forward
 .prettierrc.js           |  12 ++++-----
 ChangeLog                |  39 ++++++++++++++++++----------
 ISP-RPi-mqtt-daemon.py   |  99 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
 README.md                | 292 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----------------------------------------------------------------------------------------------------------
 Release                  |   2 +-
 isp-rpi-reporter.service |   2 --
 6 files changed, 268 insertions(+), 178 deletions(-)
pi@LocationPI-M:/opt/RPi-Reporter-MQTT2HA-Daemon $ sudo systemctl daemon-reload
pi@LocationPI-M:/opt/RPi-Reporter-MQTT2HA-Daemon $ sudo systemctl start isp-rpi-reporter.service
Job for isp-rpi-reporter.service failed because the control process exited with error code.
See "systemctl status isp-rpi-reporter.service" and "journalctl -xe" for details.
pi@LocationPI-M:/opt/RPi-Reporter-MQTT2HA-Daemon $ systemctl status isp-rpi-reporter.service
● isp-rpi-reporter.service - RPi Reporter MQTT Client/Daemon
   Loaded: loaded (/opt/RPi-Reporter-MQTT2HA-Daemon/isp-rpi-reporter.service; enabled; vendor preset: enabled)
   Active: activating (start) since Thu 2023-02-16 18:02:44 AEDT; 1s ago
     Docs: https://github.com/ironsheep/RPi-Reporter-MQTT2HA-Daemon
 Main PID: 25224 (python3)
   CGroup: /system.slice/isp-rpi-reporter.service
           └─25224 /usr/bin/python3 -u /opt/RPi-Reporter-MQTT2HA-Daemon/ISP-RPi-mqtt-daemon.py

Feb 16 18:02:44 LocationPI-M systemd[1]: Starting RPi Reporter MQTT Client/Daemon...
pi@LocationPI-M:/opt/RPi-Reporter-MQTT2HA-Daemon $ journalctl -xe
Feb 16 18:02:53 LocationPI-M systemd[1]: isp-rpi-reporter.service: Failed with result 'exit-code'.
Feb 16 18:02:56 LocationPI-M systemd[1]: isp-rpi-reporter.service: Service hold-off time over, scheduling restart.
Feb 16 18:02:56 LocationPI-M systemd[1]: Stopped RPi Reporter MQTT Client/Daemon.
-- Subject: Unit isp-rpi-reporter.service has finished shutting down
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit isp-rpi-reporter.service has finished shutting down.
Feb 16 18:02:56 LocationPI-M systemd[1]: Starting RPi Reporter MQTT Client/Daemon...
-- Subject: Unit isp-rpi-reporter.service has begun start-up
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit isp-rpi-reporter.service has begun starting up.
Feb 16 18:02:59 LocationPI-M python3[25238]: Traceback (most recent call last):
Feb 16 18:02:59 LocationPI-M python3[25238]:   File "/opt/RPi-Reporter-MQTT2HA-Daemon/ISP-RPi-mqtt-daemon.py", line 27, in <module>
Feb 16 18:02:59 LocationPI-M python3[25238]:     import requests
Feb 16 18:02:59 LocationPI-M python3[25238]: ImportError: No module named 'requests'
Feb 16 18:02:59 LocationPI-M systemd[1]: isp-rpi-reporter.service: Main process exited, code=exited, status=1/FAILURE
Feb 16 18:02:59 LocationPI-M systemd[1]: Failed to start RPi Reporter MQTT Client/Daemon.
-- Subject: Unit isp-rpi-reporter.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit isp-rpi-reporter.service has failed.
--
-- The result is failed.
Feb 16 18:02:59 LocationPI-M systemd[1]: isp-rpi-reporter.service: Unit entered failed state.
Feb 16 18:02:59 LocationPI-M systemd[1]: isp-rpi-reporter.service: Failed with result 'exit-code'.
pi@LocationPI-M:/opt/RPi-Reporter-MQTT2HA-Daemon $ python3 /opt/RPi-Reporter-MQTT2HA-Daemon/ISP-RPi-mqtt-daemon.py -d -v
Traceback (most recent call last):
  File "/opt/RPi-Reporter-MQTT2HA-Daemon/ISP-RPi-mqtt-daemon.py", line 27, in <module>
    import requests
ImportError: No module named 'requests'
pi@LocationPI-M:/opt/RPi-Reporter-MQTT2HA-Daemon $ sudo pip3 install -r requirements.txt
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: paho-mqtt>=1.4.0 in /usr/local/lib/python3.5/dist-packages (from -r requirements.txt (line 2)) (1.5.0)
Requirement already satisfied: wheel>=0.29.0 in /usr/local/lib/python3.5/dist-packages (from -r requirements.txt (line 3)) (0.34.2)
Requirement already satisfied: sdnotify>=0.3.1 in /usr/lib/python3/dist-packages (from -r requirements.txt (line 4)) (0.3.1)
Requirement already satisfied: Unidecode>=0.4.21 in /usr/local/lib/python3.5/dist-packages (from -r requirements.txt (line 5)) (1.3.6)
Requirement already satisfied: colorama>=0.4.3 in /usr/local/lib/python3.5/dist-packages (from -r requirements.txt (line 6)) (0.4.5)
Requirement already satisfied: tzlocal>=2.1.0 in /usr/local/lib/python3.5/dist-packages (from -r requirements.txt (line 7)) (2.1)
Requirement already satisfied: pytz in /usr/lib/python3/dist-packages (from tzlocal>=2.1.0->-r requirements.txt (line 7)) (2016.7)
WARNING: You are using pip version 20.0.2; however, version 20.3.4 is available.
You should consider upgrading via the '/usr/bin/python3 -m pip install --upgrade pip' command.
pi@LocationPI-M:/opt/RPi-Reporter-MQTT2HA-Daemon $ python3 /opt/RPi-Reporter-MQTT2HA-Daemon/ISP-RPi-mqtt-daemon.py -d -v
Traceback (most recent call last):
  File "/opt/RPi-Reporter-MQTT2HA-Daemon/ISP-RPi-mqtt-daemon.py", line 27, in <module>
    import requests
ImportError: No module named 'requests'
pi@LocationPI-M:/opt/RPi-Reporter-MQTT2HA-Daemon $ sudo pip3 install requests
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting requests
  Downloading requests-2.25.1-py2.py3-none-any.whl (61 kB)
     |████████████████████████████████| 61 kB 341 kB/s
Collecting idna<3,>=2.5
  Downloading idna-2.10-py2.py3-none-any.whl (58 kB)
     |████████████████████████████████| 58 kB 570 kB/s
Collecting urllib3<1.27,>=1.21.1
  Downloading urllib3-1.26.9-py2.py3-none-any.whl (138 kB)
     |████████████████████████████████| 138 kB 1.4 MB/s
Collecting chardet<5,>=3.0.2
  Downloading chardet-4.0.0-py2.py3-none-any.whl (178 kB)
     |████████████████████████████████| 178 kB 224 kB/s
Collecting certifi>=2017.4.17
  Downloading certifi-2021.10.8-py2.py3-none-any.whl (149 kB)
     |████████████████████████████████| 149 kB 58 kB/s
Installing collected packages: idna, urllib3, chardet, certifi, requests
  Attempting uninstall: idna
    Found existing installation: idna 2.2
    Uninstalling idna-2.2:
      Successfully uninstalled idna-2.2
Successfully installed certifi-2021.10.8 chardet-4.0.0 idna-2.10 requests-2.25.1 urllib3-1.26.9
WARNING: You are using pip version 20.0.2; however, version 20.3.4 is available.
You should consider upgrading via the '/usr/bin/python3 -m pip install --upgrade pip' command.
pi@LocationPI-M:/opt/RPi-Reporter-MQTT2HA-Daemon $ python3 /opt/RPi-Reporter-MQTT2HA-Daemon/ISP-RPi-mqtt-daemon.py -d -v
[2023-02-16 18:10:46] - ISP-RPi-mqtt-daemon.py v1.7.2
[2023-02-16 18:10:46] - Verbose enabled
[2023-02-16 18:10:46] - (DBG): Debug enabled
ironsheep commented 1 year ago

Fixed. Changes appear in v1.7.4 and later.