and don't bother reopening it each time, just read() and lseek() back to zero each time.Get the CPU temperature from /sys/devices/virtual/thermal/thermal_zone0/temp instead using a firmware mailbox call. They're both reading the same temperature sensor inside the SoC.
You can get the clock speeds for the CPU's and the GPU in one go "vcgencmd measure_clock arm core" and voltage and current readings from the PMIC "vcgencmd pmic_read_adc". Health is just checking that "vcgencmd get_thottled" returns 0x0.
In general, try to reduce the CPU load of your command so that it doesn't itself affect the readings.
My pistat reports like this:
Code:
Time CPU Core Vcore Wcore Temp Health09:41:02 600 520 0.903 0.677 35 OK09:41:12 600 520 0.752 0.369 35 OK09:41:22 3000 1000 0.973 0.904 36 OK09:41:32 500 500 0.753 0.363 35 OK09:41:42 500 500 0.752 0.363 35 OKStatistics: Posted by jahboater — Sat May 31, 2025 8:48 am