ESP8266 ESP.deepSleep not working?
Posted: Fri Feb 10, 2017 5:29 pm
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
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.
Code: Select all
void 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.