Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By GregryCM
#28993 I have a simple ESP8266-01 application that serves up a web page which shows the status of a switch and the amount of time that the ESP8266 has been running.

The ESP has a fixed IP address on my local LAN.

It has been running for over 260 hours, but has dropped offline for days at a time. I am surprised when it does come back online that the run time has not been restarted, which is what I would expect if a WDT reset occurred.

My loop() does not have a check of the WiFi.Status(), and server.begin() is only called in setup().

My next update to the firmware will include a test of WiFi.Status() and restart as needed, but I am curious what can seeming cause the WiFi connection to be restored without going through reset.

Thanks,
Greg
User avatar
By GregryCM
#45083 In loop(), I have the following check for connected:

Code: Select all  if( WiFi.status() != WL_CONNECTED )
  {
    delay(10);
    StartWiFiSTA();
    UtilityWiFiReconnectInc();
    return;
  }


I know the above works 'most of the time' because a counter is incremented on each reconnect.

I currently have 1 module that, via serial debug command, reports that WiFi.status() == WL_CONNECTED. The module is running fine, as the Heart Beat LED is blinking and it responds to all of the serial debug commands. If I query the network status on Win7 with arp -a command, this modules IP address does not show.

I am confident that the module will rejoin the network if I reset the module, or if I reset the LAN router.

I know that on some days, modules may reconnected 1 or 2 times, for what ever reason. I am wondering if the router can lose connection with an ESP8266 quicker than the module can detect?

Is there something that I can do at the ESP8266 module to periodically 'ping' the router to ensure that a connection is indeed valid?

Thanks,
Greg