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

Moderator: igrr

User avatar
By Aes
#15717 Hello,
I would like to try the power saving modes Andreas Sexauer described in the wiki:
ESP-specific APIs

APIs related to deep sleep and watchdog timer are available in the ESP object.

ESP.deepSleep(microseconds, mode) will put the chip into deep sleep. mode is one of WAKE_DEFAULT, WAKE_RFCAL, WAKE_NO_RFCAL, WAKE_RF_DISABLED.

but I have no luck to use ESP.deepSleep(). I get an compilation error and guess I miss an include. But ESP.h would not work. Am I missing something?
User avatar
By Davy
#15743 Looks like it's only in the github source. You need to download it and put it in your install
see: viewtopic.php?f=29&t=2472

Note that if you're using the esp-01 then XPD_DCDC (8) of the MCU needs to be connected to the reset pin. Like this: http://tim.jagenberg.info/files/2015/01/PTIM9823.png
It sounds like the ESP8266 will go into a deep sleep for the microseconds specified in theESP.deepSleep call and then trier a auto reset.
User avatar
By ulumu
#15749 U can always call the ESP SDK api directly...

Code: Select allextern "C" {
  #include "user_interface.h"
}


Code: Select allvoid setup()
{
...
...
...
    system_deep_sleep_set_option(0);
    system_deep_sleep(3000000);            // deep sleep for 30 seconds
}
User avatar
By bernd331
#15784 Hi,

is there a place where
system_deep_sleep_set_option(0);
is described in more detail? The 0 means that the ESP makes a reset after wake up. Is there a option to switch off/on wireless modem only?

thanks and greetings, Bernd