Current Lua downloadable firmware will be posted here

User avatar
By AcmeUK
#15690 robbaker

Use system_deep_sleep() to put your esp8266 into minimal power mode.

Here is a sketch demonstrating DeepSleep :-
Code: Select all/*
Based on the example of how to call an ESP8266 SDK routine from Arduino code, posted by Bygerardwr here :-
http://www.esp8266.com/viewtopic.php?f=29&t=2228
*/

// SDK headers are in C, include them extern or else they will throw an error compiling/linking
// all SDK .c files required can be added between the { }
extern "C" {
#include "user_interface.h"
}

void setup(){
  Serial.begin(74880); // I run my sketches at 74880 so that I can see the boot time messages.
 
}

void loop()
{
   Serial.println("Hello world!");
   for (int i=10; i > 0; i--){
      Serial.println(i);
      delay(1000);
   }
 
  Serial.println("Time to sleep");
  system_deep_sleep(100000000); //sleep time in usecs 10000000 = 10 secs.
  delay(1000); // a short delay to keep in loop while Deep Sleep is being implemented.
}
User avatar
By robbaker
#15733 Thanks for the reply. However, I understand you need to conect the RST and XPD_DCDC pins for this to work, I'm using the esp-01 model and the XPD_DCDC isn't terminated. I've seen hacks where people solidered directly to the chip pin, but this isn't practical for my application.

Please let me know if the above is wrong.

Thanks
rob
User avatar
By cal
#15781
robbaker wrote:Thanks for the reply. However, I understand you need to conect the RST and XPD_DCDC pins for this to work, I'm using the esp-01 model and the XPD_DCDC isn't terminated. I've seen hacks where people solidered directly to the chip pin, but this isn't practical for my application.

Please let me know if the above is wrong.

Thanks
rob


I think you are right. I managed to get it soldered but with more luck than expertise ...

Cal