ESP32 doesn't reconnect on loss of WiFi
philpem opened this issue · 0 comments
philpem commented
Describe the bug, issue or concern
When the ESP32 loses the connection with the WiFi access point, it makes no attempt to reconnect. It also continues generating timecodes from its internal clock, which will drift over time as the NTP synchronisation has been lost.
To Reproduce
Steps to reproduce the behavior:
- Power on the ESP32 timecode generator
- Wait for it to connect to the WiFi and start generating valid timecodes
- Power off the WiFi access point. Wait a few minutes.
- Power on the WiFi access point. Wait a few minutes.
- Note that the ESP32 has not reconnected to the WiFi, the web interface is not accessible, and the clock is free-running.
Expected behavior
ESP32 reconnects to the WiFi after a connection loss.
See link for examples of how this can be implemented in the loop()
function: https://randomnerdtutorials.com/solved-reconnect-esp32-to-wifi/
It may be desirable to stop generating timecodes when NTP sync has been lost (if this doesn't happen already). The Gorgy clocks at least detect this and leave the 'colon' indicator lit to signify a loss of sync.