Handling WiFi power-save after WiFi on/off #10586
danalvarez
started this conversation in
Question - Community Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In my application, I have turned off the WiFi power-save feature because it was causing erroneous readings in my GPIO 36 (see #4903). This worked fine before when I had the WiFi module always on, but now I am going to turn the WiFi on and off programatically.
How should I handle the power-save in this case? I had initially thought of calling
WiFi.setSleep(false)
after each call toWiFi.begin()
, but looking at the implementation of the setSleep function, I see that it first checks if thesleepType
has changed. Since in my case it never changes,setSleep
only does something the very first time it is called. Each subsequent call does nothing.Is this OK? Can I assume that the power-save configuration is mantained even after I have turned the WiFi off and back on again?
Beta Was this translation helpful? Give feedback.
All reactions