fix: increase keep alive timeout for mqtt #115

This commit is contained in:
Yurii
2025-01-24 21:07:08 +03:00
parent fe93c00204
commit cc2d6ef385

View File

@@ -120,7 +120,6 @@ protected:
#endif #endif
// client settings // client settings
this->client->setKeepAliveInterval(15000);
this->client->setTxPayloadSize(256); this->client->setTxPayloadSize(256);
#ifdef ARDUINO_ARCH_ESP8266 #ifdef ARDUINO_ARCH_ESP8266
this->client->setConnectionTimeout(1000); this->client->setConnectionTimeout(1000);
@@ -199,6 +198,7 @@ protected:
this->haHelper->updateCachedTopics(); this->haHelper->updateCachedTopics();
this->client->stop(); this->client->stop();
this->client->setKeepAliveInterval(settings.mqtt.interval * 10000);
this->client->setId(networkSettings.hostname); this->client->setId(networkSettings.hostname);
this->client->setUsernamePassword(settings.mqtt.user, settings.mqtt.password); this->client->setUsernamePassword(settings.mqtt.user, settings.mqtt.password);
this->client->beginWill(this->haHelper->getDeviceTopic(F("status")).c_str(), 7, true, 1); this->client->beginWill(this->haHelper->getDeviceTopic(F("status")).c_str(), 7, true, 1);