WiFiManager icon indicating copy to clipboard operation
WiFiManager copied to clipboard

ESP32 RECONNECT

Open PabloOyarzo opened this issue 2 years ago • 5 comments

Hi is it possible to provide a reconnect sample code?

As autoreconnect doesn't seem to be working.

Saw @tablatronix said in another issue that you check wifi status and do wifi begin again

PabloOyarzo avatar Jan 14 '23 06:01 PabloOyarzo

I think it is supposed to be working now, what are you seeing?

tablatronix avatar Jan 14 '23 12:01 tablatronix

I Haven't turned on the debug verbose, but it doesn't reconnect automatically. I'm using an ESP32, it's using the WiFi Library from arduino esp32 the latest (which is supposed to fix all reconnect issues) and wifi managers latest too. I'm testing with a hostpot right next to the esp32.

Tried it with and without autoreconnect(true).

PabloOyarzo avatar Jan 14 '23 12:01 PabloOyarzo

It works now, still would like to see that check and reconnect little snippet of code that you use please!

PabloOyarzo avatar Jan 17 '23 20:01 PabloOyarzo

Hi, yes it work now, but only one time!

Step to get the bug :

  1. Boot ESP32-S3 device
  2. ESP32-S3 device connect automaticly
  3. Cut the wifi
  4. ESP32-S3 device disconnect.
  5. Start the wifi
  6. ESP32-S3 device reconnect automaticly.
  7. Cut the wifi again.
  8. ESP32-S3 device disconnect
  9. Start the wifi again
  10. ESP32-S3 device dosn't reconnect.

The device need to be rebooted to reconnect.

code : WiFi.mode(WIFI_STA); wm.setConfigPortalBlocking(false); wm.setConfigPortalTimeout(60); wm.setBreakAfterConfig(true); wm.setWiFiAutoReconnect(true); std::vector<const char *> menu = {"wifi","wifinoscan","close","sep","erase","update","restart","exit"}; wm.setMenu(menu); // custom menu, pass vector wm.setHostname(("WM_"+wm.getDefaultAPName()).c_str()); if(wm.autoConnect("AutoConnectAP")){ Serial.println("connected...yeey :)"); } else { Serial.println("Configportal running"); }

  • vm.process(); in loop

yfrit83 avatar Feb 06 '24 03:02 yfrit83

Whats logs say?

tablatronix avatar Feb 11 '24 02:02 tablatronix