From d2010ddebb4a015ebb1f1e06c4999837ceea1b9a Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 1 Jul 2021 20:40:51 +0200 Subject: [PATCH] improved script reliability --- esp32/host/uploadInitialSettings.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/esp32/host/uploadInitialSettings.sh b/esp32/host/uploadInitialSettings.sh index 413f32f..fa823e9 100755 --- a/esp32/host/uploadInitialSettings.sh +++ b/esp32/host/uploadInitialSettings.sh @@ -16,6 +16,7 @@ mosquitto_pub -h $mqttHost -t "${mqttPrefix}${homieId}/stay/alive/set" -m "1" -r echo "Waiting ..." mosquitto_sub -h $mqttHost -t "${mqttPrefix}${homieId}/#" -R -C 1 set -e +sleep 30 mosquitto_pub -h $mqttHost -t "${mqttPrefix}${homieId}/\$implementation/config/set" -m "{ \"settings\": { \"sleep\":600, @@ -64,11 +65,12 @@ mosquitto_pub -h $mqttHost -t "${mqttPrefix}${homieId}/\$implementation/config/s \"lowLight6\": false, \"delay6\": 10 } -}" -r +}" echo "Waiting for reboot" sleep 1 mosquitto_sub -h $mqttHost -t "${mqttPrefix}${homieId}/#" -R -C 1 +sleep 20 mosquitto_pub -h $mqttHost -t "${mqttPrefix}${homieId}/config/backup/set" -m "true" -r - +sleep 5 mosquitto_pub -h $mqttHost -t "${mqttPrefix}${homieId}/stay/alive/set" -m "0" -r exit 0