Host: raspberrypiB Kernel: 6.6.31+rpt-rpi-v8 (64 bit) Console: tty 0
Distro: Raspberry Pi OS Lite Debian version: 12 (bookworm)
I’m tried to check the temp on my pi 4 running this python script
When I tried to run the script I get the following error
If I run the command
It is ok
so is in in the /usr/bin vcgencmd
So maybe the problem is with Path I have look in /usr/bin vcgencmd
I have check the Env path and it returnsI don not know what to try next.
Distro: Raspberry Pi OS Lite Debian version: 12 (bookworm)
I’m tried to check the temp on my pi 4 running this python script
Code:
#!/usr/bin/env python3import sysimport osimport timefrom vcgencmd import Vcgencmddef main(): start_time = time.time() fb = open("/home/pi/readings.txt","a+") fb.write("Elapsed Time (s),Temperature (°C),Clock Speed (MHz),Throttled\n") vcgm = Vcgencmd() while True: temp = vcgm.measure_temp() clock = int(vcgm.measure_clock('arm')/1000000) throttled = vcgm.get_throttled()['breakdown']['2'] string = '%.0f,%s,%s,%s\n' % ((time.time() - start_time),temp,clock,throttled) print(string, end='') fb.write(string) time.sleep(1)if __name__ == '__main__': main()
Code:
python3 montior.py Traceback (most recent call last): File "/home/rick/montior.py", line 8, in <module> from vcgencmd import Vcgencmd ModuleNotFoundError: No module named 'vcgencmd'
Code:
vcgencmd measure_temptemp=42.9'Corvcgencmd measure_voltsvolt=1.2563V
so is in in the /usr/bin vcgencmd
So maybe the problem is with Path I have look in /usr/bin vcgencmd
I have check the Env path and it returns
Code:
echo $PATH/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
Statistics: Posted by Tomxtal — Sun Jul 28, 2024 8:21 pm