Skip to content

Instantly share code, notes, and snippets.

@gvn
Created July 15, 2017 22:30
Show Gist options
  • Save gvn/42d7f0c9b1582f648e6829d0047ade38 to your computer and use it in GitHub Desktop.
Save gvn/42d7f0c9b1582f648e6829d0047ade38 to your computer and use it in GitHub Desktop.
Get the CPU & GPU temperature of a Raspberry Pi
#!/bin/bash
cpu=$(</sys/class/thermal/thermal_zone0/temp)
echo "$(hostname)"
echo "$(date)"
echo ""
echo "GPU: $(/opt/vc/bin/vcgencmd measure_temp | sed "s/'/°/g" | sed "s/temp=//g")"
echo "CPU: $((cpu/1000))°C"
@gvn
Copy link
Author

gvn commented Jul 15, 2017

Official guideline on safe operating temperature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment