ESP.deepSleep not able to wake up device
Basic Infos
- [X] This issue complies with the issue POLICY doc.
- [X] I have read the documentation at readthedocs and the issue is not addressed there.
- [X] I have tested that the issue is present in current master branch (aka latest git).
- [X] I have searched the issue tracker for a similar issue.
- [X] If there is a stack dump, I have decoded it.
- [X] I have filled out all fields below.
Platform
- Hardware: ESP-12E (NodeMCU v3)
- Core Version: stable release (2.5.0)
- Development Env: Arduino IDE
- Operating System: Windows
Settings in IDE
- Module: NodeMCU 1.0 (ESP-12E)
- Flash Mode: ?
- Flash Size: 4MB
- lwip Variant: v2 Lower Memory
- Reset Method: ?
- Flash Frequency: 40Mhz
- CPU Frequency: 80Mhz
- Upload Using: SERIAL (usb)
- Upload Speed: 115200
Problem Description
I'm trying to make deep sleep work as intended. I made a very simple sketch that just sleeps for 30 seconds. I've attached a wire from D0 to the RST pin so that the deep sleep timer could reset the board. I am connected/powered via USB.
After the specified time, a LOW signal is correctly sent to the D0 pin as the device write the boot information but nothing else is happening afterward, I have to unplug the power or manually reset the board with the reset button. I tested with 115200 or 74880 bauds if that makes a difference, to see the boot info which is in 74880.
My board is setup exactly like this: ESP8266 Deep Sleep with Arduino IDE
Sketch
void setup() {
Serial.begin(74880);
Serial.setTimeout(2000);
while (!Serial) { }
Serial.println("Started.");
delay(5000);
Serial.println("Going to sleep.");
ESP.deepSleep(30e6);
}
void loop() { }
Debug Messages

