Skip to content

Commit cf01523

Browse files
authored
Doc: Add doc about minimum security for connection to AP (espressif#6909)
* Add troubleshooting to connect to WEP/WPA APs. * Add troubleshooting about WPA3 support.
1 parent cb52e56 commit cf01523

File tree

3 files changed

+59
-6
lines changed

3 files changed

+59
-6
lines changed

Diff for: docs/source/api/wifi.rst

+14-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The Wi-Fi API provides support for the 802.11b/g/n protocol driver. This API inc
1111

1212
* AP mode (aka Soft-AP mode or Access Point mode). Devices connect to the ESP32
1313

14-
* Security modes (WPA, WPA2, WEP, etc.)
14+
* Security modes (WPA2, WPA3 etc.)
1515

1616
* Scanning for access points
1717

@@ -477,6 +477,19 @@ Function used to get the automatic reconnection if the connection is lost.
477477
478478
The function will return ``true`` if this setting is enabled.
479479

480+
setMinSecurity
481+
**************
482+
483+
Function used to set the minimum security for AP to be considered connectable.
484+
485+
.. code-block:: arduino
486+
487+
bool setMinSecurity(wifi_auth_mode_t minSecurity);
488+
489+
Where:
490+
491+
* ``minSecurity`` is the minimum security for AP to be considered connectable. Default is ``WIFI_AUTH_WPA2_PSK``.
492+
480493
WiFiMulti
481494
---------
482495

Diff for: docs/source/troubleshooting.rst

+39
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,42 @@ Solution
8080
* Change the USB port.
8181
* Check your power supply.
8282
* Check if the board is damaged or defective.
83+
84+
Wi-Fi
85+
-----
86+
87+
Why does the board not connect to WEP/WPA-"encrypted" Wi-Fi?
88+
************************************************************
89+
90+
Please note that WEP/WPA has significant security vulnerabilities and its use is strongly discouraged.
91+
The support may therefore be removed in the future. Please migrate to WPA2 or newer.
92+
93+
Solution
94+
^^^^^^^^
95+
96+
Nevertheless, it may be necessary to connect to insecure networks. To do this, the security requirement of the ESP32 must be lowered to an insecure level by using:
97+
98+
.. code-block:: arduino
99+
100+
WiFi.setMinSecurity(WIFI_AUTH_WEP); // Lower min security to WEP.
101+
// or
102+
WiFi.setMinSecurity(WIFI_AUTH_WPA_PSK); // Lower min security to WPA.
103+
104+
Why does the board not connect to WPA3-encrypted Wi-Fi?
105+
*******************************************************
106+
107+
WPA3 support is resource intensive and may not be compiled into the used SDK.
108+
109+
Solution
110+
^^^^^^^^
111+
112+
* Check WPA3 support by your SDK.
113+
* Compile your custom SDK with WPA3 support.
114+
115+
Sample code to check SDK WPA3 support at compile time:
116+
117+
.. code-block:: arduino
118+
119+
#ifndef CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE
120+
#warning "No WPA3 support."
121+
#endif

Diff for: libraries/WiFi/src/WiFiSTA.cpp

+6-5
Original file line numberDiff line numberDiff line change
@@ -337,9 +337,10 @@ bool WiFiSTAClass::reconnect()
337337
}
338338

339339
/**
340-
* Disconnect from the network
341-
* @param wifioff
342-
* @return one value of wl_status_t enum
340+
* Disconnect from the network.
341+
* @param wifioff `true` to turn the Wi-Fi radio off.
342+
* @param eraseap `true` to erase the AP configuration from the NVS memory.
343+
* @return `true` when successful.
343344
*/
344345
bool WiFiSTAClass::disconnect(bool wifioff, bool eraseap)
345346
{
@@ -398,8 +399,8 @@ bool WiFiSTAClass::isConnected()
398399
}
399400

400401
/**
401-
* Set the minimum security for AP to be considered connectable
402-
* Must be called before WiFi.begin()
402+
* Set the minimum security for AP to be considered connectable.
403+
* Must be called before WiFi.begin().
403404
* @param minSecurity wifi_auth_mode_t
404405
*/
405406
void WiFiSTAClass::setMinSecurity(wifi_auth_mode_t minSecurity)

0 commit comments

Comments
 (0)