diff --git a/code/espurna/config/general.h b/code/espurna/config/general.h index 7b5d23fd..0fd2d7f6 100644 --- a/code/espurna/config/general.h +++ b/code/espurna/config/general.h @@ -181,7 +181,7 @@ #endif #ifndef HEARTBEAT_INTERVAL -#define HEARTBEAT_INTERVAL 300000 // Interval between heartbeat messages (in ms) +#define HEARTBEAT_INTERVAL 300 // Interval between heartbeat messages (in sec) #endif #define UPTIME_OVERFLOW 4294967295 // Uptime overflow value diff --git a/code/espurna/system.ino b/code/espurna/system.ino index 7d015bb8..27b2d4dd 100644 --- a/code/espurna/system.ino +++ b/code/espurna/system.ino @@ -82,8 +82,6 @@ unsigned long systemLoadAverage() { } void _systemSetupHeartbeat() { - if (getSetting("hbMode").length() == 0) setSetting("hbMode", HEARTBEAT_MODE); - if (getSetting("hbInterval").length() == 0) setSetting("hbInterval", HEARTBEAT_INTERVAL); _heartbeat_mode = getSetting("hbMode", HEARTBEAT_MODE).toInt(); _heartbeat_interval = getSetting("hbInterval", HEARTBEAT_INTERVAL).toInt(); } @@ -116,9 +114,9 @@ void systemLoop() { } else if (_heartbeat_mode == HEARTBEAT_REPEAT || _heartbeat_mode == HEARTBEAT_REPEAT_STATUS) { static unsigned long last_hbeat = 0; #if NTP_SUPPORT - if ((_system_send_heartbeat && ntpSynced()) || (millis() - last_hbeat > _heartbeat_interval)) { + if ((_system_send_heartbeat && ntpSynced()) || (millis() - last_hbeat > _heartbeat_interval * 1000)) { #else - if (_system_send_heartbeat || (millis() - last_hbeat > _heartbeat_interval)) { + if (_system_send_heartbeat || (millis() - last_hbeat > _heartbeat_interval * 1000)) { #endif last_hbeat = millis(); heartbeat(); diff --git a/code/html/index.html b/code/html/index.html index 9d8f6ede..349ebfcb 100644 --- a/code/html/index.html +++ b/code/html/index.html @@ -621,30 +621,27 @@