Skip to content

Commit

Permalink
fix: increase keep alive timeout for mqtt #115
Browse files Browse the repository at this point in the history
  • Loading branch information
Laxilef committed Jan 24, 2025
1 parent fe93c00 commit cc2d6ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/MqttTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ class MqttTask : public Task {
#endif

// client settings
this->client->setKeepAliveInterval(15000);
this->client->setTxPayloadSize(256);
#ifdef ARDUINO_ARCH_ESP8266
this->client->setConnectionTimeout(1000);
Expand Down Expand Up @@ -199,6 +198,7 @@ class MqttTask : public Task {
this->haHelper->updateCachedTopics();

this->client->stop();
this->client->setKeepAliveInterval(settings.mqtt.interval * 10000);
this->client->setId(networkSettings.hostname);
this->client->setUsernamePassword(settings.mqtt.user, settings.mqtt.password);
this->client->beginWill(this->haHelper->getDeviceTopic(F("status")).c_str(), 7, true, 1);
Expand Down

0 comments on commit cc2d6ef

Please sign in to comment.