Disconnect and reconnect ESP8266


I have an issue with a NodeMCU esp8266, that is connected a shitty access point (sorry for the french),

The access point kicks clients without any apparent reason (even when Im connected from my phone, I see how it losses connection and connects again)

What I thought is to add a routine and disable thinger.io, by the thinger.stop() command, I thougth that will stop wifi and start it again, by the thinger.handle() command, and it will try to connect it again to network, but it doesn’t.

Someone knows how to disconnect and try to reconnect this device to a wifi network, and of course, to thinger platform without restarting it?


Hi @ega,

the stop will disconnect the device from the network. If you do not call thing.handle again, it should not connect to the network. So, please, be sure you do not call thing.handle after the thing.stop, until you are ready to connect again.


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

if (10min && comm) //  "10min" is kind of timer, every 10 mins this routine runs

if (20sec && !comm) // 20sec after 10mins previous routine is called

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