Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/net/mqtt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,15 @@ static void onMessage(char* topicC, byte* payload, unsigned len) {
static void tryConnect() {
if (netwifi::state() != netwifi::State::Connected) return;
String host = settings::getMqttHost();
if (host.length() == 0) return;
if (host.length() == 0) {
// MQTT host not configured. Back off instead of returning straight
// to loop(), which (with s_nextTryMs unchanged) re-invokes us every
// iteration — re-reading NVS and logging "mqtt_host NOT_FOUND" ~16x
// a second. A minute-scale recheck still picks up creds set later
// without flooding the log or spinning the CPU.
s_nextTryMs = millis() + 60000;
return;
}
uint16_t port = settings::getMqttPort();
String user = settings::getMqttUser();
String pw = settings::getMqttPw();
Expand Down