WIFI stops working

Hi

I have a small project that connects to a server every 5 minutes.

It works fine, for a number of days, but all of a sudden, it looses the ability to connect or reconnect to my Wi-Fi

Only rebuilding and uploading my code with a wrong ssid/password, and then upload it again with the correct credentials makes the board connect again.

Then it works again for days or weeks, and suddenly it stops again.

Are there any trick to be able to recover after stop.

I do have a watch dog, but restarting doesn’t help

Initial wifi connection, where it loops forever:

 WiFi.begin(ssid, pass);

  while (WiFi.status() != WL_CONNECTED)
  {
    printf("Attempting to connect to SSID: ");
    printf(ssid);
    delay(10000);
  }

  printf("Connected to WiFi");

anyone?

that's some strange..
nothing wrong per say with the code you posted..
is that the reconnect code??
if yes, then maybe you need a WiFi.disconnect()??

here's how I'm handling it in my cam software..
ESP Cam Cli..

maybe gives you some ideas..

good luck.. ~q

Thanks, I will checkout your code :slight_smile:

It sounds like NVS corruption. Make sure your board has proper power all the time. You could also check with another ESP32 to rule out faulty ESP32.

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