Skip to content

Instantly share code, notes, and snippets.

@ah01
Created October 11, 2015 14:15
Show Gist options
  • Save ah01/449628a68d0a5ab4cfd5 to your computer and use it in GitHub Desktop.
Save ah01/449628a68d0a5ab4cfd5 to your computer and use it in GitHub Desktop.
Send CPU temperature to MQTT
while true
do
t=$(cat /sys/class/thermal/thermal_zone0/temp)
t=$(($t/1000))
echo Teplota CPU $t
mosquitto_pub -h mqtt.sh.cvut.cz -t linuxdays/raspberry/temperature -m "$t °C"
sleep 5
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment