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.
Modem Sleep: Is there any callback?
-
- Posts: 76
- Joined: Tue Sep 12, 2017 11:25 am
Re: Modem Sleep: Is there any callback?
Hi, according to esp32_technical_reference_manual_en. pdf is only possible in light sleep mode, table pag 616:
Greeting5. 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.
Re: Modem Sleep: Is there any callback?
I assume light sleep is the modem sleep mode where wifi wakes up for beacon transmission at predetermined interval.Nespressif wrote:Hi, according to esp32_technical_reference_manual_en. pdf is only possible in light sleep mode, table pag 616:
Greeting5. 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.
Now is there a way to know this interval timing so that my webserver task can sleep/wakeup accordingly?
Re: Modem Sleep: Is there any callback?
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.
-
- Posts: 76
- Joined: Tue Sep 12, 2017 11:25 am
Re: Modem Sleep: Is there any callback?
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.
if someone who knows more helps you.
-
- Posts: 1
- Joined: Tue Oct 26, 2021 6:08 am
Re: Modem Sleep: Is there any callback?
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.
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: shovnik2000 and 119 guests