Last active
August 29, 2015 14:01
-
-
Save vallieres/0945f33facde1b8114ed to your computer and use it in GitHub Desktop.
Get Chip Temperature for 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 | |
###################################################################### | |
# Raspberry Pi | |
# | |
# Gross Script by Vallières (Alexandre Vallières-Lagacé) <[email protected]> | |
# V1.0 2014-05-16 | |
# | |
# Use the thermal zone0 to obtain the Temp of the SOC | |
# | |
# No dependencies | |
# | |
###################################################################### | |
temp_cel=`awk '{printf("%.1f\n",$1/1e3)}' /sys/class/thermal/thermal_zone0/temp` | |
temp_far=`awk '{printf("%.1f\n",$1*1.8/1e3)}' /sys/class/thermal/thermal_zone0/temp` | |
echo Temperature = $temp_cel\°C \($temp_far°F\) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment