芯片型号:ESP32-C3-WROOM-O2U
ESP-IDF版本:v5.3.1
开发环境:Windows
IDE:VS Code
问题描述:
配置ESP32-C3设备工作在STA+softAP模式下,nimBLE开启,在ESP32连接到WiFi后,AP能被正常扫描到并连接。但在ESP32未连接到WiFi时,AP不一定会被扫描到,即使被扫描到也无法正常连接。可能的原因是什么?
softAP配置如下:
wifi_config_t wifi_ap_config = {
.ap = {
.channel = 6,
.ssid = "abcde",
.ssid_len = 5,
.password = "", // 开放网络
.max_connection = 3,
.authmode = WIFI_AUTH_OPEN, // WIFI_AUTH_WPA2_PSK,
.ssid_hidden = 0, // 可见
.pmf_cfg = {
.required = false,
},
},
};
在WiFi事件回调中检测到WIFI_EVENT_STA_START和WIFI_EVENT_STA_DISCONNECTED时,会调用esp_wifi_connect()。
解决方案:在事件WIFI_EVENT_STA_DISCONNECTED中调用esp_wifi_connect(),会影响softAP工作,延长WiFi重连时间解决。
如果有更好的解决方法,欢迎留言~
ESP32-C3共存模式下,未连接WiFi时,softAP工作异常【已解决】
Who is online
Users browsing this forum: No registered users and 137 guests