Not Connecting to Blynk Cloud My project always restart the connection

Hi everyone, I like to make projects using ESP8266, but last night I encountered a very confusing problem, namely the connection to blynk always restarts by itself and wdt cause 4 (3,6) appears, is there a solution for the case I’m experiencing?

Hardware : ESP8266 V3 LUA
Smartphone : Android 12
Blynk Server
Blynk Library version :

15:43:36.306 ->  /____/_/\_, /_//_/_/\_\
15:43:36.306 ->         /___/ v1.1.0 on ESP8266
15:43:36.353 -> 
15:43:36.353 ->  #StandWithUkraine    https://bit.ly/swua
15:43:36.399 -> 
15:43:36.399 -> 
15:43:36.399 -> [4702] Connecting to blynk.cloud:80
15:43:36.632 -> [5052] Ready (ping: 294ms).
15:43:44.835 -> ⸮T[72] Connecting to Jangan nyambung ini virus
15:43:49.446 -> [4575] Connected to WiFi
15:43:49.446 -> [4575] IP: 192.168.172.236
15:43:49.446 -> [4575] 
15:43:49.446 ->     ___  __          __
15:43:49.493 ->    / _ )/ /_ _____  / /__
15:43:49.539 ->   / _  / / // / _ \/  '_/
15:43:49.539 ->  /____/_/\_, /_//_/_/\_\
15:43:49.587 ->         /___/ v1.1.0 on ESP8266
15:43:49.635 -> 
15:43:49.635 ->  #StandWithUkraine    https://bit.ly/swua
15:43:49.682 -> 
15:43:49.682 -> 
15:43:49.682 -> [4703] Connecting to blynk.cloud:80
15:43:50.066 -> [5196] Ready (ping: 430ms).
15:43:58.111 -> ⸮u[71] Connecting to Jangan nyambung ini virus
15:44:02.699 -> [4574] Connected to WiFi
15:44:02.699 -> [4575] IP: 192.168.172.236
15:44:02.746 -> [4575] 
15:44:02.746 ->     ___  __          __
15:44:02.746 ->    / _ )/ /_ _____  / /__
15:44:02.794 ->   / _  / / // / _ \/  '_/
15:44:02.841 ->  /____/_/\_, /_//_/_/\_\
15:44:02.841 ->         /___/ v1.1.0 on ESP8266
15:44:02.888 -> 
15:44:02.888 ->  #StandWithUkraine    https://bit.ly/swua
15:44:02.935 -> 
15:44:02.935 -> 
15:44:02.935 -> [4703] Connecting to blynk.cloud:80
15:44:03.267 -> [5169] Ready (ping: 405ms).

My Sketch Code :

#define BLYNK_TEMPLATE_ID "TMPLntha3-Ff"
#define BLYNK_DEVICE_NAME "TA NEW"

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



char auth[] = "ktLPyvBUscWxmlV9zRZVmRXSAmMYahdw";//Enter your Auth token
char ssid[] = "Jangan nyambung ini virus";
char pass[] = "";

BlynkTimer timer;

// Define the component pins
#define trig D7
#define echo D8
#define LED1 D0
#define LED2 D3
#define LED3 D4
#define LED4 D5
#define LED5 D6
#define relay D1

//Enter your tank max value(CM)
int MaxLevel = 30;

int Level1 = (MaxLevel * 75) / 100;
int Level2 = (MaxLevel * 65) / 100;
int Level3 = (MaxLevel * 55) / 100;
int Level4 = (MaxLevel * 45) / 100;
int Level5 = (MaxLevel * 35) / 100;

void setup() {
  Serial.begin(9600);
  pinMode(trig, OUTPUT);
  pinMode(echo, INPUT);
  pinMode(LED1, OUTPUT);
  pinMode(LED2, OUTPUT);
  pinMode(LED3, OUTPUT);
  pinMode(LED4, OUTPUT);
  pinMode(LED5, OUTPUT);
  pinMode(relay, OUTPUT);
  
  Blynk.begin(auth, ssid, pass, "blynk.cloud", 80);


  Serial.print("Water level");

  Serial.print("Monitoring");
  delay(4000);


  //Call the functions
  timer.setInterval(100L, ultrasonic);
}

