added a random number generator
This commit is contained in:
parent
3159e5a80f
commit
6b103f397b
8
software/firmware/energy-monitor/00-simulator/simulate.sh
Executable file
8
software/firmware/energy-monitor/00-simulator/simulate.sh
Executable file
|
@ -0,0 +1,8 @@
|
||||||
|
#!/bin/sh
|
||||||
|
echo Publishing random values to topic '/iot-platform/energy-monitor/test-device‘
|
||||||
|
while true
|
||||||
|
do
|
||||||
|
mosquitto_pub -h localhost -p 1883 -t '/iot-platform/energy-monitor/test-device/watt' -m $((1 + $RANDOM % 10 * 500))
|
||||||
|
printf '%s' "."
|
||||||
|
sleep 1
|
||||||
|
done
|
Loading…
Reference in a new issue