[request] Example with deep sleep / sleep

reaper7
Posts: 25
Joined: Fri Oct 24, 2014 7:26 pm

[request] Example with deep sleep / sleep

Postby reaper7 » Fri Oct 31, 2014 7:04 pm

Please give some example for standalone application with maximum power save mode
(without additional mcu which can control CH_PD).

For example ESP check some GPIOs, send their condition via TCP or UDP
and goes to sleep for the next eg 15mins.

regards!

Her Mary
Posts: 537
Joined: Mon Oct 27, 2014 11:09 am

Re: [request] Example with deep sleep / sleep

Postby Her Mary » Thu Nov 06, 2014 9:53 am

Do you mean "system_deep_sleep" ? it is used in device sensor.

jackon
Posts: 28
Joined: Thu Oct 23, 2014 9:05 am

Re: [request] Example with deep sleep / sleep

Postby jackon » Thu Nov 06, 2014 10:52 am

reaper7 wrote:Please give some example for standalone application with maximum power save mode
(without additional mcu which can control CH_PD).

For example ESP check some GPIOs, send their condition via TCP or UDP
and goes to sleep for the next eg 15mins.

regards!


For eg, go to deep sleep for 15 mins.

Code: Select all

system_deep_sleep(15*60*1000*1000);

If the time is reached, system will restart.

reaper7
Posts: 25
Joined: Fri Oct 24, 2014 7:26 pm

Re: [request] Example with deep sleep / sleep

Postby reaper7 » Thu Nov 06, 2014 2:11 pm

If the time is reached, system will restart.


restart like after command system_restart() ??
or only return to normal work?

costaud
Posts: 138
Joined: Fri Oct 24, 2014 7:40 pm

Re: [request] Example with deep sleep / sleep

Postby costaud » Thu Nov 06, 2014 7:03 pm

SLEEP:
1.After going into deep_sleep, the chip close all network connection and mcu except RTC module ,and current consumption is about 10-15uA.
2.When time-up , the chip reload program from spi flash, the whole procedure looks like a hardware reset.

WAKE-UP:
1.Stand alone mode: (GPIO16 HAS TO BE CONNECTED TO THE rstb PIN)
The gpio16(pin name:XPD_DCDC) ,different from other gpio pins, is inside the RTC module. So it can still work during deep-sleep.
RTC timer will trigger the gpio16, and then trigger the reset signal to wake up the chip.
2.Co-work with MCU
trigger the rstb to wakeup......

reaper7
Posts: 25
Joined: Fri Oct 24, 2014 7:26 pm

Re: [request] Example with deep sleep / sleep

Postby reaper7 » Thu Nov 06, 2014 7:37 pm

@costaud - tnx for the clarification!

Fadi
Posts: 13
Joined: Mon Oct 27, 2014 9:48 am

Re: [request] Example with deep sleep / sleep

Postby Fadi » Fri Nov 07, 2014 11:57 pm

Thanks for the clarification indeed.
Is there a way to get deep sleep to resume the main loop/instructions after it wakes up? or is this limitation/action by design since everything shuts down, it has to wake up and
load from flash as a hard reset.

thanks

Fadi
Posts: 13
Joined: Mon Oct 27, 2014 9:48 am

Re: [request] Example with deep sleep / sleep

Postby Fadi » Sat Nov 08, 2014 12:09 am

would it be possible to wake up from DeepSleep via external interrupt and not RTC timeout?

Quoting the specs PDF (which was translated I believe)
"DEEP_SLEEP: Only RTC is powered on – the rest of the chip is powered off. Recovery memory of RTC can keep basic Wi-Fi connecting information.
SLEEP: Only the RTC is operating. The crystal oscillator is disabled. Any wakeup events (MAC, host, RTC timer, external interrupts) will put the chip into the WAKEUP state."

Meaning, other than driving the RSTB pin as an external interrupt, can we use normal interrupts or not.

Thanks

owendelong
Posts: 6
Joined: Mon Jul 20, 2015 9:02 pm

Re: [request] Example with deep sleep / sleep

Postby owendelong » Mon Jul 20, 2015 9:22 pm

There are several wake modes one can use with Deep Sleep.

I am wondering if there is a way to use wake mode WAKE_RF_DISABLED to delay powering up the wifi chip while I initialize and gather data from several sensors (takes several seconds), then power up the WiFi chip when I want to later in the software, without doing another sleep cycle and losing the contents of volatile RAM (since this undoes my data acquisition).

Thanks in advance!

Who is online

Users browsing this forum: No registered users and 0 guests