-
Is there anything special recommended before doing a "deepsleep()" on an esp32? Currently I'm just doing a short normal sleep, to allow the wifi to finish it's transmission (without it, it often doesn't complete). sleep(0.5)
deepsleep() I've also seen this recommended before deep sleeping: wlan.disconnect()
wlan.active(False)
wlan.deinit() Supposedly to get the wifi to completely shut down before the deep sleep, otherwise it continues to draw more power than necessary. Is that still the case with the latest MicroPython and the esp32? Any advice is appreciated, thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 16 replies
-
Where did you find
I will try with 1.25 If you don't do any wifi calls in your code and go to deepsleep, what current do you measure? |
Beta Was this translation helpful? Give feedback.
-
According to that, the user must shutdown wifi and bluetooth before deepsleep. From my experience, if I go into deepsleep without shutting down the wifi, wifi will often work just fine after resume, but sometimes the wifi does not reinitialise correctly after resume from deepsleep. |
Beta Was this translation helpful? Give feedback.
-
I've had my esp32's running for awhile now. So far, it seems the 2,000 mAh LifePO4 batteries are lasting about 24 days. Most of the time is spent in deep sleep, with it waking up a few, or several, times a day when a sensor is triggered to transmit a short tcp message over wifi. So that's about 3.5 mA drain, on average. I notice the red LED holds out about an extra day after it stops transmitting messages. |
Beta Was this translation helpful? Give feedback.
Unless you are using Li-ion and fairly accurately measuring voltages on the steep part of the curves, ie 4.0 and 3.0Volts and using the same cell I think you asking too much. A DVM with 1mA DC current resolution is reasonable indication. People use a current measuring module, INA219 https://awesome-micropython.com/#current to get reasonable results.
I have been working with the ESP32 WiFi for a few years now and I am not aware that there is anything else required to shut the WiFi down than: