Clock Speed and Temperature

From KlavoWiki
Jump to navigationJump to search

To monitor the temperature and clock speed of a Raspberry Pi

vi /bin/stats
#!/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