espressif / ESP8266_RTOS_SDK

Latest ESP8266 SDK based on FreeRTOS, esp-idf style.
http://bbs.espressif.com
Apache License 2.0
3.31k stars 1.57k forks source link

wifi: bcn_timout,ap_probe_send_start (GIT8266O-533) #956

Open iam-jd opened 4 years ago

iam-jd commented 4 years ago

Environment

Development Kit: ESP8266 IDF_Version : 9f37d69 Development Env: [Make] Operating System: [Windows] Power Supply: [USB]

Problem Description

I have a problem with WiFi Connection in ESP8266. After making success connection with a wifi router and got IP address from I often see the log from wifi module as bcn_timwout,ap_probe_send_start and WiFi connection failed to Respond correctly.

Debug Logs

D (31479) tcpip_adapter: if0 dhcpc cb
D (31480) tcpip_adapter: if120 ip unchanged
D (31481) tcpip_adapter: ip:192.168.1.13,mask:255.255.255.0,gw:192.168.1.1

E:AC 1, 100, 203
WDEVTXQ_CONF(0):00007007,WDEVTXQ_PLCP0(0):c162986c
I (191081) wifi: bcn_timout,ap_probe_send_start

D (1031354) system_event: SYSTEM_EVENT_STA_DISCONNECTED, ssid:WIFI_ROUTER, ssid_len:8, bssid:XX:XX:XX:XX:XX:XX, reason:200 (beacon timeout)
D (1031371) event: running post WIFI_EVENT:5 with handler 0x40265070 on loop 0x4010719c
D (1031384) tcpip_adapter: if0 dhcpc cb
D (1031388) tcpip_adapter: if0 start ip lost tmr: enter
D (1031395) tcpip_adapter: if0 start ip lost tmr: interval=120
D (1031404) tcpip_adapter: if0 start ip lost tmr: enter
D (1031411) tcpip_adapter: if0 start ip lost tmr: already started
D (1031420) event: running post SYSTEM_EVENT:5 with handler 0x4025b8ec on loop 0x4010719c
I (1031433) TAG: SYSTEM_EVENT_STA_DISCONNECTED
E (1031441) TAG: Disconnect reason: 200
iam-jd commented 4 years ago

More Info

The Detailed Debug messages for more clarification. I am using the MQTT protocol for communicating with the server with an SSL handshake. After a successful handshake and 2 PINGRESP certainly, the wifi produces the beacon timeout error.

Debug Logs

D (42020) MQTT_CLIENT: MQTT client_id=XXXXXXXXXXX
D (42033) MQTT_CLIENT: Core selection disabled
D (42039) esp-tls: host:XXXXXXXX: strlen 47
D (42087) tcpip_adapter: if0 dhcpc cb
D (42089) tcpip_adapter: if120 ip unchanged
D (42092) tcpip_adapter: ip:192.168.1.13,mask:255.255.255.0,gw:192.168.1.1

D (42382) esp-tls: handshake in progress...
D (51747) MQTT_CLIENT: Transport connected to mqtts://XXXXXXXX:8883
I (51753) MQTT_CLIENT: Sending MQTT CONNECT message, type: 1, id: 0000
D (51979) MQTT_CLIENT: Connected
I (51982) MQTT: MQTT_EVENT_CONNECTED
D (51984) MQTT_CLIENT: mqtt_enqueue id: 0, type=1 successful
I (51995) MQTT: sent publish successful, msg_id=53350
D (52156) MQTT_CLIENT: msg_type=4, msg_id=53350
D (52159) MQTT_CLIENT: pending_id=53350, pending_msg_count = 1
D (52162) MQTT_CLIENT: received MQTT_MSG_TYPE_PUBACK, finish QoS1 publish
I (52168) MQTT: MQTT_EVENT_PUBLISHED, msg_id=53350
D (502988) MQTT_CLIENT: Sent PING successful
D (502991) MQTT_CLIENT: PING sent
D (503036) MQTT_CLIENT: msg_type=13, msg_id=0
D (503039) MQTT_CLIENT: MQTT_MSG_TYPE_PINGRESP
D (953837) MQTT_CLIENT: Sent PING successful
D (953839) MQTT_CLIENT: PING sent
D (953922) MQTT_CLIENT: msg_type=13, msg_id=0
D (953925) MQTT_CLIENT: MQTT_MSG_TYPE_PINGRESP
I (961347) wifi: bcn_timout,ap_probe_send_start
I (963853) wifi: ap_probe_send_over, rest wifi status to disassoc
I (963857) wifi: state: 5 -> 0 (100)
D (963859) system_event: SYSTEM_EVENT_STA_DISCONNECTED, ssid:YYYYYY, ssid_len:8, bssid:XXXXXXXXXX, reason:200 (beacon timeout)
D (963876) event: running post WIFI_EVENT:5 with handler 0x40280674 on loop 0x401072f8
D (963889) tcpip_adapter: if0 dhcpc cb
D (963892) tcpip_adapter: if0 start ip lost tmr: enter
D (963900) tcpip_adapter: if0 start ip lost tmr: interval=120
D (963909) tcpip_adapter: if0 start ip lost tmr: enter
D (963916) tcpip_adapter: if0 start ip lost tmr: already started
D (963925) event: running post SYSTEM_EVENT:5 with handler 0x40264d3c on loop 0x401072f8
I (963937) AREP01: SYSTEM_EVENT_STA_DISCONNECTED
E (963945) AREP01: Disconnect reason : 200
D (963952) event: running post WIFI_USER_EVENTS:3 with handler 0x4023e158 on loop 0x401072f8
I (963965) AREP01: WIFI_STA_DISCONNECTED_EVENT:
I (963973) WiFi-STA: Discooneted WiFi: YYYYYY & reason: 200
E (963986) AREP01: /**************************/
E (963991) AREP01: Lock Enters Sleep
E (963998) AREP01: /**************************/
D (964005) system_event: SYSTEM_EVENT_STA_STOP
E (964013) TRANS_SSL: ssl_poll_read select error 113, errno = Software caused connection abort, fd = 54
E (964027) MQTT_CLIENT: Read error or end of stream
I (964038) MQTT_CLIENT: Reconnect after 10000 ms
I (964044) MQTT: MQTT_EVENT_DISCONNECTED
sky9971 commented 4 years ago

@Dineshkumar-J can you try setting the WiFi power save mode as None. After setting the wifi config, call the below method esp_wifi_set_ps(WIFI_PS_NONE); and then call wifi start esp_wifi_start();

iam-jd commented 4 years ago

@sky9971 I tried out this. But didn't short out the issues. Still, I get a beacon timeout error in the log.

DEBUG LOG

D (7256390) MQTT_CLIENT: MQTT_MSG_TYPE_PINGRESP I (7507226) wifi:bcn_timout,ap_probe_send_start I (7518795) wifi:bcn_timout,ap_probe_send_start I (7527796) wifi:bcn_timout,ap_probe_send_start I (7536799) wifi:bcn_timout,ap_probe_send_start I (7545803) wifi:bcn_timout,ap_probe_send_start I (7554806) wifi:bcn_timout,ap_probe_send_start

iam-jd commented 3 years ago

@sky9971 is there any update on this bug fixing

zheyuejiang commented 3 years ago

i meet the same problem. Is this bug fixed?