ESP32-C3 SoftAP模式下的连接问题

renbingcheng
Posts: 11
Joined: Fri May 12, 2023 7:12 am

ESP32-C3 SoftAP模式下的连接问题

Postby renbingcheng » Fri Aug 18, 2023 3:22 am

问题描述:
我正在使用ESP32-C3的SoftAP模式创建Wi-Fi热点,并使用手机连接到该热点。当手机连接成功并熄屏一段时间后,我发现手机无法获取热点的信息。在此期间,ESP32-C3不输出任何日志,并且无法响应。问题只能通过重新启动ESP32-C3来解决。我使用的ESP-IDF版本是v4.4.3。

现象细节:

手机成功连接到ESP32-C3的热点后熄屏。
一段时间后,手机无法获取热点信息。
ESP32-C3在此期间没有任何日志输出,表现为无响应。
问题只能通过重新启动ESP32-C3解决,重连热点无效。

我已附上了部分相关的日志,并正在寻求任何可能的解决方案或建议。有没有人遇到过类似的问题?非常感谢大家的支持和帮助!

以下是重连热点时ESP32C3输出的log信息:

Code: Select all

(1968973) wifi:station: 42:a3:bf:4c:c2:d3 leave, AID = 1, bss_flags is 658531, bss:0x3fcb4a20
I (1968973) wifi:new:<1,0>, old:<1,1>, ap:<1,1>, sta:<255,255>, prof:1      
W (1968983) wifi:<ba-del>idx
I (1968983) wifi softAP: station 42:a3:bf:4c:c2:d3 leave, AID=1
I (1973373) wifi:new:<1,1>, old:<1,0>, ap:<1,1>, sta:<255,255>, prof:1
I (1973373) wifi:station: 42:a3:bf:4c:c2:d3 join, AID=1, bgn, 40U
I (1973403) wifi softAP: station 42:a3:bf:4c:c2:d3 join, AID=1
I (1973633) esp_netif_lwip: DHCP server assigned IP to a station, IP is: 192.168.4.2
W (1974113) wifi:<ba-add>idx:2 (ifx:1, 42:a3:bf:4c:c2:d3), tid:0, ssn:15, winSize:64
Last edited by renbingcheng on Tue Sep 05, 2023 1:42 am, edited 1 time in total.

renbingcheng
Posts: 11
Joined: Fri May 12, 2023 7:12 am

Re: ESP32-C3 SoftAP模式下的连接问题

Postby renbingcheng » Mon Sep 04, 2023 6:39 am

目前还是未解决,有人来看看吗,急

renbingcheng
Posts: 11
Joined: Fri May 12, 2023 7:12 am

Re: ESP32-C3 SoftAP模式下的连接问题

Postby renbingcheng » Mon Sep 04, 2023 6:47 am

手机是华为p30 系统hormany os 2.0.0.268
log:

Code: Select all

