Errors when disabling SoftAP

In my application I turn of the internal hotspot of ESP32 in this way:

WiFi.mode(WIFI_MODE_AP);
WiFi.softAP(ssid, password);
WiFi.softAPConfig(local_ip, gateway, subnet);
WiFi.softAPsetHostname(ssid);
esp_wifi_set_ps(WIFI_PS_NONE);

When I need to turn it off, I tried with:

WiFi.softAPdisconnect(true)

but at run-time the following errors are raised:

E (23949) wifi_netif: esp_wifi_internal_reg_rxcb for if=1 failed with 12289
E (23951) wifi_init_default: esp_wifi_register_if_rxcb for i0f=0x3ffaf184 failed with 259

I searched on the web but I find nothing about (especially for the second one).
Instead it seems to work if I use:

WiFi.mode(WIFI_OFF);

I can live with it :laughing: but I would like to understand why the function above does not work.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.