Page 1 of 1

How to properly clean up WiFi

Posted: Wed Feb 06, 2019 7:36 pm
by jubueche
When closing a WiFi connection, this is what I am doing:

Code: Select all

ESP_ERROR_CHECK(esp_wifi_stop());
	ESP_ERROR_CHECK(esp_wifi_deinit());
The problem is that after I call esp_wifi_stop, I disconnect and the event handler, which is still running, calls connect(), which is not possible, because we already called deinit().
Is there a way to remove the event_handler?

Do I have to deinit the nvs flash? How about the tcp/ip stack?

Thanks!

Re: How to properly clean up WiFi

Posted: Fri Feb 08, 2019 10:17 am
by jubueche
This is resolved now. But I still don't know how to disable the event handler.