I (3538) wifi_init: rx ba win: 6
I (3548) wifi_init: tcpip mbox: 32
I (3548) wifi_init: udp mbox: 6
I (3548) wifi_init: tcp mbox: 6
I (3558) wifi_init: tcp tx win: 5744
I (3558) wifi_init: tcp rx win: 5744
I (3568) wifi_init: tcp mss: 1440
I (3568) wifi_init: WiFi IRAM OP enabled
I (3578) wifi_init: WiFi RX IRAM OP enabled
I (3578) phy_init: phy_version 912,d001756,Jun  2 2022,16:28:07
I (3628) wifi:mode : softAP (68:b6:b3:ac:31:2d)
I (3628) wifi:Total power save buffer number: 16
I (3628) wifi:Init max length of beacon: 752/752
I (3628) wifi:Init max length of beacon: 752/752
I (3638) wifi softAP: wifi_init_softap finished. SSID:EG1155_Assistant password:12345678 channel:1
I (3638) file_server: Starting HTTP Server
uartsend_read_XML_info
g_xml_file_read_error
uartsend_read_XML_info
VbatRsmpH==100000
I (8125128) wifi:new:<1,1>, old:<1,1>, ap:<1,1>, sta:<255,255>, prof:1
I (8125128) wifi:station: 42:a3:bf:4c:c2:d3 join, AID=1, bgn, 40U   
I (8125158) wifi softAP: station 42:a3:bf:4c:c2:d3 join, AID=1
I (8126378) esp_netif_lwip: DHCP server assigned IP to a station, IP is: 192.168.4.2
W (8126778) wifi:<ba-add>idx:2 (ifx:1, 42:a3:bf:4c:c2:d3), tid:0, ssn:14, winSize:64
return http_resp_dir_html!
return http_resp_dir_html!
I (9760938) file_server: Requested URI: /favicon.ico
I (9762358) file_server: Requested URI: /favicon.ico
return icon!
return http_resp_dir_html!
I (9763948) file_server: Requested URI: /favicon.ico
return icon!
I (10151578) wifi:station: 42:a3:bf:4c:c2:d3 leave, AID = 1, bss_flags is 658531, bss:0x3fcb437c
I (10151578) wifi:new:<1,0>, old:<1,1>, ap:<1,1>, sta:<255,255>, prof:1
W (10151578) wifi:<ba-del>idx
I (10151578) wifi softAP: station 42:a3:bf:4c:c2:d3 leave, AID=1
I (10230878) wifi:new:<1,1>, old:<1,0>, ap:<1,1>, sta:<255,255>, prof:1
I (10230878) wifi:station: 42:a3:bf:4c:c2:d3 join, AID=1, bgn, 40U
I (10230908) wifi softAP: station 42:a3:bf:4c:c2:d3 join, AID=1
I (10231118) esp_netif_lwip: DHCP server assigned IP to a station, IP is: 192.168.4.2
W (10231808) wifi:<ba-add>idx:2 (ifx:1, 42:a3:bf:4c:c2:d3), tid:0, ssn:14, winSize:64
I (10366608) wifi:station: 42:a3:bf:4c:c2:d3 leave, AID = 1, bss_flags is 658547, bss:0x3fcb437c
I (10366608) wifi:new:<1,0>, old:<1,1>, ap:<1,1>, sta:<255,255>, prof:1
I (10366618) wifi softAP: station 42:a3:bf:4c:c2:d3 leave, AID=1
I (10394878) wifi:new:<1,1>, old:<1,0>, ap:<1,1>, sta:<255,255>, prof:1     
I (10394878) wifi:station: 42:a3:bf:4c:c2:d3 join, AID=1, bgn, 40U
I (10394918) wifi softAP: station 42:a3:bf:4c:c2:d3 join, AID=1
I (10395098) esp_netif_lwip: DHCP server assigned IP to a station, IP is: 192.168.4.2
I (10396138) esp_netif_lwip: DHCP server assigned IP to a station, IP is: 192.168.4.2
W (10396768) wifi:<ba-add>idx:2 (ifx:1, 42:a3:bf:4c:c2:d3), tid:0, ssn:14, winSize:64
W (11211828) wifi:<ba-del>idx
W (11214648) wifi:<ba-add>idx:2 (ifx:1, 42:a3:bf:4c:c2:d3), tid:0, ssn:1238, winSize:64
I (11215818) wifi:station: 42:a3:bf:4c:c2:d3 leave, AID = 1, bss_flags is 658531, bss:0x3fcb437c
I (11215818) wifi:new:<1,0>, old:<1,1>, ap:<1,1>, sta:<255,255>, prof:1     
W (11215818) wifi:<ba-del>idx
I (11215818) wifi softAP: station 42:a3:bf:4c:c2:d3 leave, AID=1

ChenWen
Posts: 16
Joined: Tue Jun 29, 2021 6:29 am

Re: ESP32-C3 SoftAP模式下的连接问题

Postby ChenWen » Thu Sep 14, 2023 9:48 am

手机熄屏后断开与 AP 之间的连接,如果手机没有主动发送解除关联的报文,则设备端 ESP32-C3 作为 softap 不会有其他打印,只有等到默认 300s 之后才会解除当前 STA 的认证,由于之前关联认证的信息在 softap 端没有被清除,在此期间(300s 以内)手机可能连不上 softap,可以通过 esp_wifi_set_inactive_time 配置超时时间;
手机如果主动发送解除关联的报文,则设备端 ESP32-C3 作为 softap 会打印:

Code: Select all

I (11215818) wifi softAP: station 42:a3:bf:4c:c2:d3 leave, AID=1
贴的 log 有这个打印;

Who is online

Users browsing this forum: No registered users and 68 guests