tzapu / WiFiManager

ESP8266 WiFi Connection manager with web captive portal
http://tzapu.com/esp8266-wifi-connection-manager-library-arduino-ide/
MIT License
6.53k stars 1.96k forks source link

Reconnect issue #1263

Open robertaonnis opened 3 years ago

robertaonnis commented 3 years ago

Basic Infos

Hardware

WiFimanager Branch/Release: Master

Esp8266/Esp32: Hardware: ESP32

Description

Problem description I have only one problem. 2 times a day my esp32 lost the connection but do not recconect again. only if i restart power.

i check and i don't have any problem on the router. only esp have this problem. but ok if this appened how can set arduino to try connection again.

i ahve try this:

#BEGIN
#include <Arduino.h>
#include <WiFiManager.h>

// include MDNS
#ifdef ESP8266
#include <ESP8266mDNS.h>
#elif defined(ESP32)
#include <ESPmDNS.h>
#endif

WiFiManager wm;
unsigned long oldtime;
unsigned int  timeout   = 120; // seconds to run for
unsigned int  startTime = millis();
bool portalRunning      = false;
bool startAP            = false; // start AP and webserver if true, else start only webserver

void setup() {
`
WiFi.mode(WIFI_STA); // explicitly set mode, esp defaults to STA+AP    
 Serial.begin(115200);// Starts the serial communication @9600
  Serial.setDebugOutput(true);
  delay(1000);

// wm.resetSettings();
 //wm.setHostname("MDNSEXAMPLE");

  wm.setConfigPortalBlocking(false);

  if(wm.autoConnect("Test", "12345678")) {
        Serial.println("connected...yeey :)");
    }
    else {
        Serial.println("Configportal running");
    }

}

void loop() {

wm.process();

{my loop here}

}

`
#END

Debug Messages

in your opinion is that I make bad the code or i loose some code?
RosmanAndrey commented 2 years ago

Same thing