try putting a delay(10) after the ESP.deepSleep()
Looking at the log messages this is working correctly. Deep sleep does not continue from the sleep, it starts with setup again. It’s basically a reset. If you have data you want to persist then you need to use RTC memory or flash. EDIT:Ok I failed to read the annotations on the log. Forget I commented. :-/
Hmm if I remove the cable from D0 to RST I still have the "ets Jan..." message so I guess this is printed on wake and not when receiving a reset signal. I tried resetting "manually" by hooking RST to ground and that works, I still have the same boot message but the board starts properly. So maybe D0 simply does not send the wake (LOW) signal??
I use the following pin configuration for DO:
pinMode(D0, WAKEUP_PULLUP);
In addition instead of a direct connection from DO to RST I use a Schottky Diode (preferred) or a 680Ohm resistor.
I recommend closing this issue
Setting the pin to WAKEUP_PULLUP did not change the behaviour unfortunately. Could you tell me why would adding a resistor between D0 and RST fix that? Also as a test, setting D0 to INPUT made the board go in a reset loop (so it looks like it can work).
Wake up pin is Nodemcu pin D0 which is 8266 pin GPIO16. You are referring to GPIO_0 , this is not the Wakeup pin! Check your wiring and pin assignment: https://randomnerdtutorials.com/esp8266-deep-sleep-with-arduino-ide/ Without a resistor or diode the wiring from D0 to RST should be removed during flashing the module. In my opinion Nodemcu V3 modules have a high quiescent current. I use e.g. Wemos D1 mini which has a low dropout voltage regulator for battery applications.
My bad for referring to GPIO_0, indeed I meant D0 (GPIO_16), I used the same exact link you posted (I also linked it in the problem description)
Pictures just to be sure:
It looks like the board is waking up in flash mode somehow, same as if I hold the flash button at the same time as the reset button. Although I did try setting D3 (GPIO 0) and D4 (GPIO 2) as INPUT_PULLUP, or attaching a cable from 3.3V to D3 (to make sure it's high). I have no ideas now..
Are you physically resetting the board after flashing over serial?
Yeah, I also tried using a power supply, same result :/
I tried with a Nodemcu 0.9 (ESP12) module and the connection from DO to RST, and you sketch works: 17:00:32.789 -> ets Jan 8 2013,rst cause:2, boot mode:(3,6) 17:00:32.789 -> 17:00:32.789 -> load 0x4010f000, len 1384, room 16 17:00:32.789 -> tail 8 17:00:32.789 -> chksum 0x2d 17:00:32.789 -> csum 0x2d 17:00:32.789 -> v951aeffa 17:00:32.789 -> ~ld 17:00:32.857 -> Started. 17:00:37.853 -> Going to sleep. 17:01:06.604 -> 17:01:06.604 -> ets Jan 8 2013,rst cause:2, boot mode:(3,6) 17:01:06.604 -> 17:01:06.604 -> load 0x4010f000, len 1384, room 16 17:01:06.639 -> tail 8 17:01:06.639 -> chksum 0x2d 17:01:06.639 -> csum 0x2d 17:01:06.639 -> v951aeffa 17:01:06.639 -> ~ld 17:01:06.706 -> Started. 17:01:11.687 -> Going to sleep.
But when i forget the connection from D0 to RST this happens: 17:01:45.529 -> Going to sleep. 17:02:14.316 -> 17:02:14.316 -> ets Jan 8 2013,rst cause:5, boot mode:(3,6) 17:02:14.316 -> 17:02:14.316 -> ets_main.c
So from my point of view there might be something with your board or the board description in Arduino for the ESP12E module is wrong.
Thank you for testing! There is probably something wrong with the board you're right.. I checked the pins (with nothing else connected) with a multimeter and I find the measures odd: The RST pin always stays at 3.3V. When running, the D0 pin is at 0V. When sleeping, the D0 pin is at 3.3V. When waking up, the D0 pin is set to 0V continuously. However, to wake the board with the RST pin, I need to set it to 3.3V -> 0V -> 3.3V. For instance, connecting RST to ground does not reset the board, but removing the connection will reset it. But, disconnecting the D0 pin while it's at 0V does not have the same effect (like if 0V was not gound). Do you see anything wrong with that?
Hm measuring dynamic signals with a multimeter where typically a logic analyser, a scope, or at least a logic tester is required is not more than a bad guess. I think you should look around for other using Nodemcu V3 with Deep Sleep. I have described what I was able to test (in addition Wemos D1 mini works well with DS, too). And so far I cannot see that there is something wrong with this Arduino release for 8266. As explained earlier: maybe the board description needs an update for this specific board. I would look for the schematics of this board to check, set the board in the Arduino GUI to to generic 8266 and set each option manually. If you are not able to do this, go and take a 8266 board that is proven to work.
Ok so I tested the exact same sketch with a Wemos D1 R1 and it worked perfectly... I'm gonna close this issue and try to figure out what is wrong with the NodeMcu v3 ! Thanks a lot for your help.
To me that is an old version where the reset circuit does prevent the pulse form gpio16 to be recognized correctly. The new nodemcus have a different layout with one free (not assembled) resistor location to bridge when using deep sleep
I have a similar issue with a bunch of ESP12F from Espressif. We build more than 100 sensors with ESP12F from AI, and doesn´t have any problem to wake up from deep sleep, GPIO16 direct connection to RESET. With the new batch, the factory send us ESP8266MOD (phisically looks the same as the old ones, and justo like an ESP12F), but trying a simple sketch to wake up, the devices hangs until we press reset.
We have a 3.3v from MCP1700, 1000uF and 0.1nF capacitor from VCC to GND. (input 3xAA Batteries) GPIO15 pulldown with 10k GPIO0 pullup with 10k GPIO2 pullup with 10k
To connect the reset we try...
1-Connect Reset to GPIO16 with wire 2-Connect Reset to GPIO with 330 ohms resistor 3-Connect Reset to GPIO with Diode (normal and schottky).
Debbug:
AI ESP8266 12-F (WORKING)
ets Jan 8 2013,rst cause:2, boot mode:(3,6)
load 0x4010f000, len 1384, room 16 tail 8 chksum 0x2d csum 0x2d v951aeffa ~ld Chip ID: 276350
ResetInfo.reason = 5: Deep-Sleep Wake . I'm awake. Going into deep sleep for 3 seconds
ets Jan 8 2013,rst cause:2, boot mode:(3,6)
load 0x4010f000, len 1384, room 16 tail 8 chksum 0x2d csum 0x2d v951aeffa ~ld Chip ID: 276350
ResetInfo.reason = 5: Deep-Sleep Wake . I'm awake. Going into deep sleep for 3 seconds
Espressif ESP8266 12-F (NOT WORKING)
ets Jan 8 2013,rst cause:2, boot mode:(3,6)
load 0x4010f000, len 1384, room 16 tail 8 chksum 0x2d csum 0x2d v951aeffa ~ld Chip ID: 6198051
ResetInfo.reason = 5: Deep-Sleep Wake . I'm awake. Going into deep sleep for 3 seconds
ets Jan 8 2013,rst cause:2, boot mode:(3,6)
Please any help!?
Hi petrilloa, that is sad! Try to get schematics for both boards and compare them. Beside the GPIO16 and reset I would check the SPI flash connection.
There is a custom PCB, with a bare ESP12F. Si there is not diff schematics.
Same board, Lolin NodeMCU v3. Exactly the same issue. I've got 3 of the same board, and they all exhibit the same behaviour described here.