summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorst33v <github@f3rr3t.com>2018-01-09 17:33:01 +1100
committerst33v <github@f3rr3t.com>2018-01-09 17:33:01 +1100
commita7904f17cbc8591759b5e84d09f745743a616a18 (patch)
tree5c5c0bc4551f831cd4a24fb76aaf1c82fe47fbf8
parentc7a867e83bc5697b98f13b5bb872a79cc68f5576 (diff)
simple pub 'stub'
-rw-r--r--publishTemperature.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/publishTemperature.sh b/publishTemperature.sh
new file mode 100644
index 0000000..0299db9
--- /dev/null
+++ b/publishTemperature.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+# Extract raspi GPU/CPU temperatures and publish them on MQTT
+# SJP 9 Jan 2018
+# Designed to be called from a timer service.
+#
+cpuTemp=echo "scale=1; $(cat /sys/class/thermal/thermal_zone0/temp)/1000" | bc
+
+mosquitto_pub -h stan -t stan/test/cpu/${cpuTemp}
+