Files
MeshCoreTel-firmware/src/helpers
Valentin V. Bartenev dd90afba1d NetworkService: keep hasTimeSync() true for 24h after WiFi drops
_have_time_sync is reset to false whenever WiFi disconnects, even
though the ESP32 RTC continues to hold accurate time after a
successful SNTP sync. This caused hasTimeSync() to return false
during transient WiFi outages, unnecessarily tearing down MQTT
broker connections and suppressing packet publishing.

Introduce _last_time_sync to record the wall-clock time of the
most recent confirmed sync. Move hasTimeSync() out of the header
into NetworkService.cpp and extend its logic: in addition to the
existing _have_time_sync flag, return true if the system clock is
still sane (>= kMinSaneEpoch) and no more than kMaxOutOfSync (24h)
has elapsed since the last confirmed sync.

This makes the MQTT uplink resilient to brief WiFi dropouts without
requiring any changes to callers of hasTimeSync().

Also bump kMinSaneEpoch from 2025-01-01 to 2026-01-01.
2026-05-03 22:10:32 +03:00
..
2025-12-02 10:31:24 +00:00
2025-06-25 11:00:24 +02:00
2026-03-20 15:56:09 +08:00
2026-04-28 00:52:26 +03:00
2026-04-17 17:54:47 +10:00
2025-06-30 03:46:18 +02:00
2026-02-18 22:32:01 +07:00
2026-04-18 21:32:41 +10:00
2026-04-17 14:38:03 +10:00
2026-04-21 18:07:04 +10:00