Browse Source

Show free heap in debug console even if no MQTT connection

fastled
Xose Pérez 7 years ago
parent
commit
42359d4d95
1 changed files with 5 additions and 7 deletions
  1. +5
    -7
      code/espurna/espurna.ino

+ 5
- 7
code/espurna/espurna.ino View File

@ -46,13 +46,11 @@ void hardwareLoop() {
// Heartbeat // Heartbeat
static unsigned long last_heartbeat = 0; 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());
} }
} }


Loading…
Cancel
Save