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:
2026-08-05 20:28:00 -04:00
parent b9e5044fd2
commit ac6c6eaf79
3 changed files with 16 additions and 8 deletions

View File

@@ -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);