High variance in wifi reconnects

neilyoung
Posts: 4
Joined: Sat Jan 07, 2017 7:55 am

High variance in wifi reconnects

Postby neilyoung » Wed Jan 11, 2017 4:48 am

Hi,

I'm noticing a very high variance for the time it needs to reconnect to a known network. It is sometimes done in 3 secs, but it can also take 15 secs, 30 secs or 9 secs, completely unpredictable.

What I'm doing in a loop is:

1) Scan and upload
2) Go to forced MODEM_SLEEP for around 30 secs
3) Wake up and restart from 1)

The transmission is always done within several milliseconds, but the reconnect to the wifi network is what concerns me, because it makes the entire cycle completely unpredictable.

While watching the output of Serial.setDebugOutput(true) I see endless sequences like this, which repeat in a second interval:


f r0, scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 0 (29)
reconnect
f 0, scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 0 (29)


What does state: 3 -> 0 (29) mean? It seems to be a fallback to DISCONNECTED, but what means 29?

What can I do against this?

ESP_Faye
Posts: 1646
Joined: Mon Oct 27, 2014 11:08 am

Re: High variance in wifi reconnects

Postby ESP_Faye » Fri Mar 24, 2017 1:39 pm

Hi,

Can wifi_set_event_handler_cb help you? Event EVENT_STAMODE_GOT_IP means that ESP8266 station connects to the router successfully.

Thanks for your interest in ESP8266!

Who is online

Users browsing this forum: No registered users and 60 guests