Skip to content

Instantly share code, notes, and snippets.

@Gfast2
Created November 15, 2018 15:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Gfast2/cf5e0da514ddeb9b190ea7e320fc8f64 to your computer and use it in GitHub Desktop.
Save Gfast2/cf5e0da514ddeb9b190ea7e320fc8f64 to your computer and use it in GitHub Desktop.
Read Raspberry Pi's GPU & CPU's temprature.
#!/bin/bash
# Script: my-pi-temp.sh
# Purpose: Display the ARM CPU and GPU temperature of Raspberry Pi 2/3
cpu=$(</sys/class/thermal/thermal_zone0/temp)
echo "$(date) @ $(hostname)"
echo "------------------------------"
echo "GPU => $(vcgencmd measure_temp)"
echo "CPU => $((cpu/1000))°C"
@Gfast2
Copy link
Author

Gfast2 commented Nov 15, 2018

If failed, please check out if you have working vcgencmd (with which vcgencmd)

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