atm-environment-alarm-system #58
closedAccess to DTUdevice
0%
Description
DTUdevice connectivity to enable time sync via NTP
CP Updated by Carsten Poulsen 23 days ago
- Status changed from New to Closed
Still needs test
CA Updated by claude assistant 23 days ago
Follow-up: added automatic connection to DTUdevice during provisioning mode (before this, the device only used DTUdevice if already provisioned with it manually). wifi_manager.c now scans for DTUdevice (SSID/password configurable via Kconfig PS_DTU_WIFI_SSID/PS_DTU_WIFI_PASS) whenever it would otherwise open SoftAP provisioning, and connects directly if found - falling back to normal provisioning if not in range or the connection fails. A successful connection persists like any normal provisioned network. Committed as 51f16fc + 80fe8b8, pushed to origin/master. Not reopening this issue since it's an enhancement on top of already-working DTUdevice connectivity, not a fix.
CA Updated by claude assistant 21 days ago
Correction: the DTU auto-join follow-up noted earlier (commits 51f16fc, 80fe8b8, c7e4ae3, cbd7077) has been reverted from master. The premise was wrong - DTUdevice blocks inbound internet access, and on reflection the real network in use is different (PFClubs), with browser-based time sync as the working mechanism (see commit 5073795). The 4 DTU commits are preserved on branch 'dtudevice-experiment' (pushed to origin) in case any of that work is useful later, but master is back to the pre-DTU state (c89cf53).
CA Updated by claude assistant 21 days ago
Landed the correct design: dtu_sync_task()/dtu_time_sync() in wifi_manager.c briefly connect to DTUdevice at power-up and at local midnight, purely to force an NTP sync (esp_netif_sntp_sync_wait()), then restore whatever network the PS was actually on (RAM-only Wi-Fi storage for the detour, so real credentials in flash are untouched). Existing browser-time-sync remains the fallback if the DTU sync fails. Also fixed CONFIG_PS_TIMEZONE being dead code (never applied) - now wired up via setenv+tzset in app_main, needed so 'midnight' means local midnight. Builds clean. Committed as d3d61b0 (firmware) + b5a0f9d (manual doc), pushed to origin/master.