- SNTP needs a working Station IP and UDP 123 outbound. Captive portals and strict firewalls block it silently.
- Set timezone and sync wait correctly. Reading wall time before the first sync yields 1970 and breaks TLS.
- Use a reachable NTP pool for the region. A hard-coded dead server looks like ‘SNTP is broken’.
- Products without RTC still need SNTP after every deep power loss before MQTT TLS.
Short answer
ESP32 SNTP never gets a sane time. What should I check?
中文
短答
ESP32 SNTP 对不上时间,查什么?
- SNTP 要有可用 Station IP,并能出站 UDP 123。门户热点和防火墙常会静默挡住。
- 时区和等待同步要设对。第一次同步前读墙钟时间会是 1970,TLS 先挂。
- 用本地区能到的 NTP 池。写死一台失效服务器会像「SNTP 坏了」。
- 没有 RTC 的产品,深度掉电后仍要在 MQTT TLS 前再跑 SNTP。