Wakeup from DeepSleep and GPIO

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Gregor54321
Normal user
Posts: 24
Joined: 14 Jan 2022, 20:15

Wakeup from DeepSleep and GPIO

#1 Post by Gregor54321 » 11 Sep 2022, 23:21

Hi all!
I modified an ESP01S (8266) with only GPIO0, GPIO2, RST, Rx, Tx, ChipEn by default connected.
I soldered additional connections to ADC/TOUT and GPIO16, so I was able watching for battery voltage and periodically waking via RST by SleepTimer.

But how can I perform different actions by pressing a button (only RST is possible?!) or SleepTimer triggered wakeup?
As far as I understud, wakeup from GPIOs is not possible from DeepSleep but only from LightSleep?

BR, Gregor

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

Re: Wakeup from DeepSleep and GPIO

#2 Post by TD-er » 11 Sep 2022, 23:30

ESP8266 can only boot from deep sleep via the RST pin.

However you may need to keep in mind that some ESP8266 boards may use a higher current in deep sleep if a node is not woken up via GPIO-16.
So you may want to check this too when you use some circuit to wake the ESP at other moments than the deep sleep period.

Gregor54321
Normal user
Posts: 24
Joined: 14 Jan 2022, 20:15

Re: Wakeup from DeepSleep and GPIO

#3 Post by Gregor54321 » 16 Sep 2022, 12:21

When woken up, is it possible to recognize the reason for wakeup event?
Hypothesis:
a) when woken up by GPIO16 timer the timers value is "0" (if decreasing for interrupt) OR timer is at or sligthly above compare-value (if increasing for interrupt)
b) timer is neither 0 nor at compare-value : wakeup initiated by other event then GPIO16-Timer.

Question: is my hypothesis true?
Request: can this be implemented? ;)

BR, Gregor

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

Re: Wakeup from DeepSleep and GPIO

#4 Post by TD-er » 16 Sep 2022, 12:24

On ESP8266 I can't think of a way right now.
On ESP32 it is possible (but not yet implemented to be used in rules) to know the "wake" reason.

User avatar
chromo23
Normal user
Posts: 827
Joined: 10 Sep 2020, 16:02
Location: germany

Re: Wakeup from DeepSleep and GPIO

#5 Post by chromo23 » 16 Sep 2022, 13:15

I made myself a wireless button a while ago with espeasy and an esp8266.
To switch two devices i added a small switch to the side for selecting the task after the esp wakes up.
It is not the best solution in terms of handling but for two tasks it works ok...
espeasybutton.jpg
espeasybutton.jpg (28.4 KiB) Viewed 2349 times

Post Reply

Who is online

Users browsing this forum: No registered users and 121 guests