From 364670ecf10b2f31e9a207bc440cfb731dcfa603 Mon Sep 17 00:00:00 2001 From: Thomas Wenrich Date: Sun, 13 Jun 2021 16:23:53 +0200 Subject: [PATCH] docs/esp32: Document WLAN "reconnects" config option. --- docs/esp32/quickref.rst | 8 ++++++++ docs/library/network.WLAN.rst | 1 + 2 files changed, 9 insertions(+) diff --git a/docs/esp32/quickref.rst b/docs/esp32/quickref.rst index 1709891265..77c7027c40 100644 --- a/docs/esp32/quickref.rst +++ b/docs/esp32/quickref.rst @@ -102,6 +102,14 @@ Once the network is established the :mod:`socket ` module can be used to create and use TCP/UDP sockets as usual, and the ``urequests`` module for convenient HTTP requests. +After a call to ``wlan.connect()``, the device will by default retry to connect +**forever**, even when the authentication failed or no AP is in range. +``wlan.status()`` will return ``network.STAT_CONNECTING`` in this state until a +connection succeeds or the interface gets disabled. This can be changed by +calling ``wlan.config(reconnects=n)``, where n are the number of desired reconnect +attempts (0 means it won't retry, -1 will restore the default behaviour of trying +to reconnect forever). + Delay and timing ---------------- diff --git a/docs/library/network.WLAN.rst b/docs/library/network.WLAN.rst index fcdaa41b36..88bd3a3707 100644 --- a/docs/library/network.WLAN.rst +++ b/docs/library/network.WLAN.rst @@ -129,4 +129,5 @@ Methods authmode Authentication mode supported (enumeration, see module constants) password Access password (string) dhcp_hostname The DHCP hostname to use + reconnects Number of reconnect attempts to make (integer, 0=none, -1=unlimited) ============= ===========