ThingerWebConfig Reconnect

I had some issues with the webconfig. Usually when the power supply ends or for some reason the internet link down for some period of time, my nodeMCU can not connect into wifi anymore. only after restart the device. Are there some way to check if the wifi connection is working and try reconnect again?

My test code above:

[code]
#include <FS.h>
#include <ESP8266WiFi.h>
#include <DNSServer.h>
#include <ESP8266WebServer.h>
// Can be installed from Library Manager or https://github.com/tzapu/WiFiManager
#include <WiFiManager.h>
#include <ThingerWebConfig.h>

ThingerWebConfig thing;

void setup() {

// digital pin control example (i.e. turning on/off a light, a relay, configuring a parameter, etc)
thing[“led”] << digitalPin(BUILTIN_LED);

// resource output example (i.e. reading a sensor value)
thing[“millis”] >> outputValue(millis());

}

void loop() {

thing.handle();

}[/code]

You can use watchdogs. This is a security mechanism that causes a system reset in case it has been blocked. It consists of a timer that will continuously decrement a counter, initially with a high value. If the program fails or locks, when the guarddog counter can not be updated to its start value, it will decrease to zero and the system will be reset.

Check out wdt.h library

good luck! Bye!

I thought in some thing like that. check every 10 min if the wifi connection is Ok. But I do not know with command to check the wifi state.

Any more comment?

Hi that may help you:

 #include <ESP8266WiFi.h>
 #include <ThingerWifi.h>
 #include <Ticker.h>
 Ticker SecondTick;

ThingerWifi thing("×××××", "××××", "××××××");

byte WTDcount=0;
void ISRwatchdog()
{
  WTDcount++;
  if(WTDcount>4)
  {
    
    delay(100);
    ESP.reset();
  }
  }

void setup() {

SecondTick.attach(1,ISRwatchdog);
 

   thing.add_wifi("×××××", "×××××××");

    
  }

void loop()
{
  WTDcount=0;
  thing.handle();
}

CHECK OUT ANDREAS SPIESS VIDEO: Esp watchdog

wow! thanks a lot! I will try and let you know

Worked!!! thank you so much!