mirror of
https://github.com/UtilitechAS/amsreader-firmware.git
synced 2026-05-05 07:34:24 +00:00
Added a small delay that helped smooth the voltage on a HAN powered device. No more sudden reboots
This commit is contained in:
@@ -189,7 +189,7 @@ void loop() {
|
|||||||
}
|
}
|
||||||
if (!config.getMqttHost().isEmpty()) {
|
if (!config.getMqttHost().isEmpty()) {
|
||||||
mqtt.loop();
|
mqtt.loop();
|
||||||
delay(10);
|
delay(10); // Needed to preserve power. After adding this, the voltage is super smooth on a HAN powered device
|
||||||
if(!mqtt.connected() || config.isMqttChanged()) {
|
if(!mqtt.connected() || config.isMqttChanged()) {
|
||||||
MQTT_connect();
|
MQTT_connect();
|
||||||
}
|
}
|
||||||
@@ -201,7 +201,7 @@ void loop() {
|
|||||||
dnsServer.processNextRequest();
|
dnsServer.processNextRequest();
|
||||||
// Continously flash the LED when AP mode
|
// Continously flash the LED when AP mode
|
||||||
if (now / 50 % 64 == 0) led_on();
|
if (now / 50 % 64 == 0) led_on();
|
||||||
else led_off();
|
else led_off();
|
||||||
|
|
||||||
}
|
}
|
||||||
readHanPort();
|
readHanPort();
|
||||||
@@ -321,6 +321,7 @@ void readHanPort() {
|
|||||||
|
|
||||||
mqtt.publish(config.getMqttPublishTopic(), msg.c_str());
|
mqtt.publish(config.getMqttPublishTopic(), msg.c_str());
|
||||||
mqtt.loop();
|
mqtt.loop();
|
||||||
|
delay(10); // Needed to preserve power
|
||||||
}
|
}
|
||||||
ws.setJson(json);
|
ws.setJson(json);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user