diff --git a/code/espurna/espurna.ino b/code/espurna/espurna.ino index 93c80a7c..46b910e9 100644 --- a/code/espurna/espurna.ino +++ b/code/espurna/espurna.ino @@ -46,13 +46,11 @@ void hardwareLoop() { // Heartbeat static unsigned long last_heartbeat = 0; - if (mqttConnected()) { - if ((millis() - last_heartbeat > HEARTBEAT_INTERVAL) || (last_heartbeat == 0)) { - last_heartbeat = millis(); - mqttSend(MQTT_HEARTBEAT_TOPIC, "1"); - DEBUG_MSG("[BEAT] Free heap: %d\n", ESP.getFreeHeap()); - DEBUG_MSG("[NTP] Time: %s\n", (char *) NTP.getTimeDateString().c_str()); - } + if ((millis() - last_heartbeat > HEARTBEAT_INTERVAL) || (last_heartbeat == 0)) { + last_heartbeat = millis(); + mqttSend(MQTT_HEARTBEAT_TOPIC, "1"); + DEBUG_MSG("[BEAT] Free heap: %d\n", ESP.getFreeHeap()); + DEBUG_MSG("[NTP] Time: %s\n", (char *) NTP.getTimeDateString().c_str()); } }