Disconnect and reconnect ESP8266

Thanks for your answer

I’m avoiding to call thing.handle() when thing.stop() is called, Im stoping thinger 20 seconds every 10 minutes, my code is something like:

if (comm)     //all "thing.handle()" call is in one if like this
{
thing.handle();
}

if (10min && comm) //  "10min" is kind of timer, every 10 mins this routine runs
{
thing.stop();
comm=0;
}

if (20sec && !comm) // 20sec after 10mins previous routine is called
{
comm=1;
}

I was reading about to turn off wifi in esp8266, with lightsleep, so the microcontroler will turn off wifi but it keeps running the process

I will dig a little bit more on this, if I achieve something will post here

Thanks