Closed S3j5b0 closed 2 years ago
You can read on what deep sleep means here: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/system/sleep_modes.html
Basically, once you are awoken from a deep sleep, your app starts over completely from the beginning, so it is not possible to re-use anything. There are alternatives to deep sleep, but they are not as efficient. Also, not all chips support deep sleep - the riscv ones (c3) don't.
By the way, these questions would likely be addressed more efficiently by posting them in the matrix channel, as they often end up not to be issues, but a need for more info.
Hi, have, based on this example, made a little tcp client that runs on mty esp32 wroom, and exchanges some messages with my computer. The device sits there and pings my computer once in a while, with a few minutes between every message. I'm using the functions that I grabbed from the example to initialize the wifi connection, this is the
wifi
andping
function.and then before I make the tcp connection, I run these (also as given by the example)
In order to save power I thought I would try to let the device sleep in between the messages it sends, so I tried adding the
esp_deep_sleep
function, like so:This of course gives me some issues with the wifi, since it is not woken up again, and I end up with this output:
Is there any way that I can set the device to sleep, and then when it wakes up, re-access the initialized wifi?
I also tried adding the wifi initialization code below the sleep, to see if it would just recnnect:
The full code snippet is here.
So is this possible? to keep using the wifi stack after waking up from sleeping?