Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random stall of the gateway #19

Open
RalfWein opened this issue Oct 30, 2023 · 1 comment
Open

Random stall of the gateway #19

RalfWein opened this issue Oct 30, 2023 · 1 comment

Comments

@RalfWein
Copy link

Hi zivillian, hi all,

Unfortunaltely my "close issue" was too early.
The stall hapened several times again. But I could fix it to the Wifi connection.
If the Wifi disconnects for any reason, the ESP32 does not reconnect.
There are several discussions that this applies preferably on connections to a Fritz!Box. In my case it is a FB!
Solutions range from "cyclic reconnect" "to reboot after connection gets lost".

Ralf

@helix0712
Copy link

Hi, saw same issue. I saw the ESP32 disconnected from Wifi. Based on some research i replaced the original void loop() using below code.


void loop() {
  unsigned long currentMillis = millis();
  // if WiFi is down, try reconnecting every CHECK_WIFI_TIME seconds
  if ((WiFi.status() != WL_CONNECTED) && (currentMillis - previousMillis >=interval)) {
    Serial.print(millis());
    dbgln("Reconnecting to WiFi...");
    WiFi.disconnect();
    WiFi.reconnect();
    previousMillis = currentMillis;
  }  
}

Regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants