-->
Page 1 of 1

Deep Sleep cause break after wakeUp

PostPosted: Wed Jan 18, 2017 2:12 pm
by grad
I have NodeMcu Esp8266 version 1.0

I want to set a deepSleep for a x seconds...

This is my code

Code: Select all
const int SLEEP_DELAY_IN_SECONDS = 3;



void setup() {
  Serial.begin(115200);
  Serial.println();

}

void loop() {
  Serial.println("hello world");
  ESP.deepSleep(SLEEP_DELAY_IN_SECONDS * 1000000, WAKE_RF_DEFAULT);
  delay(1000);

}


but, this code doesn't work!

When the NodeMcu wakeUp at the second time, I get an error...
Code: Select allsld��|�c�o ��l�"|���2��|cl�p��no�lNN��� cp��$rlsl�r�n�c�oBp�


I've searched in google and I've found this: gpio 16 must be connected to ch_pd!
Well, I am a software developer and not a electronic engeneer... Can you tell me which of the NodeMcu pins is the ch_pd?
Thanks a lot


grad

Re: Deep Sleep cause break after wakeUp

PostPosted: Wed Jan 18, 2017 5:50 pm
by martinayotte
CH_PD is sometime named EN. Don't wired it directly, use a 470R, otherwise you won't be able to update firmware while module is sleeping because GPIO16 is stronger than external reset.

Image

Re: Deep Sleep cause break after wakeUp

PostPosted: Sat Jan 21, 2017 8:17 pm
by grad
Perfect!! Thank you so much! I solved!