Help about delay when isn't connection

Dear people!

I need help about the delay when isn’t connection with the hardware,

For example in the Sketch I have timer.setInterval (1000, pisca) > the led should be blink each 1 second, ok this work normally when I have connection.

However when I lost connection and the arduino try to connect again, the blink change to 16 seconds.

In other words, I have blink of the 1 second when the arduino is connected to wifi, and isn’t connection I have 16 seconds of blink led.

If anybody can help me or reduce this difference or make a code using if(connected == true) or (connected == false) I tried to use the, bool result = blynk.connect(), but without sucess.

Below the code used;

//#define BLYNK_DEBUG
//#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
//#include SimpleTimer.h
//#include ESP8266_HardSer.h
//#include BlynkSimpleShieldEsp8266_HardSer.h

// Set ESP8266 Serial object
//#define EspSerial Serial1

ESP8266 wifi(EspSerial);
SimpleTimer timer;

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = " ";

void setup()
{
timer.setInterval(1000, blinK); // set the timer of blink
pinMode(4, OUTPUT);
// Set console baud rate
Serial.begin(9600);
delay(10);
// Set ESP8266 baud rate
EspSerial.begin(115200);
delay(10);

Blynk.begin(auth, wifi, " ", " ");
}

void loop()
{
timer.run();
Blynk.run();
}

void blinK(){
digitalWrite(4, HIGH);
delay(50);
digitalWrite(4, LOW);
}

Thanks.

Please see this topic

Ok thanks Lavan !

I tested your ideia…

Below the results;

1º Turn On the arduino, if haven’t internet the code work very well 1 second with or not internet.

2º Turn On the arduino, with internet work normally.

3º Turn On the arduino with internet, and after turn off the router to disable the internet I have 15 seconds by pulse.

Thanks by help, but not solved …