You can chat about native SDK questions and issues here.

User avatar
By LPG
#83722 I want to switch from AP mode to STA mode (i.e. from access point to client). I tried to stop wifi, reconfigure and restart. But the client is never connected, and no errors are reported either.

So as an intermediate step, I tried to stop and restart without any change of configuration. Same result: Wifi goes away and never comes back.

Code: Select allESP_ERROR_CHECK(esp_wifi_stop()); // triggers SYSTEM_EVENT_AP_STOP event
      
vTaskDelay(configTICK_RATE_HZ * 10); // 10s delay

ESP_ERROR_CHECK(esp_wifi_start()); // does nothing?


So what is the proper procedure for restarting wifi, and finally, for restarting it with a different configuration?