ESP_Alfred wrote:Npt wrote:(I tried to post in this thread a couple of days ago, apparently my comment was not approved by the moderators. I'll try one more time...)
I have encountered the same unexpected behaviour of the chip. I think we need to distinguish between two scenarios here:
(A) The ESP involuntarily loses connection to an AP (for example the AP is shut down or goes out of range).
(B) The ESP voluntarily ends the connection (wifi_station_disconnect) or never establishes a connection in the first place (wifi_station_set_auto_connect(false)).
In case of (A) I'd say it's ok if the ESP use more power in order to try to re-establish the connection. If this is not desired, it is your responsibility as the API user to stop it, maybe after a certain timeout. So in my opinion everything's fine here.
However, in situation (B) I think there's a bug in the API. You would expect that the power consumption eventually goes down after disconnecting. The opposite is the case: I measured a stable ~70mA after disconnect as opposed to ~20mA (with short spikes every 1s or so) when connected and idle.
In my application I need to do some computations on the CPU before sending the data. One would assume that it's better to do the computations offline and only connect after they're done. Turns out, the opposite is true: you have to connect to an AP to save power. That is weird and definitely a bug that Espressif should look into.
for situation (B), It's normal.
As you say : a stable ~70mA after disconnect as opposed to ~20mA (with short spikes every 1s or so) when connected and idle.
please reference to the attachment of current map.
Thanks for your reply. I agree with Npt, and consider the behavior (B) as a bug, because after the wifi_station_disconnect() call, I also called wifi_get_sleep_type() and ensure it returns "2" which refers to 'MODEM_SLEEP_T' as you suggested. My current chart still is exactly the same as your's.