From 42359d4d95ae5f84d638276e7bf66b3f964ef30f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xose=20P=C3=A9rez?= Date: Fri, 17 Feb 2017 23:41:28 +0100 Subject: [PATCH] Show free heap in debug console even if no MQTT connection --- code/espurna/espurna.ino | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) 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()); } }