-->
Page 1 of 2

ESP Object

PostPosted: Sun Apr 26, 2015 2:22 pm
by Aes
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?

Re: ESP Object

PostPosted: Sun Apr 26, 2015 8:26 pm
by Davy
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.

Re: ESP Object

PostPosted: Sun Apr 26, 2015 10:14 pm
by ulumu
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
}

Re: ESP Object

PostPosted: Mon Apr 27, 2015 5:29 am
by bernd331
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