Sennevds / system_sensors

Logging of system sensor specific for the RPI and sending them to a MQTT broker
MIT License
361 stars 112 forks source link

Script does not return available updates on Debian 12 Bookworm #166

Open TAYALE opened 9 months ago

TAYALE commented 9 months ago

Bookworm expects an VirtualEnv. Created it and changed the ExecStart in the service-file to: /root/system_sensors/.venv/bin/python3 /root/system_sensors/src/system_sensors.py /root/system_sensors/src/settings.yaml

I do get a lot of sensors but not the 'Available updates' and cannot figure out why. Of course it is set to true in the settings.yaml.

mdisabato commented 7 months ago

I am getting the following when I run the script from console:

user@host: ~/system_sensors $ system_sensors_venv/bin/python3 src/system_sensors.py src/settings.yaml Unable to import apt package. Available updates will not be shown. Sending config message to host... Connected to broker subscribing : hass/status

The second line is the error. I am trying to learn how to import "apt" into the virtual environment. That might fix this issue.

mdisabato commented 7 months ago

I found this... At this link: https://www.raspberrypi.com/documentation/computers/os.html#using-pip-with-virtual-environments it says to start the virtual environment using this command:

python -m venv --system-site-packages env.

I used:

python3 -m venv system_sensors_venv --system-site-packages

and this has cleared the error.

YMWV. :)

Thanks.