hjelev / rpi-mqtt-monitor

Raspberry Pi MQTT Monitor gathers system information and sends it to a MQTT server.
GNU General Public License v3.0
176 stars 42 forks source link

vcgencmd: not found #5

Closed Vendo232 closed 3 years ago

Vendo232 commented 3 years ago

Hello

Im running RPi4 with Ubuntu fpr RPI and this is the error Im getting. Any idea what is wrong?

ubuntu@ubuntu:~/rpimonitor$ /usr/bin/python3.8 rpi-cpu2mqtt.py /bin/sh: 1: vcgencmd: not found Traceback (most recent call last): File "rpi-cpu2mqtt.py", line 198, in cpu_temp = check_cpu_temp() File "rpi-cpu2mqtt.py", line 54, in check_cpu_temp cpu_temp = str(p).replace('\n', ' ').replace('\r', '').split("=")[1].split("'")[0]

stlas commented 3 years ago

Hi, I have the same problem here. BananaPi with Armbian 21.02.3 Stretch with Linux 5.11.3-sunxi The script returns:

/bin/sh: 1: vcgencmd: not found Traceback (most recent call last): File "/home/stlas/raspimon/src/rpi-cpu2mqtt.py", line 198, in cpu_temp = check_cpu_temp() File "/home/stlas/raspimon/src/rpi-cpu2mqtt.py", line 54, in check_cpu_temp cpu_temp = str(p).replace('\n', ' ').replace('\r', '').split("=")[1].split("'")[0] IndexError: list index out of range

Thanx for helping

hjelev commented 3 years ago

This is because the script is not run on raspbian - vcgencmd is a custom command for geting rpi cpu temperature. I have updated the script to post 0 if retrieving the cpu temperature fails - you can test again.