Wednesday, April 14, 2021

Print Raspberry Pi CPU and GPU temperature

cpu1=$(</sys/class/thermal/thermal_zone0/temp)
cpu2=$(echo "scale=1;$cpu1/1000" | bc)

gpu1=$(/opt/vc/bin/vcgencmd measure_temp)
gpu2=$(echo $gpu1 | tr -dc '.,0-9')

echo "$(date +'%d.%m.%Y %H:%M:%S') @ $(hostname)"

echo "CPU: $cpu2"
echo "GPU: $gpu2"

No comments:

Post a Comment