Run a code without blynk connected service at first boot device

This is my ESp Sserial print :slight_smile:

[1756] Connected to WiFi
[1756] IP:

[5001] Connecting to
[11224] Connecting to
[17574] Connecting to
[23823] Connecting to
[30073] Connecting to
[36323] Connecting to

i have this Problem that at first boot the ESP after connected to network hardware search for blynk host and any code dose not capable to run!!! how can run a code at this time ???

but when hardware is coonected to host and after an error hardware will be disconnected from host my code run on disconnected hardware from host so whay this code work but at first connection does not run?
i write my code according @Costas said (Timer).

1 Like

i research again community but couldn’t fix this .

Show us the code (formatted for forum viewing) that you wrote…

Blynk - FTFC

#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

char auth[] = "AUTH";

char ssid[] = "SSID";
char pass[] = "PASS";

void setup()

  Blynk.begin(auth, ssid, pass, IPAddress(xxx,xxx,x,x), 8442);

void loop()
else {
Serial.println("Code is Running");

Try this instead:

Blynk.begin(auth, ssid, pass, "", 8442);  // The IP for your Local Server - keep the " "

Or this:

char server[] = "";  // The IP for your Local Server - keep the " "

Blynk.begin(auth, ssid, pass, server, 8442);

didn’t fix

To confirm, you are running a Local Server and this is it’s correct address?

Do you have other devices and projects running on this server?



i want run a code when device trying connect to the server.

Oh, bother… and here I was troubleshooting a connection issue :stuck_out_tongue:

Issue lost in translation I guess.

OK, to continue running your script when Blynk is NOT connected, you have to use Blynk.config() instead of Blynk.begin() along with your connection checks etc…

after disconnected device it should write some code to recoonnect again or its will be reconnected again to server?

There are a few ways of writing that code… search this forum for the terms Connection Management