Skip to content

Commit 364670e

Browse files
twenrichdpgeorge
authored andcommitted
docs/esp32: Document WLAN "reconnects" config option.
1 parent 0600668 commit 364670e

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

docs/esp32/quickref.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,14 @@ Once the network is established the :mod:`socket <usocket>` module can be used
102102
to create and use TCP/UDP sockets as usual, and the ``urequests`` module for
103103
convenient HTTP requests.
104104

105+
After a call to ``wlan.connect()``, the device will by default retry to connect
106+
**forever**, even when the authentication failed or no AP is in range.
107+
``wlan.status()`` will return ``network.STAT_CONNECTING`` in this state until a
108+
connection succeeds or the interface gets disabled. This can be changed by
109+
calling ``wlan.config(reconnects=n)``, where n are the number of desired reconnect
110+
attempts (0 means it won't retry, -1 will restore the default behaviour of trying
111+
to reconnect forever).
112+
105113
Delay and timing
106114
----------------
107115

docs/library/network.WLAN.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,4 +129,5 @@ Methods
129129
authmode Authentication mode supported (enumeration, see module constants)
130130
password Access password (string)
131131
dhcp_hostname The DHCP hostname to use
132+
reconnects Number of reconnect attempts to make (integer, 0=none, -1=unlimited)
132133
============= ===========

0 commit comments

Comments
 (0)