Clever but simple way to wake esp with multlple buttons?
Posted: Sun Aug 28, 2016 11:35 pm
Hey all!
So I know this comes up every once in a while but I have yet to find a solid or concrete answer / solution, so here goes again!
In short: I want to wake a esp8266 from "deep sleep" so I can have it battery powered, but I want to do so with two individual buttons that will cause a different action to be performed depending on which was pressed. The question is how do I wake the esp8266 (CH_PD to high?) AND "tell" the esp8266 which button was pressed?
Bit more info:
I'm interested in having a battery powered esp8266. This will be a Christmas present for my little brother and sister (each will get a device). I will create a box, and I'd like it to have two buttons: Button 1, when pressed, will order a pizza and have it delivered to my parents house. Button 2 will check whether or not a pizza can be ordered at the time (I'm not rich so can't have them ordering a pizza every day!) and flash some status light to inform them one way or another (i.e. green led or red led, etc).
Waking the esp with a button press is pretty common and something I've done myself in the past, but most of the time what I've seen is that the button press simply wakes up the macihne and causes some action to be performed before cutting power and causing the eps8266 to go back to sleep. I.e. the button that was pressed isn't really being used as an input in anyway, it's just sending power to the ch_pd pin to wake the thing.
One thing I was wondering is if I could have two buttons: when pressed they would pull the ch_pd pin to high AND cause an input pin to be set high. The esp would wake and the second it woke it would read the state of the input pins. It would record the state, and once connected to wifi it would act based on the button press.
This seems "obvious", IF it worked, but I'm guessing that it may not be this simple (?).
I'm hoping to actually give this a short and do a proof of concept in the next few days or so, but I'm waiting on parts!
For now, thanks for reading and thanks for the help as always!
So I know this comes up every once in a while but I have yet to find a solid or concrete answer / solution, so here goes again!
In short: I want to wake a esp8266 from "deep sleep" so I can have it battery powered, but I want to do so with two individual buttons that will cause a different action to be performed depending on which was pressed. The question is how do I wake the esp8266 (CH_PD to high?) AND "tell" the esp8266 which button was pressed?
Bit more info:
I'm interested in having a battery powered esp8266. This will be a Christmas present for my little brother and sister (each will get a device). I will create a box, and I'd like it to have two buttons: Button 1, when pressed, will order a pizza and have it delivered to my parents house. Button 2 will check whether or not a pizza can be ordered at the time (I'm not rich so can't have them ordering a pizza every day!) and flash some status light to inform them one way or another (i.e. green led or red led, etc).
Waking the esp with a button press is pretty common and something I've done myself in the past, but most of the time what I've seen is that the button press simply wakes up the macihne and causes some action to be performed before cutting power and causing the eps8266 to go back to sleep. I.e. the button that was pressed isn't really being used as an input in anyway, it's just sending power to the ch_pd pin to wake the thing.
One thing I was wondering is if I could have two buttons: when pressed they would pull the ch_pd pin to high AND cause an input pin to be set high. The esp would wake and the second it woke it would read the state of the input pins. It would record the state, and once connected to wifi it would act based on the button press.
This seems "obvious", IF it worked, but I'm guessing that it may not be this simple (?).
I'm hoping to actually give this a short and do a proof of concept in the next few days or so, but I'm waiting on parts!
For now, thanks for reading and thanks for the help as always!