Closed mano1979 closed 7 years ago
You need a persistent connection to the Alexa backend before you can do anything, and I don't think you can maintain a wifi connection in deep sleep. So I'd say this is not possible.
@MrBuddyCasino I think the low power 2nd cpu can keep the connection going. Though, even if not, can't the esp32 simply reconnect to the wifi and connect to the alexa server, when woken up?
Do you mean the 2nd core or the ULP coprocessor? The ULP can only do very simple tasks. Reconnecting takes a few seconds due to the SSL handshake and probably the wifi connection itself, so its not instantaneous. If you can't maintain the connection, you might as well just cut the power.
You could try deep sleep and caching the SSL session tickets for a faster reconnect, but that only makes sense if the wifi connection stays up, which would be pointless due to the energy consumption AFAIK.
Why would the wifi have to stay up? Reconnecting doesn't have to take long. Depending on the settings. Even though, a 2 second wait after pressing the button before i speak is fine by me.
I found this post that shows some settings to speed things up after a wake. https://esp32.com/viewtopic.php?f=2&t=1238
Thats faster than I thought. Feel free to implement something, if its decent code I usually accept pull requests.
I have no idea where to start. I am not a great programmer. More an engineer.
I will ask my friend to help me though. I will do a pull request when i have something interesting.
Thanks for your quick reply!
You're welcome.
Can you give me any hint on where i'd find the file that contains the script for alexa voice playback? Or any other script that is handled after the question is answered. This would be the place to implement the deep-sleep function.
Also i'm looking for the file where the buttonpress is polled. (GPIO, READ)
Thank you
Is it possible to implement deep sleep when not active? And only after button press it wakes up and listens to commands?
This would be great for battery powered esp32 alexa clients.