Wi-Fi Auto Reconnect

Does Zephyr support automatic reconnection of the Wi-Fi if a connection is lost?  I can't find any documentation on this, or code examples.  It seems like every example connects to WiFi on boot, and doesn't have any provision to retry it if the connection is lost (e.g.- if the Access Point goes down due to a power glitch).

I can write my own handler that gets triggered by the connection lost event, but I'm hoping there is something built into Zephyr, or a best-practices example somewhere.

Parents Reply Children
  • Hi Elfving,

    You are right, the automatic reconnect works even if I remove the code to reconnect from the disconnect event handler.

    I saw the automatic connect feature but assumed it didn't apply to our code for two reasons.  First, we are not using the Wi-Fi Credentials library and connect using an SSID and password that we manage separately.  And second, the documentation talks about automatic connection which I interpreted as just the initial connection, not reconnection after a loss of connection.

    I guess that explains why I couldn't find any real discussion about this.  It just works, without any extra code, and even if you connect more directly without the credentials library.

    Thanks,

    Glen

Related