From a7904f17cbc8591759b5e84d09f745743a616a18 Mon Sep 17 00:00:00 2001 From: st33v Date: Tue, 9 Jan 2018 17:33:01 +1100 Subject: simple pub 'stub' --- publishTemperature.sh | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 publishTemperature.sh (limited to 'publishTemperature.sh') 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} + -- cgit v1.3