-
Notifications
You must be signed in to change notification settings - Fork 13.3k
ESP.deepSleep not able to wake up device #5892
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
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: |
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? |
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. |
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: But when i forget the connection from D0 to RST this happens: 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.. |
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. |
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 ! |
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 have a 3.3v from MCP1700, 1000uF and 0.1nF capacitor from VCC to GND. (input 3xAA Batteries) To connect the reset we try... 1-Connect Reset to GPIO16 with wire Debbug: AI ESP8266 12-F (WORKING) ets Jan 8 2013,rst cause:2, boot mode:(3,6) load 0x4010f000, len 1384, room 16 ResetInfo.reason = 5: Deep-Sleep Wake ets Jan 8 2013,rst cause:2, boot mode:(3,6) load 0x4010f000, len 1384, room 16 ResetInfo.reason = 5: Deep-Sleep Wake Espressif ESP8266 12-F (NOT WORKING) ets Jan 8 2013,rst cause:2, boot mode:(3,6) load 0x4010f000, len 1384, room 16 ResetInfo.reason = 5: Deep-Sleep Wake ets Jan 8 2013,rst cause:2, boot mode:(3,6) Please any help!? |
Hi petrilloa, |
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. |
Same Problem. I purchased 10 of these guys. So far 3 are functional and 4 are not. I literally just plug them into the same breadboard location and load the exact same sketch. I stuck an oscilloscope on the D0 pin and noted the working boards do drop all the way to 0 whereas the broken ones do not. |
I updated my platformio framework and its packages (framework-arduinoespressif8266) and now I'm facing this issues 😢 , but if I revert everything to 2018-12-03, |
@devimc, that's interesting. I assumed it was my hardware so I bought from a different vendor and its started working. |
I have a Lolin Nodemcu v3 and have same issue as described. Will enter deep sleep but will not come out. Interestingly, it is drawing around 72ma when running, then around 250ua when in deep sleep. After it attempts to wake up, I can see the on board led flash, it uses around 36ma. My guess is as other has mentioned it wakes into flash state. I also find that I have to press the reset button twice to wake it from deep sleep. I can also need to ground RST twice to exit deepsleep. I also captured D0 output on oscilloscope and can see it seems to be correctly grounding to trigger the reset, but as mentioned, if reset needs to happen twice, then it's not going to work. Easiest fix seems to be getting new hardware that supports deepsleep properly. |
have a look at #6007 |
Hello ! I am having this exact problem with my Amica NodeMCU Esp8266. Has anyone found a solution for this or I must change my board? How do I know my board's version ? And which ones dont have this problem? thank you in advance |
@magc2806 in my case I purchased a WeMos ESP8266 D1 Mini and there was no problem. My problem was with the Lolin Nodemcu v3 but I can't comment on other boards. |
Same issue with the "xxxxMOD" Version. 12F is running perfectly smooth. |
I am revisiting two, or three, batches of ESP12's from 2019'ish. Some work after deepsleep, some do not. Double resets do work, but... the first reset ends badly with high power consumption (33 mA). Sadly, my QC is sloppy and I have several protypes on several boards from several purchased batches. And with 16 surface mounts these chips do not come off the PCB nicely. Testing, testing, testing... so important. |
I also noted the same. When I use deep sleep for 1h with a powerbank as power supply it never wake up. |
did you check that it is not the powerbank that shuts down and hinders the esp to wake up? |
I have now double checked while connecting to debugging computer for more than an hour. Trying to reduce it to 30 minutes now! Below is the code example and output
Output
|
Seems like 30 minutes should work for you. I think the max sleep time is a bit over 35 minutes. The technicals (2^31) are discussed here. Maybe your powerbank as mentioned by Schufti? A multimeter should show you if that is the problem. |
Here is another fun story. He found that by swapping to a different ESP it solved his sleep problem. |
As a side note. It's wasnt the powerbank but the esp when configuring it to approximately 1 hour. When setting up to 30 min deep sleep and wake up works so far with the powerbank But shouldn't it be a 64bit range with newest API? |
I have just landed here from Google and it was the powerbank that would allow the ESP-07S to deepsleep. After testing with a phone charger and 2xAA it worked. |
Can confirm this behaviour with some implementations of ESP8266MOD on a Wemos D1 Mini clone. Trying on a NodeMCU (ESP-12F) worked, so it does look like, while frustrating and somewhat incomprehensible, different hardware implementations affect the correct functioning of deepSleep mode. For anyone else facing this issue, try a different hardware implementation. Edit: it appears this is a known issue for D1 Mini's:
|
@jtauscher Thanks! This fixed the issue. |
do yourself a favour and use the technically correct method to connect rst and gpio16: |
Hi @5chufti can you please elaborate? how will it improve flashing and wakeup experience? (I'm brand new to electronics and super interested to learn...) |
a) with hard link, external reset circuitry will 99.9% fail to reset ESP module (has to work against "strong HIGH" from gpio16 , so automatic flashing from IDE will work at all. with diode, both cases are solved electronically correct and compatible with 99.9% modules encountered. |
I don't think a diode will solve this issue. It's not a problem of RST or GPIO16. |
there are modules with "suboptimal" internal circuitry on rst (RC network) which react erratically to the reset signal from gpio16 as allready discovered and discussed on gh in history. They suffer due to misshaped (thus shortened) pules on rst. Even this might improve with any action to keep pulse (edge) in shape! |
For my experience the pulse is too short or not "low enough". So maybe you are right but still I don't understand how a diode would help. With the additional R at GPIO7 it simply helps to get a decent LOW at RST. It worked for me on 2 modules so far. So it seems to be the simplest and yet reliable solution. |
I really can't see how a pull-up on gpio7 can improve the timing related to gpio16/rst. p.s.: and it most likely is no new problem, there have been lots of reports on "zombie mode" in former days of esp hype. |
Hi @mikegron, |
@5chufti I tried the Schottky diode (GPIO16 to RST), it did not cure my wake from sleep issue, but it does allow programming without having to remove the link. |
Hi, p.s.: if it ain't reset properly with a direkt link, the diode won't fix it. The diode just is a more compatible (and technically correct) replacement for an "average resistor" that makes reset and reprogramming flakey. |
Yes that's the conclusion I came to but where to get the genuine ones from? I guess it has to have the espressif logo or AI logo to be genuine? The ones I had were neither see attached, but the eBay seller ad showed the AI logo. And yet I see photos of faulty ones in this thread with the espressif logo on, maybe the clones just copy the logo?
Sent from TypeApp
…On 29 Sep 2024, 8:31 am, at 8:31 am, "G.H." ***@***.***> wrote:
Hi,
as I learned from others who had similar problems and disected their
modules, there are some modules with incompatible circuitry (rc
combination) at the reset pin that needs longer reset pulse than the
gpio16 provides. This could only be "fixed" by an additional monoflop
that costs more money and battery power than a new known good ESP8266
...
--
Reply to this email directly or view it on GitHub:
#5892 (comment)
You are receiving this because you commented.
Message ID: ***@***.***>
|
depending on your needs, you could try sth like esp8266 D1 mini pro where all components are discrete (no module) and superfluous parts on reset could be removed. |
Yes I tried the discrete D1 mini version and it wakes from sleep OK, but takes 110uA in sleep when powered from 3.3volts. I was hoping for much less with an esp8266 -12. I might try to remove redundant components or find some genuine esp8266's. It's a shame the market is probably flooded with fakes, most users would not realise if they don't use sleep.
Sent from TypeApp
…On 29 Sep 2024, 9:07 pm, at 9:07 pm, "G.H." ***@***.***> wrote:
depending on your needs, you could try sth like esp8266 D1 mini pro
where all components are discrete (no module) and superfluous parts on
reset could be removed.
Or maybe spend some more money and go for some reputable vendors on
ebay or amazon.
--
Reply to this email directly or view it on GitHub:
#5892 (comment)
You are receiving this because you commented.
Message ID: ***@***.***>
|
unfortunately a logic analyser is not a proper tool for this kind of problem as it will not show the ramp on the rst signal. p.s.: all this is not related to the problem with improper load / incompatible flash ic (?) on sd_d0 fixed with resistor as shown several entries above... |
Another weird thing I noticed, manual RST (button, but pin as well) works every second attempt, no idea why, So if i use my code, it fails at the first try and doesn't work further, but if I push a button it actually resets only for one more iteration etc. |
I've got five of these NodeMCU 8266. One of them works with the ESP.deepSleep() as it should. The other four won't, they do what they should do as long as I do not try deepSleep. Can't figure out why. |
A note for those still looking for an answer to this. Background: Troubleshooting:
After breaking out the oscilloscope, I made the following observations:
I ran the same program (running deepSleep for 3 seconds over and over) on the NodeMCU and used it's GPIO16 to drive both the NodeMCU RST pin and the ESP-12F RST pin simultaneously.
Solution (but not rationale): I hope this helps anyone else coming across this issue! |
Basic Infos
Platform
Settings in IDE
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
Debug Messages
The text was updated successfully, but these errors were encountered: