I have an application in which I want to very occasionally start up wifi to POST some data to a remote server. I can get things going and POST the message, but am having trouble with the tear-down phase. As I read the docs, the right steps and the order in which they should be called is:
- esp_http_client_cleanup( client ); // dismiss the TCP stack
- esp_wifi_disconnect(); // break connection to AP
- esp_wifi_stop(); // shut down the wifi radio
- esp_wifi_deinit(); // release wifi resources
"wifi: esp_wifi_connect 1145 wifi not start"
Interestingly, while I can find a declaration of esp_wifi_stop() in a header file, I can not find that function in an executable (.c) file, so I can't dig into the code myself.
Can someone can tell me the correct way to tear down tcp and wifi stacks and dismiss all the resources with no memory leaks without throwing an error? That is, what functions to call and in what order?