Update rpi-cpu2mqtt.py

Remove path for vcgencmd
This commit is contained in:
Naboleo
2020-08-03 21:40:47 +02:00
committed by GitHub
parent d6a971a6b4
commit 43cbe5ab99

View File

@@ -48,7 +48,7 @@ def check_memory():
return memory return memory
def check_cpu_temp(): def check_cpu_temp():
full_cmd = "/opt/vc/bin/vcgencmd measure_temp" full_cmd = "vcgencmd measure_temp"
p = subprocess.Popen(full_cmd, shell=True, stdout=subprocess.PIPE).communicate()[0] p = subprocess.Popen(full_cmd, shell=True, stdout=subprocess.PIPE).communicate()[0]
cpu_temp = p.replace('\n', ' ').replace('\r', '').split("=")[1].split("'")[0] cpu_temp = p.replace('\n', ' ').replace('\r', '').split("=")[1].split("'")[0]
return cpu_temp return cpu_temp