WiFi Modem Sleep without connection to AP

kristaps_r
Posts: 11
Joined: Sun Jul 15, 2018 2:48 pm

WiFi Modem Sleep without connection to AP

Postby kristaps_r » Fri Jan 22, 2021 10:31 am

Hi!

I want to realize periodic transmission using esp_wifi_80211_tx() and between transmissions go to low power mode.
As far as my experiments show that modem sleep is not working in AP mode and STA mode when not connected.

Can you suggest if there is a way to enable modem sleep in unconnected STA or AP modes?

spirosbond
Posts: 4
Joined: Thu Dec 24, 2020 11:06 pm

Re: WiFi Modem Sleep without connection to AP

Postby spirosbond » Wed Mar 03, 2021 11:13 pm

I observe the same issue. Seems like modem sleep is not working after wifi_start() if there is no wifi_connect() command.
Can anyone help?

Thanks

Update1: I actually experienced very high packet loss of espnow packets if WiFi power save is set to anything but esp_wifi_set_ps(WIFI_PS_NONE). Surprisingly enough the lost packets are only unicast. The broadcast packets are received consistently.
That said, the question to have mode sleeping without being connected to a wifi is irrelevant, since in my case espnow wont work properly. Setting ps to WIFI_PS_NONE is the only way for espnow to work, so power save has to be achieved with light or deep sleep.

I am wondering why in the official espnow example they don't set the esp_wifi_set_ps(WIFI_PS_NONE). Default value is WIFI_PS_MIN_MODEM so that example shouldn't work properly either.

Update2: I found this explanation here. Seems that power save is only when connection to AP is done and that is how it is supposed to be: https://demo-dijiudu.readthedocs.io/en/ ... aving-mode
Call esp_wifi_set_ps(WIFI_PS_MODEM) to enable Modem-sleep mode after calling esp_wifi_init(). About 10 seconds after the station connects to the AP, Modem-sleep will start. When the station disconnects from the AP, Modem-sleep will stop.
related topics: viewtopic.php?t=12772
espnow official example: https://github.com/espressif/esp-idf/bl ... ple_main.c

Who is online

Users browsing this forum: No registered users and 357 guests