From 1d9a0b62578219ac621e2d726b8679e16f10136b Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Mon, 10 Aug 2026 10:11:43 +0200 Subject: [PATCH] set boottime for RTC (if rtc is set) --- src/core/system.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/system.cpp b/src/core/system.cpp index 75840689b..060a2a1fe 100644 --- a/src/core/system.cpp +++ b/src/core/system.cpp @@ -840,7 +840,7 @@ bool System::loop() { void System::send_info_mqtt() { static uint8_t _connection = 0; uint8_t connection = (EMSESP::network_.ethernet_connected() ? 1 : 0) + (EMSESP::network_.wifi_connected() ? 2 : 0) + (ntp_connected_ ? 4 : 0) - + (EMSESP::network_.has_ipv6() ? 8 : 0); + + (EMSESP::network_.has_ipv6() ? 8 : 0); // check if connection status has changed if (!Mqtt::connected() || connection == _connection) { return; @@ -853,7 +853,7 @@ void System::send_info_mqtt() { // if NTP is enabled send the boot_time in local time in ISO 8601 format (eg: 2022-11-15 20:46:38) // https://github.com/emsesp/EMS-ESP32/issues/751 - if (ntp_connected_) { + if (time(nullptr) > 1500000000L) { char time_string[25]; time_t now = time(nullptr) - uuid::get_uptime_sec(); strftime(time_string, 25, "%FT%T%z", localtime(&now));