-->
Page 1 of 2

ESP8266 ESP.deepSleep not working?

PostPosted: Fri Feb 10, 2017 5:29 pm
by jhumphr
I've been trying to implement the deepSleep function of the ESP8266 for a few days with no avail. It goes to sleep, but never wakes up. I initially had it set at (30 * 1000000) for 30 seconds, but have continually lowered it eventually to the 5000 seen in code in order to see if I just had it too high. Here is my code

Code: Select allvoid setup() {
  Serial.begin(115200);

  // connect to wifi.
  WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
  Serial.print("connecting");
  while (WiFi.status() != WL_CONNECTED) {
    Serial.print(".");
    delay(500);
  }
  Serial.println();
  Serial.print("connected: ");
  Serial.println(WiFi.localIP());

  Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH);
  delay(1000);

  getTime();
  float temp = 0;
  DS18B20.requestTemperatures();
  temp = DS18B20.getTempCByIndex(0);
  temp = temp * 9 / 5 + 32;
  Firebase.setFloat(currentTime, temp);


  ESP.deepSleep(5000);
}



I have an error method in the main loop that writes to the same firebase database an error message if it reaches that point. Also, my Serial.print statements do not print anything in the serial monitor. I tried it in the code at 9600 and now 115200. Not even garbage data prints.

Re: ESP8266 ESP.deepSleep not working?

PostPosted: Sat Feb 11, 2017 9:57 am
by schufti
Did you connect gpio16 to rst via diode/resistor?
Try boardsearch with "deep sleep" for pages of relevat threads.

Re: ESP8266 ESP.deepSleep not working?

PostPosted: Sat Feb 11, 2017 9:58 am
by martinayotte
Beware that the wakeup is relying on GPIO16 providing reset pulse.
Did you attached GPIO16 to RES via a 470R or 1K resistor ?
(resistor is needed to prevent loosing other external reset capability)

Re: ESP8266 ESP.deepSleep not working?

PostPosted: Sat Feb 11, 2017 12:21 pm
by jhumphr
I have the ESP8266 8 pin board, with access only to Vcc, Gnd, Rst, CH_PD, TX, RX, and GPIO0 and GPIO2. Is it possible with this board?