Hi everybody,
I am using ESP IDF together with an ESP32 WROVER module. The connection to my access point usually takes 3,7 seconds but sometimes only 250ms. The reason for the 3,7 seconds is that the first connection attempt fails (see hereunder - the so called WIFI_EVENT_STA_DISCONNECTED event raises). But the 2nd attempt always works.
The reason for the WIFI_EVENT_STA_DISCONNECTED event to get triggered is AUTH_EXPIRED (see picture). This means that the wifi credentials (which are correct) cannot be checked within the specified time. When this event is raised my function calls esp_wifi_connect to do a new connection attempt (copied from the ESP IDF examples). My impression is that there is an internal wait period of 2s within this function if the first attempt fails.
I have three questions:
a) Is it possible to alter the timeout for AUTH_EXPIRED?
b) Is it possible to reduce the internal wait period within esp_wifi_connect?
c) Do you have any other idea on how I can speed up things?
Thanks a lot for your help and effort!
Christian
if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_START)
{
esp_wifi_connect();
} else if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_DISCONNECTED)
{
wifi_event_sta_disconnected_t disconnect_event_data = *((wifi_event_sta_disconnected_t*) event_data);
last_wifi_disconnect_reason_code = disconnect_event_data.reason;
ESP_LOGI(TAG, "STA Disconnected Event with error code: %d", last_wifi_disconnect_reason_code);
if (s_retry_num < EXAMPLE_ESP_MAXIMUM_RETRY)
{
esp_wifi_connect();
s_retry_num++;
ESP_LOGI(TAG, "retry to connect to the AP");
} else
{
xEventGroupSetBits(s_wifi_event_group, WIFI_FAIL_BIT);
}
}
WIFI connection speed
-
- Posts: 7
- Joined: Sun Jul 09, 2023 7:57 pm
Jump to
- English Forum
- Explore
- News
- General Discussion
- FAQ
- Documentation
- Documentation
- Sample Code
- Discussion Forum
- Hardware
- ESP-IDF
- ESP-BOX
- ESP-ADF
- ESP-MDF
- ESP-WHO
- ESP-SkaiNet
- ESP32 Arduino
- IDEs for ESP-IDF
- ESP-AT
- ESP IoT Solution
- ESP RainMaker
- Rust
- ESP8266
- Report Bugs
- Showcase
- Chinese Forum 中文社区
- 活动区
- 乐鑫活动专区
- 讨论区
- 全国大学生物联网设计竞赛乐鑫答疑专区
- ESP-IDF 中文讨论版
- 《ESP32-C3 物联网工程开发实战》书籍讨论版
- 中文文档讨论版
- ESP-AT 中文讨论版
- ESP-BOX 中文讨论版
- ESP IoT Solution 中文讨论版
- ESP-ADF 中文讨论版
- ESP Mesh 中文讨论版
- ESP Cloud 中文讨论版
- ESP-WHO 中文讨论版
- ESP-SkaiNet 中文讨论版
- ESP 生产支持讨论版
- 硬件问题讨论
- 项目展示
Who is online
Users browsing this forum: Bing [Bot] and 80 guests
- All times are UTC
- Top
- Delete cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. ESP8266EX and ESP32 are some of our products.