After browsing all discussion foruns and finding this one the closest to a short answer I will summarize a step-by-step on how I got it running on my Rapi5
from my home directory run the following commands:
mkdir scriptsPython
cd scriptsPython/
python -m venv --system-site-packages env
source env/bin/activate
pip install RaspberryPiVcgencmd
There are bugs in the web script and unsupported features so you have to debug it before you run it
link to RaspberryPiVcgencmd documentation: https://github.com/chewett/RaspberryPiV ... /README.md
I hope this will help others get it running faster.
Debugged code:
from my home directory run the following commands:
mkdir scriptsPython
cd scriptsPython/
python -m venv --system-site-packages env
source env/bin/activate
pip install RaspberryPiVcgencmd
There are bugs in the web script and unsupported features so you have to debug it before you run it
link to RaspberryPiVcgencmd documentation: https://github.com/chewett/RaspberryPiV ... /README.md
I hope this will help others get it running faster.
Debugged code:
Code:
import sysimport osimport timefrom RaspberryPiVcgencmd import Vcgencmddef main(): start_time = time.time() fb = open("readings.txt","a+") fb.write("Elapsed Time (s),Temperature (C),Clock Speed (MHz),Throttled\n") vcgm = Vcgencmd() print(vcgm.get_version()) while True: temp = vcgm.get_cpu_temp() clock = int(vcgm.measure_clock('arm'))/1000000# throttled = vcgm.get_throttled()['breakdown']['2'] string = '%.0f,%s,%s\n' % ((time.time() - start_time),temp,clock) print(string, end='') fb.write(string) time.sleep(1)if __name__ == '__main__': main()
Statistics: Posted by vmferreira — Tue Apr 23, 2024 7:40 pm