Last active
September 11, 2020 20:43
-
-
Save labbots/78443cea9f42cbbb4af2e4ea44bf0568 to your computer and use it in GitHub Desktop.
Script to measure CPU and GPU temperature of Raspberry PI Model 2/3/3B+ (https://labbots.com/rpi-measure-cpu-gpu-temperature/)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Script: pi-temp-measure.sh | |
# Display the ARM CPU and GPU temperature of Raspberry Pi 2/3B/3B+ | |
# ------------------------------------------------------- | |
echo "-------------------------------------------" | |
echo "$(date) @ $(hostname)" | |
echo "-------------------------------------------" | |
gpu="$(/opt/vc/bin/vcgencmd measure_temp)" | |
echo "GPU => ${gpu##*=}" | |
cpu=$(</sys/class/thermal/thermal_zone0/temp) | |
cpuTemp1=$(($cpu/1000)) | |
cpuTemp2=$(($cpu/100)) | |
cpuTempM=$(($cpuTemp2 % $cpuTemp1)) | |
echo "CPU => ${cpuTemp1}.${cpuTempM}'C" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment