Using the new Arduino IDE for ESP8266 and found bugs, report them here

Moderator: igrr

User avatar
By yuki
#13252 i found a strange problem, at some point the WIFI connection drops and the loop is not called anymore.
but the debug out from the SDK still shows messages.

i first see this on a module with is outside of me home as Temperature sensor, the wifi signal is not the best there.

how to trigger:
1. be in good range to the wifi AP
2. move away from it
3. come back (50cm away from wifi AP)

SDK messages:
Code: Select allreconnect
scandone
add 0
aid 1
pm open phy_2,type:2 0 0
cnt 
LmacRxBlk:1
LmacRxBlk:1
LmacRxBlk:1
rm match
pm close 7 0 0/3176591
LmacRxBlk:1
reconnect
LmacRxBlk:1
scandone
add 0
aid 1
pm open phy_2,type:2 0 0
cnt 
LmacRxBlk:1
LmacRxBlk:1
LmacRxBlk:1
rm match
pm close 7 0 0/3175027
LmacRxBlk:1
reconnect
scandone
add 0
aid 1
pm open phy_2,type:2 0 0
cnt 
LmacRxBlk:1
LmacRxBlk:1
LmacRxBlk:1
rm match
pm close 7 0 0/3175586
LmacRxBlk:1
reconnect
scandone
add 0
aid 1
pm open phy_2,type:2 0 0
cnt 
LmacRxBlk:1
LmacRxBlk:1
LmacRxBlk:1


router AP log:
Code: Select allApr  2 12:44:16 RS-PRO-ROUTER hostapd: wlan0-1: STA 18:fe:34:9f:b1:b7 IEEE 802.11: authenticated
Apr  2 12:44:16 RS-PRO-ROUTER hostapd: wlan0-1: STA 18:fe:34:9f:b1:b7 IEEE 802.11: associated (aid 2)
Apr  2 12:44:23 RS-PRO-ROUTER hostapd: wlan0-1: STA 18:fe:34:9f:b1:b7 IEEE 802.11: authenticated
Apr  2 12:44:23 RS-PRO-ROUTER hostapd: wlan0-1: STA 18:fe:34:9f:b1:b7 IEEE 802.11: associated (aid 2)
Apr  2 12:44:30 RS-PRO-ROUTER hostapd: wlan0-1: STA 18:fe:34:9f:b1:b7 IEEE 802.11: authenticated
Apr  2 12:44:30 RS-PRO-ROUTER hostapd: wlan0-1: STA 18:fe:34:9f:b1:b7 IEEE 802.11: associated (aid 2)
Apr  2 12:44:37 RS-PRO-ROUTER hostapd: wlan0-1: STA 18:fe:34:9f:b1:b7 IEEE 802.11: authenticated
Apr  2 12:44:37 RS-PRO-ROUTER hostapd: wlan0-1: STA 18:fe:34:9f:b1:b7 IEEE 802.11: associated (aid 2)
Apr  2 12:44:45 RS-PRO-ROUTER hostapd: wlan0-1: STA 18:fe:34:9f:b1:b7 IEEE 802.11: deauthenticated due to local deauth request
Apr  2 12:44:47 RS-PRO-ROUTER hostapd: wlan0-1: STA 18:fe:34:9f:b1:b7 IEEE 802.11: authenticated
Apr  2 12:44:47 RS-PRO-ROUTER hostapd: wlan0-1: STA 18:fe:34:9f:b1:b7 IEEE 802.11: associated (aid 2)


any ideas for this strange behavior?
User avatar
By igrr
#13253
Code: Select allLmacRxBlk:1

I may be mistaken, but it seems to indicate that there is some incoming TCP or UDP data that was received but not read by the sketch. Not sure why this leads to loop() not being called, just an observation. Could you also post the sketch you are testing?
User avatar
By yuki
#13257 ok loop is still called, but he dot that i printed by Serial.print('.'); was not send out.
wen i add Serial.flush(); it is working?

does the system printf has an conflict with the Serial.print?
do they override the TX buffer in some cases?

i also have some code like this:
Code: Select allif(!client.connected()) {
   if(!client.connect(host, port)) {
      state = SOIOs_disconnected;
   }
}

when this is called to often in the "bad signal" state then i get in to "LmacRxBlk:1" stuff.
and get never a connection again.

may the connection is not cleaned up valid if i call connect again?

i do not see and tcp_abort or tcp_close call in the stop function of the WiFiClient.