Page 1 of 1

How can I completely reset Wi-Fi and turn it on again?

Posted: Sun Apr 07, 2019 4:50 pm
by Glebiys
Hi!

I need to control the stability of the Wifi connection and reset the Wifi driver mode in case of problems with reconnection.
In the documentation, I found a way to completely stop Wifi:

Code: Select all

esp_wifi_disconnect ();
esp_wifi_stop ();
esp_wifi_deinit ();
This should completely disable Wifi and clear its configuration.
After that, I have to start the Wifi connection again. What sequence of commands can I do this?

And in general, how correct is this decision? Does it harm the ESP? If so, how can I do this correctly? My goal is high resiliency Wifi connectivity and reliable automatic reconnection in case of failure.