BLYNK
BLYNK.IO       πŸ“² GETTING STARTED       πŸ“— DOCS       πŸ‘‰ SKETCH BUILDER

Fix time when disconnect Blynk 2.0

Can Blynk 2.0 modify the reconnection time?

when the wifi is disconnected, keep running in the loop until the specified time is reached before reconnecting.

1 Like

If you write your sketch using Blynk.config and Blynk.begin, and manually manage your WiFi connection, then it’s possible - just as it was with Blynk Legacy.

Pete.

Hello
Try this

void connection_check(){
  if(Blynk.connected() == true){                // if blynk is connected
    digitalWrite(blynk_connect_pin, HIGH);      // connected led turned on
    digitalWrite(blynk_disconnect_pin, LOW);    // disconnected led turned off
    Serial.println("Blynk Connected");}         //

  else if(Blynk.connected() == false){               // if blynk is not connected
    Serial.println("Reconnecting...");          //
    digitalWrite(blynk_connect_pin, LOW);       // connected led turned off
    digitalWrite(blynk_disconnect_pin, HIGH);   // disconnected led turned on
  }
}

@Huzefamaz1 please edit your post, using the pencil icon at the bottom, and add triple backticks at the beginning and end of your code so that it displays correctly.
Triple backticks look like this:
```

Pete.

1 Like