[SOLVED] WiFi connection information

Dear Blynk Community,
in my project I use an ESP8266 connected in wi-fi to a 3G router with embedded battery and a SIM Card. The router blocks randomly and I have to press its start button for just 1 second to let him to restart. In order to automatize this restart task, I have soldered a relay outout in parallel to the contacts of the router button and what I want to realize is small code that, when the router looses the connection, closes the relay contacts for just 1 second. It’s reaaly simple but I don’t know, within Blynk environment, which instruction to use in order to verify the router connection.
Could you, please, help me ?
Thanks in advance,

… I’m using the ESP as a WiFi shield for an Arduino Uno.

What I’m looking for is something like this:

if (! wifi.connected() )
close and open the relay

but wifi.connected() doesn’t exist. Do you know which is the equivalent instruction?

Thanks indeed!

@Gianca http://docs.blynk.cc/#blynk-firmware-connection-management

This would be 1 way. Anther one could be done via http://docs.blynk.cc/#blynk-firmware-virtual-pins-control-blynk_connected

Hi Dmitriy,
yesterday I tried with “if (! wifi.createTCP(“”, (8888))) …” and t seems to work.

But I’d implement your first suggestion that is definetely more elegant. Does it work also with a Local Blynk Server ?

Thank you very much,

Yes. It is…

Great !!
Thanks a lot !!