Created
March 7, 2021 03:25
-
-
Save ratacibernetica/4fb45b9c782e7428de8989bc045e63e3 to your computer and use it in GitHub Desktop.
get the temperature of the CPU/GPU on raspberry pi
This file contains hidden or 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
#!/bin/bash | |
# Script: my-pi-temp.sh | |
# Purpose: Display the ARM CPU and GPU temperature of Raspberry Pi 2/3 | |
# Author: Vivek Gite <www.cyberciti.biz> under GPL v2.x+ | |
# ------------------------------------------------------- | |
cpu=$(</sys/class/thermal/thermal_zone0/temp) | |
echo "$(date) @ $(hostname)" | |
echo "-------------------------------------------" | |
echo "GPU => $(/opt/vc/bin/vcgencmd measure_temp)" | |
echo "CPU => $((cpu/1000))'C" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment