mirror of
https://github.com/UtilitechAS/amsreader-firmware.git
synced 2026-02-15 04:17:29 +00:00
Automatic reboot when MQTT is lost (#1058)
* Fixing board type overwrite, zmartcharge default issues and disabling entsoe * Fixed Zmartcharge configuration issue * Option to auto reboot if MQTT connection is lost
This commit is contained in:
@@ -979,7 +979,8 @@ void AmsWebServer::configurationJson() {
|
||||
mqttConfig.stateUpdate,
|
||||
mqttConfig.stateUpdateInterval,
|
||||
mqttConfig.timeout,
|
||||
mqttConfig.keepalive
|
||||
mqttConfig.keepalive,
|
||||
mqttConfig.rebootMinutes == 0 ? "null" : String(mqttConfig.rebootMinutes, 10).c_str()
|
||||
);
|
||||
server.sendContent(buf);
|
||||
|
||||
@@ -1405,6 +1406,7 @@ void AmsWebServer::handleSave() {
|
||||
mqtt.stateUpdateInterval = server.arg(F("qd")).toInt();
|
||||
mqtt.timeout = server.arg(F("qi")).toInt();
|
||||
mqtt.keepalive = server.arg(F("qk")).toInt();
|
||||
mqtt.rebootMinutes = server.arg(F("qe")).toInt();
|
||||
} else {
|
||||
config->clearMqtt(mqtt);
|
||||
}
|
||||
@@ -2246,6 +2248,10 @@ void AmsWebServer::configFileDownload() {
|
||||
server.sendContent(buf, snprintf_P(buf, BufferSize, PSTR("mqttPayloadFormat %d\n"), mqtt.payloadFormat));
|
||||
server.sendContent(buf, snprintf_P(buf, BufferSize, PSTR("mqttSsl %d\n"), mqtt.ssl ? 1 : 0));
|
||||
|
||||
if(mqtt.timeout > 0) server.sendContent(buf, snprintf_P(buf, BufferSize, PSTR("mqttTimeout %d\n"), mqtt.timeout));
|
||||
if(mqtt.keepalive > 0) server.sendContent(buf, snprintf_P(buf, BufferSize, PSTR("mqttKeepalive %d\n"), mqtt.keepalive));
|
||||
if(mqtt.rebootMinutes > 0) server.sendContent(buf, snprintf_P(buf, BufferSize, PSTR("mqttRebootMinutes %d\n"), mqtt.rebootMinutes));
|
||||
|
||||
if(mqtt.payloadFormat == 3) {
|
||||
DomoticzConfig domo;
|
||||
config->getDomoticzConfig(domo);
|
||||
|
||||
Reference in New Issue
Block a user