Clock Speed and Temperature

From KlavoWiki
Revision as of 02:59, 3 July 2021 by David (Sọ̀rọ̀ | contribs) (Created page with "To monitor the temperature and clock speed of a Raspberry Pi <pre> vi /bin/stats </pre> <pre> #!/bin/bash #!/bin/bash echo echo echo ' Date Time Nano Sec Temp Hz'...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

To monitor the temperature and clock speed of a Raspberry Pi

vi /bin/stats
#!/bin/bash
#!/bin/bash

echo
echo
echo '   Date    Time     Nano Sec  Temp Hz'

while true; do
  temp=$(vcgencmd measure_temp | cut -d= -f2 | cut -b -4)
  clock=$(vcgencmd measure_clock arm | cut -d= -f2)

  echo -ne $(date +'%Y-%m-%d %H:%M:%S %N') $temp $(($clock/1000000)) \\r
  sleep .2
done
 chmod +x /bin/stats 
 stats 

Allow a Maximum of 2GHz for the CPU clock speed on the Raspberry Pi.

vi /boot/config.txt
#uncomment to overclock the arm. 700 MHz is the default.
over_voltage=6
arm_freq=2000