Modem Sleep: Is there any callback?

muhgin
Posts: 5
Joined: Thu Nov 16, 2017 7:33 am

Modem Sleep: Is there any callback?

Postby muhgin » Thu Jan 25, 2018 3:01 am

Hi,

I've searched but couldn't find much info on this.
I was wondering if the is any hook/indicator/callback that I can associate with wifi modem sleep.
My plan is to run my webserver task only when wifi is woken up by data received and to sleep when the modem sleep starts.

Thanks in advance.

Nespressif
Posts: 76
Joined: Tue Sep 12, 2017 11:25 am

Re: Modem Sleep: Is there any callback?

Postby Nespressif » Thu Jan 25, 2018 9:46 am

Hi, according to esp32_technical_reference_manual_en. pdf is only possible in light sleep mode, table pag 616:
5. To wake up the chip with a Wi-Fi or BT source, the power mode switches between the Active, Modem- and
Light-sleep modes. The CPU, Wi-Fi, Bluetooth, and radio are woken up at predetermined intervals to keep
Wi-Fi/BT connections active.
Greeting

muhgin
Posts: 5
Joined: Thu Nov 16, 2017 7:33 am

Re: Modem Sleep: Is there any callback?

Postby muhgin » Thu Jan 25, 2018 9:58 am

Nespressif wrote:Hi, according to esp32_technical_reference_manual_en. pdf is only possible in light sleep mode, table pag 616:
5. To wake up the chip with a Wi-Fi or BT source, the power mode switches between the Active, Modem- and
Light-sleep modes. The CPU, Wi-Fi, Bluetooth, and radio are woken up at predetermined intervals to keep
Wi-Fi/BT connections active.
Greeting
I assume light sleep is the modem sleep mode where wifi wakes up for beacon transmission at predetermined interval.
Now is there a way to know this interval timing so that my webserver task can sleep/wakeup accordingly?

muhgin
Posts: 5
Joined: Thu Nov 16, 2017 7:33 am

Re: Modem Sleep: Is there any callback?

Postby muhgin » Thu Jan 25, 2018 11:56 am

I mean i want to wake up webserver task only if there's a real data coming from wifi, and suspend the task after ive finished processing.

Nespressif
Posts: 76
Joined: Tue Sep 12, 2017 11:25 am

Re: Modem Sleep: Is there any callback?

Postby Nespressif » Thu Jan 25, 2018 12:00 pm

In this example https://github.com/espressif/esp-idf/tr ... power_save they talk about 10s but I don't know how to configure it, if it is possible. Although the idea would be that the chip remains in light sleep mode with the wifi active and wakes up when it receives any data.

if someone who knows more helps you.

puneeth.kvsk
Posts: 1
Joined: Tue Oct 26, 2021 6:08 am

Re: Modem Sleep: Is there any callback?

Postby puneeth.kvsk » Thu Oct 28, 2021 7:50 am

Hello,

I have an application where data is collected from sensor at certain intervals (let's say every 100ms) for sometime (let's say for 20 mins) during the day and it needs to be published.

The system needs to sleep temporarily in between sample collection (with WiFi connected, so that it doesn't have to waste power reconfiguring WiFi again) and it needs to deep sleep for the remainder of the day.

Note: I used the modem mode and initialized parameters using the API in esp-idf library. Since 1AP beacon is approximately equal to 100ms, I set the "listen_interval paramter" to the value 1.

Now using WiFi, I need to publish a message with the values obtained from sensor,
1. Everytime a new value is present AND
2. Everytime the WiFi is turned on for transmission/reception in the Modem Mode

What I tried:
I set up an alarm which will generate interrupt to set "read_sensor_value" flag every 100ms and reads the sensor value. I'm not able to understand how I can time publishing the message when this happens.

Please help. Also I'm only finding questions about receiving the messages in Modem mode but no application on transmitting messages in Modem modem.

Who is online

Users browsing this forum: Google [Bot], pmoneta and 116 guests