//Get the ultrasonic sensor values
void ultrasonic() {
  digitalWrite(trig, LOW);
  delayMicroseconds(4);
  digitalWrite(trig, HIGH);
  delayMicroseconds(10);
  digitalWrite(trig, LOW);
  long t = pulseIn(echo, HIGH);
  int distance = t / 29 / 2;

  int blynkDistance = (distance - MaxLevel) * -1;
  if (distance <= MaxLevel) {
    Blynk.virtualWrite(V0, blynkDistance);
  } else {
    Blynk.virtualWrite(V0, 0);
  }
  
  Serial.print("WLevel:");

  if (Level1 <= distance) {
    Serial.print("Very Low");
    digitalWrite(LED1, HIGH);
    digitalWrite(LED2, LOW);
    digitalWrite(LED3, LOW);
    digitalWrite(LED4, LOW);
    digitalWrite(LED5, LOW);
    digitalWrite(LED5, LOW);
    digitalWrite(relay, LOW);
    
  
  } else if (Level2 <= distance && Level1 > distance) {
    Serial.print("Low");
    Serial.print("      ");
    digitalWrite(LED1, HIGH);
    digitalWrite(LED2, HIGH);
    digitalWrite(LED3, LOW);
    digitalWrite(LED4, LOW);
    digitalWrite(LED5, LOW);
    digitalWrite(relay, LOW);
    
  } else if (Level3 <= distance && Level2 > distance) {
    Serial.print("Medium");
    Serial.print("      ");
    digitalWrite(LED1, HIGH);
    digitalWrite(LED2, HIGH);
    digitalWrite(LED3, HIGH);
    digitalWrite(LED4, LOW);
    digitalWrite(LED5, LOW);
    digitalWrite(relay, LOW);
  } else if (Level4 <= distance && Level3 > distance) {
    Serial.print("High");
    Serial.print("      ");
    digitalWrite(LED1, HIGH);
    digitalWrite(LED2, HIGH);
    digitalWrite(LED3, HIGH);
    digitalWrite(LED4, HIGH);
    digitalWrite(LED5, LOW);
    digitalWrite(relay, LOW);
  } else if (Level5 >= distance) {
    Serial.print("Full");
    Serial.print("      ");
    digitalWrite(LED1, HIGH);
    digitalWrite(LED2, HIGH);
    digitalWrite(LED3, HIGH);
    digitalWrite(LED4, HIGH);
    digitalWrite(LED5, HIGH);
    digitalWrite(relay, HIGH);
  }
}

//Get the button value
BLYNK_WRITE(V1) {
  bool Relay = param.asInt();
  if (Relay == 1) {
    digitalWrite(relay, LOW);
    Serial.print("Motor is ON ");
  } else {
    digitalWrite(relay, HIGH);
    Serial.print("Motor is OFF");
  }
}

void loop() {
  Blynk.run();//Run the Blynk library
  timer.run();//Run the Blynk timer
}

Pleas Help Me

