dirkx/SMPTE-EBU-TimecodeGenerator-ESP32

ESP32 doesn't reconnect on loss of WiFi

philpem opened this issue · 0 comments

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:

  1. Power on the ESP32 timecode generator
  2. Wait for it to connect to the WiFi and start generating valid timecodes
  3. Power off the WiFi access point. Wait a few minutes.
  4. Power on the WiFi access point. Wait a few minutes.
  5. 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.