Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By torntrousers
#14204 From a bit of googling i read that calling system_deep_sleep_set_option(4) will:

"disable RF after deep sleep wake up, just like modem sleep, there will be the smallest current."
http://www.mikrocontroller.net/attachme ... v0.9.5.pdf

I gave that i try and found that on wake up an ESP-12 then uses about 12.6 milliamps, compared to the about 74 milliamps with system_deep_sleep_set_option(0).

But of course Wifi doesn't work now as its powered off. Is there any way of programmatically powering it back on without just doing another deep sleep using option 0?
User avatar
By gerardwr
#14212 There is an SDK call setting the sleeptype.

The code below shows some examples of the SDK call, and compiles and runs, but I have not tested the results.

Code: Select allSerial.println("[SDK direct] MODEM_SLEEP"); wifi_set_sleep_type(MODEM_SLEEP_T);
Serial.println("[SDK direct] LIGHT_SLEEP"); wifi_set_sleep_type(LIGHT_SLEEP_T);
Serial.println("[SDK direct] NONE_SLEEP"); wifi_set_sleep_type(NONE_SLEEP_T);


Let us know if you have any kind of success.
User avatar
By zoidicus
#20113
StarkJohan wrote:...Would be nice to be able to start the radio without another deep sleep....
Agreed. I've had some pretty good luck with deep sleep so far, storing my program state in RTC memory for the nap, but I just cannot figure out how to re-enable the modem without performing another sleep with different options. Simply calling
Code: Select allwifi_set_sleep_type(0);
(which does return 1) before initializing WiFi doesn't work.