iot-backend/software/firmware/energy-monitor/00-simulator/simulate.sh

8 lines
268 B
Bash
Raw Normal View History

2023-02-22 15:43:48 +01:00
#!/bin/sh
2023-02-22 15:44:07 +01:00
echo Publishing random values to topic '/iot-platform/energy-monitor/test-device'
2023-02-22 15:43:48 +01:00
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