ESP32 Wifi Station Modem Sleep Delay

gatisp
Posts: 19
Joined: Thu May 26, 2016 11:49 am

ESP32 Wifi Station Modem Sleep Delay

Postby gatisp » Wed Sep 20, 2017 9:00 pm

Does anyone known why esp32 wifi lib enables modem sleep only after some time the connection to ap is made?

I am observing about 4-5s delay before modem begins to be turned off - see attached image - 1 sec per horizontal division, 100mA per vertical division.

Is there any way to make the modem sleep to kick in sooner?

See image:
https://pasteboard.co/GLidkQW.png
Image

ESP_igrr
Posts: 2072
Joined: Tue Dec 01, 2015 8:37 am

Re: ESP32 Wifi Station Modem Sleep Delay

Postby ESP_igrr » Fri Sep 22, 2017 4:43 am

This was (is) a feature which made its way from the ESP8266, which had cases of packet loss in modem sleep mode early on, which caused some cases of lost DHCP replies, which in turn caused longer times until IP was obtained. On the ESP32 it seems to be unnecessary. We do have a work in progress branch which removes this extra delay, it should be available in master along with the upcoming frequency switching implementation.

gatisp
Posts: 19
Joined: Thu May 26, 2016 11:49 am

Re: ESP32 Wifi Station Modem Sleep Delay

Postby gatisp » Fri Sep 22, 2017 7:13 am

Thanks for the info ESP_igrr, sounds promising!

If the power save mode causes trouble with some APs, there could be another wifi sta connection parameter that controls this behaviour (the power save delay). Or even better - an API that allows to dynamically switch from "allow power save" to "radio always on" (there always is possibility not to use power save when it is successfully negotiated).

Thank you, hope this lands in the master soon.

gatisp
Posts: 19
Joined: Thu May 26, 2016 11:49 am

Re: ESP32 Wifi Station Modem Sleep Delay

Postby gatisp » Tue Jan 16, 2018 7:43 pm

Any news on this?

Still observing long delay on ESP32 in station mode after connect to AP before modem sleep kicks in...

ESP_igrr
Posts: 2072
Joined: Tue Dec 01, 2015 8:37 am

Re: ESP32 Wifi Station Modem Sleep Delay

Postby ESP_igrr » Wed Jan 17, 2018 2:56 pm

Could you please quantify "long"? Once the station is connected to the AP, there shouldn't be much of a delay.

gatisp
Posts: 19
Joined: Thu May 26, 2016 11:49 am

Re: ESP32 Wifi Station Modem Sleep Delay

Postby gatisp » Wed Jan 17, 2018 7:42 pm

By long I mean 3+ seconds. See attached image - more than 3 secs (1second per horizontal division)

This is compiled with current esp32 sdk head (1c3dd23fe0c547c5cdcd6a01c111145c572dab91)
Attached sdkconfig as used in app.
Attachments
sdkconfig.txt
(10.89 KiB) Downloaded 1018 times
modemsleep.jpg
1sec per horizontal division
modemsleep.jpg (5.55 MiB) Viewed 8651 times

Who is online

Users browsing this forum: Bing [Bot] and 46 guests