Skip to content

Instantly share code, notes, and snippets.

@mill1000
Created January 25, 2020 16:56
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mill1000/4b0e7c80513bbeae8fbd07fca59b8dbe to your computer and use it in GitHub Desktop.
Save mill1000/4b0e7c80513bbeae8fbd07fca59b8dbe to your computer and use it in GitHub Desktop.
raspibanmonitor - Raspberry Pi 3 Monitor Script
#!/bin/bash
# Continuously queries RPi3 GPU for temperature, clock rates and throttled status
# Original from https://www.raspberrypi.org/forums/viewtopic.php?t=244320
echo -e "Time Temp CPU Core Health Vcore"
while true ; do
Temp=$(vcgencmd measure_temp | cut -f2 -d=)
Clockspeed=$(vcgencmd measure_clock arm | awk -F"=" '{printf ("%0.0f",$2/1000000); }' )
Corespeed=$(vcgencmd measure_clock core | awk -F"=" '{printf ("%0.0f",$2/1000000); }' )
Health=$(vcgencmd get_throttled | awk -F"=" '{printf("0x%08x\n",$2)}')
CoreVolt=$(vcgencmd measure_volts | cut -f2 -d=)
echo -ne "$(date '+%H:%M:%S') ${Temp} $(printf '%4s' ${Clockspeed})MHz $(printf '%4s' ${Corespeed})MHz ${Health} ${CoreVolt}" \\r
sleep 5
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment