From 7dddb468f4460111b8f8bc332c6b26d6996df5a1 Mon Sep 17 00:00:00 2001 From: zhangyanjiao Date: Thu, 6 Jul 2023 14:35:56 +0800 Subject: [PATCH 1/5] feat(wifi): Add API to get RSSI info after station connects to AP - Add esp_wifi_sta_get_rssi() function to retrieve RSSI info after station connects to AP --- components/esp_wifi/include/esp_wifi.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/components/esp_wifi/include/esp_wifi.h b/components/esp_wifi/include/esp_wifi.h index 6f8bb5999e..3ed614d015 100644 --- a/components/esp_wifi/include/esp_wifi.h +++ b/components/esp_wifi/include/esp_wifi.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -1343,6 +1343,21 @@ esp_err_t esp_wifi_sta_get_aid(uint16_t *aid); * - ESP_OK: succeed */ esp_err_t esp_wifi_sta_get_negotiated_phymode(wifi_phy_mode_t *phymode); + +/** + * @brief Get the rssi info after station connected to AP + * + * @attention This API should be called after station connected to AP. + * + * @param rssi store the rssi info received from last beacon. + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_INVALID_ARG: invalid argument + * - ESP_FAIL: failed + */ +esp_err_t esp_wifi_sta_get_rssi(int *rssi); + #ifdef __cplusplus } #endif From b2134caf0dd25f41a5c35e2f1e88fd8f8ea8bdeb Mon Sep 17 00:00:00 2001 From: david zuhn Date: Mon, 5 Sep 2022 16:08:14 -0500 Subject: [PATCH 2/5] spelling correction in documentation Signed-off-by: zhangyanjiao Closes https://github.com/espressif/esp-idf/pull/9721 --- components/esp_wifi/include/esp_wifi.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/esp_wifi/include/esp_wifi.h b/components/esp_wifi/include/esp_wifi.h index 3ed614d015..0248d5e71a 100644 --- a/components/esp_wifi/include/esp_wifi.h +++ b/components/esp_wifi/include/esp_wifi.h @@ -618,7 +618,7 @@ esp_err_t esp_wifi_get_channel(uint8_t *primary, wifi_second_chan_t *second); * it's up to the user to fill in all fields according to local regulations. * Please use esp_wifi_set_country_code instead. * @attention 2. The default country is "01" (world safe mode) {.cc="01", .schan=1, .nchan=11, .policy=WIFI_COUNTRY_POLICY_AUTO}. - * @attention 3. The third octect of country code string is one of the following: ' ', 'O', 'I', 'X', otherwise it is considered as ' '. + * @attention 3. The third octet of country code string is one of the following: ' ', 'O', 'I', 'X', otherwise it is considered as ' '. * @attention 4. When the country policy is WIFI_COUNTRY_POLICY_AUTO, the country info of the AP to which * the station is connected is used. E.g. if the configured country info is {.cc="US", .schan=1, .nchan=11} * and the country info of the AP to which the station is connected is {.cc="JP", .schan=1, .nchan=14} @@ -1269,7 +1269,7 @@ esp_err_t esp_wifi_connectionless_module_set_wake_interval(uint16_t wake_interva * * @attention 7. When country code "01" (world safe mode) is set, SoftAP mode won't contain country IE. * @attention 8. The default country is "01" (world safe mode) and ieee80211d_enabled is TRUE. - * @attention 9. The third octect of country code string is one of the following: ' ', 'O', 'I', 'X', otherwise it is considered as ' '. + * @attention 9. The third octet of country code string is one of the following: ' ', 'O', 'I', 'X', otherwise it is considered as ' '. * * @param country the configured country ISO code * @param ieee80211d_enabled 802.11d is enabled or not From 881f3fc54dcda4eb7b40827480c098f9d8681886 Mon Sep 17 00:00:00 2001 From: Rotzbua Date: Thu, 20 Oct 2022 00:44:45 +0200 Subject: [PATCH 3/5] doc: remove WEP as security mode Signed-off-by: zhangyanjiao Closes https://github.com/espressif/esp-idf/pull/10015 --- docs/en/api-reference/network/esp_wifi.rst | 2 +- docs/zh_CN/api-reference/network/esp_wifi.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/api-reference/network/esp_wifi.rst b/docs/en/api-reference/network/esp_wifi.rst index f00dccc238..9c12f463db 100644 --- a/docs/en/api-reference/network/esp_wifi.rst +++ b/docs/en/api-reference/network/esp_wifi.rst @@ -12,7 +12,7 @@ The Wi-Fi libraries provide support for configuring and monitoring the {IDF_TARG - AP mode (aka Soft-AP mode or Access Point mode). Stations connect to the {IDF_TARGET_NAME}. - Station/AP-coexistence mode ({IDF_TARGET_NAME} is concurrently an access point and a station connected to another access point). -- Various security modes for the above (WPA, WPA2, WEP, etc.) +- Various security modes for the above (WPA2, WPA3, etc.) - Scanning for access points (active & passive scanning). - Promiscuous mode for monitoring of IEEE802.11 Wi-Fi packets. diff --git a/docs/zh_CN/api-reference/network/esp_wifi.rst b/docs/zh_CN/api-reference/network/esp_wifi.rst index 929c423250..cffe22e63b 100644 --- a/docs/zh_CN/api-reference/network/esp_wifi.rst +++ b/docs/zh_CN/api-reference/network/esp_wifi.rst @@ -12,7 +12,7 @@ Wi-Fi 库支持配置及监控 {IDF_TARGET_NAME} Wi-Fi 连网功能。支持配 - AP 模式(即 Soft-AP 模式或接入点模式),此时基站连接到 {IDF_TARGET_NAME}。 - station/AP 共存模式({IDF_TARGET_NAME} 既是接入点,同时又作为基站连接到另外一个接入点)。 -- 上述模式的各种安全模式(WPA、WPA2 及 WEP 等)。 +- 上述模式的各种安全模式(WPA2、WPA3 等)。 - 扫描接入点(包括主动扫描及被动扫描)。 - 使用混杂模式监控 IEEE802.11 Wi-Fi 数据包。 From 0b42747d0a1a424c37839efa8b0ea625a7d97649 Mon Sep 17 00:00:00 2001 From: Li Shuai Date: Thu, 15 Jun 2023 10:46:01 +0800 Subject: [PATCH 4/5] Wi-Fi/power save: fix the some mac issues of wifi power save Some APs are configured to hide the SSID, the length field of the SSID element in the Beacon frame is set to 0. This can cause incorrect parsing of the Beacon by the Wi-Fi MAC hardware. Some APs send two beacon frames with different BSSID in a TBTT cycle. After correctly parsing the beacon of the associated AP, it continue to receive the other beacon frame, which will cause the MAC to remain in a wait RX/TXING state, blocking the Wi-Fi go to sleep. --- components/esp_rom/esp32c2/ld/esp32c2.rom.ld | 2 +- components/esp_rom/esp32c3/ld/esp32c3.rom.ld | 2 +- components/esp_rom/esp32s3/ld/esp32s3.rom.ld | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/esp_rom/esp32c2/ld/esp32c2.rom.ld b/components/esp_rom/esp32c2/ld/esp32c2.rom.ld index 9056988972..9e69c319df 100644 --- a/components/esp_rom/esp32c2/ld/esp32c2.rom.ld +++ b/components/esp_rom/esp32c2/ld/esp32c2.rom.ld @@ -1522,7 +1522,7 @@ hal_mac_is_low_rate_enabled = 0x40001af0; hal_mac_tx_get_blockack = 0x40001af4; hal_mac_tx_set_ppdu = 0x40001af8; ic_get_trc = 0x40001afc; -ic_mac_deinit = 0x40001b00; +/* ic_mac_deinit = 0x40001b00; */ ic_mac_init = 0x40001b04; ic_interface_enabled = 0x40001b08; is_lmac_idle = 0x40001b0c; diff --git a/components/esp_rom/esp32c3/ld/esp32c3.rom.ld b/components/esp_rom/esp32c3/ld/esp32c3.rom.ld index ae413e021c..05dc274129 100644 --- a/components/esp_rom/esp32c3/ld/esp32c3.rom.ld +++ b/components/esp_rom/esp32c3/ld/esp32c3.rom.ld @@ -1589,7 +1589,7 @@ hal_mac_is_low_rate_enabled = 0x400015cc; hal_mac_tx_get_blockack = 0x400015d0; /* hal_mac_tx_set_ppdu = 0x400015d4;*/ ic_get_trc = 0x400015d8; -ic_mac_deinit = 0x400015dc; +/* ic_mac_deinit = 0x400015dc; */ ic_mac_init = 0x400015e0; ic_interface_enabled = 0x400015e4; is_lmac_idle = 0x400015e8; diff --git a/components/esp_rom/esp32s3/ld/esp32s3.rom.ld b/components/esp_rom/esp32s3/ld/esp32s3.rom.ld index c94150ab97..d61c1623f6 100644 --- a/components/esp_rom/esp32s3/ld/esp32s3.rom.ld +++ b/components/esp_rom/esp32s3/ld/esp32s3.rom.ld @@ -1899,7 +1899,7 @@ hal_mac_is_low_rate_enabled = 0x400052a4; hal_mac_tx_get_blockack = 0x400052b0; /* hal_mac_tx_set_ppdu = 0x400052bc;*/ ic_get_trc = 0x400052c8; -ic_mac_deinit = 0x400052d4; +/* ic_mac_deinit = 0x400052d4; */ ic_mac_init = 0x400052e0; ic_interface_enabled = 0x400052ec; is_lmac_idle = 0x400052f8; From 368dca0d84e04e2c45ebc6a10d958efdf9d2d188 Mon Sep 17 00:00:00 2001 From: zhangyanjiao Date: Fri, 26 May 2023 17:24:18 +0800 Subject: [PATCH 5/5] fix(wifi): Add bugfixes and improvements 1. Update wifi security mode 2. Fix association refused temporarily comeback time set to zero issue 3. Vnd ie callback can be set to null --- components/esp_wifi/lib | 2 +- docs/en/api-reference/network/esp_wifi.rst | 2 +- docs/zh_CN/api-reference/network/esp_wifi.rst | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/esp_wifi/lib b/components/esp_wifi/lib index 4fb69be514..907f0a16c0 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit 4fb69be5144cf7709824def61e77d58f47ef0c9d +Subproject commit 907f0a16c098317bd2c8bc0c74ac5df792e7152a diff --git a/docs/en/api-reference/network/esp_wifi.rst b/docs/en/api-reference/network/esp_wifi.rst index 9c12f463db..038bf68098 100644 --- a/docs/en/api-reference/network/esp_wifi.rst +++ b/docs/en/api-reference/network/esp_wifi.rst @@ -12,7 +12,7 @@ The Wi-Fi libraries provide support for configuring and monitoring the {IDF_TARG - AP mode (aka Soft-AP mode or Access Point mode). Stations connect to the {IDF_TARGET_NAME}. - Station/AP-coexistence mode ({IDF_TARGET_NAME} is concurrently an access point and a station connected to another access point). -- Various security modes for the above (WPA2, WPA3, etc.) +- Various security modes for the above (WPA, WPA2, WPA3, etc.) - Scanning for access points (active & passive scanning). - Promiscuous mode for monitoring of IEEE802.11 Wi-Fi packets. diff --git a/docs/zh_CN/api-reference/network/esp_wifi.rst b/docs/zh_CN/api-reference/network/esp_wifi.rst index cffe22e63b..13cf23d8a6 100644 --- a/docs/zh_CN/api-reference/network/esp_wifi.rst +++ b/docs/zh_CN/api-reference/network/esp_wifi.rst @@ -12,7 +12,7 @@ Wi-Fi 库支持配置及监控 {IDF_TARGET_NAME} Wi-Fi 连网功能。支持配 - AP 模式(即 Soft-AP 模式或接入点模式),此时基站连接到 {IDF_TARGET_NAME}。 - station/AP 共存模式({IDF_TARGET_NAME} 既是接入点,同时又作为基站连接到另外一个接入点)。 -- 上述模式的各种安全模式(WPA2、WPA3 等)。 +- 上述模式的各种安全模式(WPA、WPA2、WPA3 等)。 - 扫描接入点(包括主动扫描及被动扫描)。 - 使用混杂模式监控 IEEE802.11 Wi-Fi 数据包。