fix: skip NTP sync and mDNS in deep sleep wake path to reduce battery drain
The syncNTP() call blocks up to 5 seconds waiting for NTP response on every deep sleep wake cycle (every 10 minutes). Combined with mDNS startup, this added significant active WiFi time per cycle. Fix: Add 'minimal' flag to WiFiManager::begin()/startStation(). In the deep sleep wake path, skip NTP sync and mDNS entirely. The system clock is already seeded from the hardware RTC at boot, which is accurate enough for 30-day date window calculations. Normal interactive boot still does full NTP sync + mDNS as before. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -429,8 +429,8 @@ void timerWakeCycle() {
|
||||
|
||||
Settings s = settingsManager.get();
|
||||
|
||||
// Connect WiFi (blocking)
|
||||
wifiManager.begin(settingsManager);
|
||||
// Connect WiFi (minimal — skip NTP/mDNS to save battery)
|
||||
wifiManager.begin(settingsManager, true);
|
||||
if (!wifiManager.isConnected()) {
|
||||
Serial.println("[timer_wake] WiFi failed — going back to sleep");
|
||||
powerManager.enterDeepSleep(s.interval_min);
|
||||
|
||||
Reference in New Issue
Block a user