@andhika_pratama21 Please edit your post, using the pencil icon at the bottom, and add triple backticks at the beginning and end of your code and your serial output so that they display correctly.
Triple backticks look like this:
```

Copy and paste these if you can’t find the correct symbol on your keyboard.

Pete.

ok, thanks for the information. for my problem above, is there a solution?, it’s been almost 2 days I’ve been looking for a solution but can’t find it too

I don’t see that in the serial output that you’ve posted.

Your ping times are very high…

what sort of internet connection are you using?
Have you tried rebooting your router?

Do you really need to take a measurement every 100ms?
Does the problem improve if you make this 1,000ms or 10,000ms?

Is there a reason why you’re specifying the server url and port?

Pete.

This is the cause 4 (3,6) from my project

16:02:59.044 -> 
16:02:59.044 ->  ets Jan  8 2013,rst cause:4, boot mode:(3,6)
16:02:59.044 -> 
16:02:59.044 -> wdt reset
16:02:59.044 -> load 0x4010f000, len 3460, room 16 
16:02:59.044 -> tail 4
16:02:59.044 -> chksum 0xcc
16:02:59.044 -> load 0x3fff20b8, len 40, room 4 
16:02:59.044 -> tail 4
16:02:59.044 -> chksum 0xc9
16:02:59.044 -> csum 0xc9
16:02:59.044 -> v00046a80
16:02:59.044 -> ~ld
16:02:59.138 -> 

the smartphone hotspot connection that I use, and for my smartphone it has been restarted and tried to compare it with other devices but still can’t

I tried to compare, if using the url and port by not using at all whether it will produce the same result or not

This tells us nothing without understanding when and where it occurs in relation to other serial messages regarding the connections and disconnections from Blynk.

That is most likely the cause of your problem.
Try your device with a proper internet connection.

But my question was why?

Pete.

for serial monitor display that displays WDT reset it is at 115200 baudrate


for display at 9600 baudrate only displays

 16:19:37.977 ->   / _  / / // / _ \/  '_/
16:19:38.025 ->  /____/_/\_, /_//_/_/\_\
16:19:38.072 ->         /___/ v1.1.0 on ESP8266
16:19:38.072 -> 
16:19:38.072 ->  #StandWithUkraine    https://bit.ly/swua
16:19:38.120 -> 
16:19:38.120 -> 
16:19:38.120 -> [4703] Connecting to blynk.cloud:80
16:19:38.308 -> [5012] Ready (ping: 254ms).
16:19:46.543 -> ⸮t[70] Connecting to Jangan nyambung ini virus
16:19:51.162 -> [4573] Connected to WiFi
16:19:51.162 -> [4574] IP: 192.168.172.236
16:19:51.208 -> [4574] 
16:19:51.208 ->     ___  __          __
16:19:51.208 ->    / _ )/ /_ _____  / /__
16:19:51.255 ->   / _  / / // / _ \/  '_/
16:19:51.303 ->  /____/_/\_, /_//_/_/\_\
16:19:51.303 ->         /___/ v1.1.0 on ESP8266
16:19:51.350 -> 
16:19:51.350 ->  #StandWithUkraine    https://bit.ly/swua
16:19:51.397 -> 
16:19:51.397 -> 
16:19:51.397 -> [4702] Connecting to blynk.cloud:80
16:19:51.589 -> [5023] Ready (ping: 267ms).
16:19:59.903 -> ⸮[71] Connecting to Jangan nyambung ini virus
16:20:04.441 -> [4574] Connected to WiFi
16:20:04.441 -> [4575] IP: 192.168.172.236
16:20:04.441 -> [4575] 
16:20:04.441 ->     ___  __          __
16:20:04.488 ->    / _ )/ /_ _____  / /__
16:20:04.536 ->   / _  / / // / _ \/  '_/
16:20:04.536 ->  /____/_/\_, /_//_/_/\_\
16:20:04.584 ->         /___/ v1.1.0 on ESP8266
16:20:04.633 -> 
16:20:04.633 ->  #StandWithUkraine    https://bit.ly/swua
16:20:04.633 -> 
16:20:04.633 -> 
16:20:04.633 -> [4703] Connecting to blynk.cloud:80
16:20:05.062 -> [5240] Ready (ping: 475ms).

and I’m confused as to where my error is when writing commands to the project I created

if it’s because the connection from my smartphone is too far to connect to the blynk cloud, I will try tomorrow with a wifi connection from the data center in my office, with the hope that the connection is more stable and the ping is not too far away, thanks for the ping problem that is too far I hope this is correct and can be solved

from several sources that I’ve been looking for, showing to solve the problem by adding the url and port and I tried, until in the end it didn’t solve the problem either sir

and this haisl I did a comparison with a better wifi device

Then change your sketch to initialise your Serial port at 115200 instead of 9600…

That might won’t work, as your office firewall may block the ports and protocols used by Blynk.

This usually only works if the person has made the mistake of not putting the BLYNK_TEMPLATE_ID and BLYNK_DEVICE_NAME definitions at the very top of their sketch, or their ISP’s DNS service is resolving the wrong Blynk cloud server - but in this case the location subdomain prefix for the server is required in the url.
Doing what you’ve done simply creates other potential issues.

Pete.

after changing the baudrate and deleting the url and port, the results are still the same sir, the ping is fine, but the connection to the blynk cloud can’t be done, what should I do

whether my esp8266 nodeMCU has been damaged?
but when I try to test with the blynk code with the LED on the esp8266 component normally lights up

how can i find the subdomain of the server location and how to write the command code example in the project i created?

What happens if you remove all of the physical connections to your NodeMCU, except for the USB cable?

You don’t need to do that, as you aren’t having the type of error that would be solved by that.

Pete.

hi. did you solve? i’m still stuck with the demo program and an unconnected esp8266 board

@alllllllldo id suggest that you create a new “need help with my project” topic and carefully read the information that is expected of you, then provide this information along with as much additional information as possible.

Pete.