Last active
April 21, 2024 09:17
-
-
Save siberex/4eb55ec452a1a70127d44ca3dc4e643f to your computer and use it in GitHub Desktop.
Raspberry Pi temperature monitor
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
#!/bin/bash | |
printf '%(%Y-%m-%d %H:%M:%S)T\n' -1 | |
# Note rPi CPU and GPU are on the same chip, and GPU don't hanve any separate temperature sensor | |
# vcgencmd and sysfs provide the same data | |
cpu_temp_sysfs=$(</sys/class/thermal/thermal_zone0/temp) | |
echo "vcgencmd => $(vcgencmd measure_temp | grep -o -E '[[:digit:]].*')" | |
echo "sysfs => $((cpu_temp_sysfs/1000))'C" | |
# watch -c -b -d -n 1 -- './temperature.sh' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment