ESP won't go into Deep sleep just when GPIO16 is pulled low?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Tobi993
Normal user
Posts: 18
Joined: 08 Nov 2017, 08:03

ESP won't go into Deep sleep just when GPIO16 is pulled low?

#1 Post by Tobi993 » 28 Jul 2023, 10:24

Hello everybody,

I have here a Wemos D1 pro with a regular EasyESP SW flashed.

I configured DeepSleep in 15Sec.. WakeUp will be handelt by a transistor circuit driven by a PIR.
But the device won't go every time into Deepsleep.

Just when I pull GPIO to low, it goes every time into deepsleep.
Does anybody knows, why?

All GPIOs are configured as default

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP won't go into Deep sleep just when GPIO16 is pulled low?

#2 Post by TD-er » 28 Jul 2023, 10:56

GPIO 16 is special on the ESP8266 as it needs to be tied to the RST pin to wake from deep sleep.
Not sure if this pin actually is being monitored itself by the ESP.

Are you sure the PIR isn't doing strange things while the ESP enters deep sleep?

Tobi993
Normal user
Posts: 18
Joined: 08 Nov 2017, 08:03

Re: ESP won't go into Deep sleep just when GPIO16 is pulled low?

#3 Post by Tobi993 » 28 Jul 2023, 13:40

No, same behavior when PIR is not connected.
There must be some load at GPIO16.

Don't know why.

Problem then is, at DeepSleep Pins are High and when there's load connected I have also power comsuption.

Tobi993
Normal user
Posts: 18
Joined: 08 Nov 2017, 08:03

Re: ESP won't go into Deep sleep just when GPIO16 is pulled low?

#4 Post by Tobi993 » 28 Jul 2023, 14:34

The strange thing is, when I connect GPIO16 to RST, then it goes into deepsleep. It works, several time.

OK, when I then cut this line again and reset the board, it works! Every time it goes into deepsleep although GPIO16 isn't connected.

BUT - when I power off for a longer time and let GPIO16 open and power on, it does NOT go into deepsleep.

Maybe a kind of latch-up effect.
Means, never let GPIO16 open!

At documentation it says, connect GPIO16 to RST because of wake-up. But it seems this is also needed for sleep.

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP won't go into Deep sleep just when GPIO16 is pulled low?

#5 Post by TD-er » 28 Jul 2023, 14:55

I know the ESP8266 is a bit strange regarding deep sleep as not all ESP8266 modules act the same.
Some consume way more than the expected 60 uA in deep sleep (not taking other components on the board into account) and some need to "wake twice" or else they won't be able to connect to WiFi. (or WiFi must be explicitly turned off and on again after waking from Deep sleep, which is exactly what ESPEasy does for this exact reason)

At least the ESP12E and ESP12F modules differ in their deep sleep behavior and some Do-IOT modules also act weird regarding deep sleep.

On the tools->Advanced page is a checkbox to use a different algorithm to put the ESP into deep sleep.
Maybe your specific module can benefit from enabling this?

chemmex
Normal user
Posts: 92
Joined: 15 Feb 2019, 16:18

Re: ESP won't go into Deep sleep just when GPIO16 is pulled low?

#6 Post by chemmex » 28 Jul 2023, 17:43

I believe GPIO16 is an output internally connected to the RTC timer and affects only wakeup behaviour when connected to Reset input. ESP should go to sleep by a command regardless of what's going on with the GPIO16. Then, while sleeping, an on-off pulse to Reset pin will wake it up. So, if you use the PIR for wakeup, you should not touch the GPIO16 at all, just connect the PIR's output to the Reset of ESP. Assuming, of course, that your PIR normally outputs High level and pulses Low if an alarm is detected

Tobi993
Normal user
Posts: 18
Joined: 08 Nov 2017, 08:03

Re: ESP won't go into Deep sleep just when GPIO16 is pulled low?

#7 Post by Tobi993 » 29 Jul 2023, 09:42

No!
As I mentioned I have the same behavior without a PIR connected!
I tried it with another "regular" Wemos D1.
Same procedure. GPIO16 has to be connected to RST, otherwise it won't be go into deepsleep.

chemmex
Normal user
Posts: 92
Joined: 15 Feb 2019, 16:18

Re: ESP won't go into Deep sleep just when GPIO16 is pulled low?

#8 Post by chemmex » 03 Aug 2023, 08:49

I think something may be wrong with your module.

ESP easily falls into deep sleep with GPIO16 floating or pulled down. Proven on a bare ESP-12F module.

Second, GPIO16 in ESPEasy is an output. This means that you can connect two outputs (GPIO16 and, for instance, PIR) only if they are normally in high impedance state. Then, if they are both connected to the Reset input, whatever output goes low first will trigger the Reset and wake up the ESP.

Finally, there is no valid situation when GPIO16 can be pulled down if you ise it for wakeup. This means you are pulling down the Reset line which is nonsense.

Post Reply

Who is online

Users browsing this forum: No registered users and 27 guests