Skip to content

Commit 55b319e

Browse files
committed
Merge branch 'bugfix/authmode_degrade_fix' into 'master'
esp_wifi: Remove auth_changed event and fix wpa2 authmode threshold Closes WIFI-2328 See merge request espressif/esp-idf!8708
2 parents e947db6 + 179292f commit 55b319e

File tree

4 files changed

+20
-5
lines changed

4 files changed

+20
-5
lines changed

components/esp_wifi/include/esp_wifi_types.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ typedef enum {
9494
WIFI_REASON_ASSOC_FAIL = 203,
9595
WIFI_REASON_HANDSHAKE_TIMEOUT = 204,
9696
WIFI_REASON_CONNECTION_FAIL = 205,
97+
WIFI_REASON_AUTH_CHANGED = 206,
9798
} wifi_err_reason_t;
9899

99100
typedef enum {

docs/en/api-guides/wifi.rst

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,6 @@ Another thing deserves our attention is that the default behavior of LwIP is to
182182

183183
In above scenario, ideally, the application sockets and the network layer should not be affected, since the Wi-Fi connection only fails temporarily and recovers very quickly. The application can enable "Keep TCP connections when IP changed" via LwIP menuconfig.
184184

185-
WIFI_EVENT_STA_AUTHMODE_CHANGE
186-
++++++++++++++++++++++++++++++++++++
187-
This event arises when the AP to which the station is connected changes its authentication mode, e.g., from no auth to WPA. Upon receiving this event, the event task will do nothing. Generally, the application event callback does not need to handle this either.
188-
189185
IP_EVENT_STA_GOT_IP
190186
++++++++++++++++++++++++++++++++++++
191187
This event arises when the DHCP client successfully gets the IPV4 address from the DHCP server, or when the IPV4 address is changed. The event means that everything is ready and the application can begin its tasks (e.g., creating sockets).
@@ -1012,6 +1008,17 @@ The table below shows the reason-code defined in {IDF_TARGET_NAME}. The first co
10121008
| | | | WIFI_REASON_4WAY_HANDSHAKE_TIMEOUT. |
10131009
| | | | |
10141010
+---------------------------+-------+---------+-------------------------------------------------------------+
1011+
| CONNECTION_FAIL | 205 |reserved | Espressif-specific Wi-Fi reason-code: the |
1012+
| | | | connection to the AP has failed. |
1013+
| | | | |
1014+
+---------------------------+-------+---------+-------------------------------------------------------------+
1015+
| AUTH_CHANGED | 206 |reserved | Espressif-specific Wi-Fi reason-code: the |
1016+
| | | | disconnection has happened since AP has changed the |
1017+
| | | | authmode. |
1018+
| | | | |
1019+
+---------------------------+-------+---------+-------------------------------------------------------------+
1020+
1021+
10151022

10161023
{IDF_TARGET_NAME} Wi-Fi Station Connecting When Multiple APs Are Found
10171024
----------------------------------------------------------------------
@@ -1141,6 +1148,8 @@ API esp_wifi_set_config() can be used to configure the station. The table below
11411148
| | threshold is open. |
11421149
+------------------+--------------------------------------------------------------+
11431150

1151+
.. attention::
1152+
WEP/WPA security modes are deprecated in IEEE802.11-2016 specifications and are recommended not to be used. These modes can be rejected using authmode threshold by setting threshold as WPA2 by threshold.authmode as WIFI_AUTH_WPA2_PSK.
11441153

11451154
AP Basic Configuration
11461155
+++++++++++++++++++++++++++++++++++++

examples/wifi/getting_started/station/main/station_example_main.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ void wifi_init_sta(void)
9292
.sta = {
9393
.ssid = EXAMPLE_ESP_WIFI_SSID,
9494
.password = EXAMPLE_ESP_WIFI_PASS,
95+
/* Setting a password implies station will connect to all security modes including WEP/WPA.
96+
* However these modes are deprecated and not advisable to be used. Incase your Access point
97+
* doesn't support WPA2, these mode can be enabled by commenting below line */
98+
.threshold.authmode = WIFI_AUTH_WPA2_PSK,
99+
95100
.pmf_cfg = {
96101
.capable = true,
97102
.required = false

0 commit comments

Comments
 (0)