I have a firebeetle ESP32 board and I use VScode with platformIO. My platform is espressif32 v5.0.0 and the framework is arduino.

I am currently implementing a WIFI connection as follows:

bool init_wifi_STA()
    WiFi.begin(ssid, password);
    while (WiFi.status() != WL_CONNECTED)
    return true;

When I do not need WIFI anymore, I am calling the following sequence:


When I want to connect to wifi again using my init_wifi_STA() function I get the following error:

[489781][E][WiFiGeneric.cpp:1053] mode(): Could not set mode! 12289
[489781][E][WiFiSTA.cpp:227] begin(): STA enable failed!

I already found this github issue, but checking my library, it looks like the bug was removed (code section from WiFiGeneric.cpp - mentioned by the github issue):

static bool wifiLowLevelDeinit(){
        lowLevelInitDone = !(esp_wifi_deinit() == ESP_OK);
    return !lowLevelInitDone;

However, I am still getting this error. Any idea where it comes from and how to avoid it?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.