diff --git a/lib/AmsMqttHandler/src/AmsMqttHandler.cpp b/lib/AmsMqttHandler/src/AmsMqttHandler.cpp index 57d2eae0..5f2b2ac1 100644 --- a/lib/AmsMqttHandler/src/AmsMqttHandler.cpp +++ b/lib/AmsMqttHandler/src/AmsMqttHandler.cpp @@ -101,6 +101,7 @@ bool AmsMqttHandler::connect() { mqttConfigChanged = false; mqtt.setTimeout(mqttConfig.timeout); + mqtt.setKeepAlive(mqttConfig.keepalive); mqtt.begin(mqttConfig.host, mqttConfig.port, *actualClient); String statusTopic = String(mqttConfig.publishTopic) + "/status"; mqtt.setWill(statusTopic.c_str(), "offline", true, 0);