BLYNK
BLYNK.IO       📲 GETTING STARTED       📗 DOCS       👉 SKETCH BUILDER

Blynk only work with quick start

I’ve connected my esp8266 through wifi just fine using the quick start, but it doesn’t work if connecting a device created from template. when it doesn’t work it alternating between online and offline in the device page, and repeat trying to connect in the serial monitor.

Sketch (sensitive info redacted), is the same when working and when not working, except BLYNK_TEMPLATE_ID, BLYNK_DEVICE_NAME, BLYNK_AUTH_TOKEN, who I copied from the device page when creating new device from template (that’s not working) and from creating new device from quick start (working):

#define BLYNK_TEMPLATE_ID REDACTED
#define BLYNK_DEVICE_NAME REDACTED
#define BLYNK_AUTH_TOKEN REDACTED



// Comment this out to disable prints and save space
#define BLYNK_PRINT Serial


#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

char auth[] = BLYNK_AUTH_TOKEN;

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = REDACTED;
char pass[] = REDACTED;

BlynkTimer timer;


// This function is called every time the device is connected to the Blynk.Cloud
BLYNK_CONNECTED()
{
  // Change Web Link Button message to "Congratulations!"
  Blynk.setProperty(V3, "offImageUrl", "https://static-image.nyc3.cdn.digitaloceanspaces.com/general/fte/congratulations.png");
  Blynk.setProperty(V3, "onImageUrl",  "https://static-image.nyc3.cdn.digitaloceanspaces.com/general/fte/congratulations_pressed.png");
  Blynk.setProperty(V3, "url", "https://docs.blynk.io/en/getting-started/what-do-i-need-to-blynk/how-quickstart-device-was-made");
}

// This function sends Arduino's uptime every second to Virtual Pin 2.
void myTimerEvent()
{
  // You can send any value at any time.
  // Please don't send more that 10 values per second.
  Blynk.virtualWrite(V2, millis() / 1000);
}

void setup()
{
  // Debug console
  Serial.begin(9600);

  Blynk.begin(auth, ssid, pass);
  timer.setInterval(1000L, myTimerEvent);
}

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

Output when not working, repeats every 30 seconds:

[4307] Connected to WiFi
[4307] IP: 192.168.0.101
[4307] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v1.0.1 on ESP8266

[4384] Connecting to blynk.cloud:80
[4831] Redirecting to fra1.blynk.cloud:80
[4833] Connecting to fra1.blynk.cloud:80
⸮⸮⸮Ԝ[71] Connecting to REDACTED

output when working:

[4307] Connected to WiFi
[4307] IP: 192.168.0.101
[4307] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v1.0.1 on ESP8266

[4384] Connecting to blynk.cloud:80
[4831] Redirecting to fra1.blynk.cloud:80
[4833] Connecting to fra1.blynk.cloud:80
[5052] Ready (ping: 85ms).

A post was merged into an existing topic: Esp 8266 failing to connect