Last active
May 26, 2016 18:21
-
-
Save alvarow/f0484e3da9e38fafe8d4115c1a3d0f11 to your computer and use it in GitHub Desktop.
RaspberryPi temperature
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 | |
# based of: Vivek Gite <www.cyberciti.biz> under GPL v2.x+ | |
# ------------------------------------------------------- | |
cpu=$((`cat /sys/class/thermal/thermal_zone0/temp|cut -c1-2`)).$((`cat /sys/class/thermal/thermal_zone0/temp|cut -c3-4`)) | |
echo "$(date) @ $(hostname)" | |
echo "-------------------------------------------" | |
echo "GPU => $(/opt/vc/bin/vcgencmd measure_temp)" | |
echo "CPU => ${cpu}'C" | |
# /opt/vc/bin/vcgencmd measure_temp | sed "s/temp=\([0-9]\+\.[0-9]\+\)'C/\1/" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here's sample output