SasaKaranovic / DIY-Camera-Slider

DIY WiFi Enabled Camera Slider using ESP32
GNU General Public License v3.0
96 stars 13 forks source link

Wifi keeps disconnecting #5

Open buttim opened 2 years ago

buttim commented 2 years ago

The wifi connect loop never ends. The return value from WiFi.begin() is always 6 (WL_DISCONNECTED). I solved this issue changing the code in _DIYCameraSlider.ino like this: from WiFi_status = WiFi.begin(ssid, password);

to WiFi.begin(ssid, password); WiFi_status = WiFi.waitForConnectResult();

I found the solution here

thijstriemstra commented 1 year ago

thanks. the begin call can/should also be moved out of the while loop:

WiFi.begin(ssid, password);

while (WiFi_status != wl_status_t::WL_CONNECTED)
{
    Serial.print("Connecting to SSID: ");
    Serial.println(ssid);
    WiFi_status = WiFi.waitForConnectResult();
}