Disconenct Wifi in ESP32CAM

Hi, im trying to set Wifi in ESP32CAM reading the values from bluetooth, i would like to change the wifi settings from there, for example on the start im going to run wifi.begin(SSID,PASS), this SSID and this PASS are stored in preferences, but when the user press for 5 seconds a button it goes to configuration by bluetooth, where the user can set a new pair of SSID and PASS, the thing is i cannot use wifi.begin(ssid2, pass2) again, it doesnt connect. So i imagine that i have to "disconnect" the current Wifi, and then connect the other. I tried with wifi.disconnect() command, but doesnt work, its like i cannot use again wifi.begin. A solution is write all the time to preferences and reset the module to begin with other credentials, but i dont like that way, can you help me?

Why not use WiFi Manager instead? Then you don't have to switch from WiFi to Bluetooth then back again.

1 Like

because i made an APP, wifi manager uses a web application, its just not what im looking for.

Perhaps this then:
https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-guides/blufi.html

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