added a random number generator

This commit is contained in:
simonox 2023-02-22 15:43:48 +01:00
parent 3159e5a80f
commit 6b103f397b
1 changed files with 8 additions and 0 deletions

View 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