Skip to content

Commit

Permalink
Added missing code for setting mqtt keep alive
Browse files Browse the repository at this point in the history
  • Loading branch information
gskjold committed Nov 9, 2024
1 parent 22b7877 commit fa76233
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/AmsMqttHandler/src/AmsMqttHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit fa76233

Please sign in to comment.