Problem connecting to Blynk Cloud

i have same issue to

#define BLYNK_PRINT Serial

int relay1       = 5;
int relay2       = 18;
int relay3       = 19;
int relay4       = 21;

#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>

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

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


void setup() {
  pinMode(relay1, OUTPUT);
  pinMode(relay2, OUTPUT);
  pinMode(relay3, OUTPUT);
  pinMode(relay4, OUTPUT);
  pinMode(relay1, HIGH);
  pinMode(relay2, HIGH);
  pinMode(relay3, HIGH);
  pinMode(relay4, HIGH);
  Serial.begin(115200);

  delay(10);
  Serial.print("Connecting to ");
  Serial.println(ssid);

  WiFi.begin(ssid, pass);
  int wifi_ctr = 0;
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }

  Serial.println("WiFi connected");

Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,29), 8080);

}

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

Please edit your post and add triple backticks at the beginning and end of your code so that it displays correctly.
Triple backticks look like this:
```

Pete.

I’m sorry, I don’t understand

Copy the triple backticks from my post.
Click the pencil icon at the bottom of your first post.
After the line that says ”i have same issue to” insert a blank line and paste the triple backicks on to it.
Scroll down to the bottom of your code and insert a blank line then post the triple backticks onto this line as well.
Save your edit.

Pete.

like that.?

This line of your code:

is attempting connect to a local server at 192.168.1.29

The original post in this thread was about an issue connecting to one of the Blynk cloud servers, not a local server.

Exactly what error message are you getting in the serial monitor (copy and paste it, and use triple backticks for that as well.

Pete.

I connect it to my router, it always “Login Timeout”
but when I connect it to my Phone Hotspot it always work

is there something wrong?

I try to connect Blynk Server, the result is always same

20:06:51.177 -> Connecting to Mbh jasno
20:06:51.757 -> ........WiFi connected
20:06:55.279 -> [4133] Connecting to Mbh jasno
20:06:55.279 -> [4134] Connected to WiFi
20:06:55.279 -> [4134] IP: 192.168.1.4
20:06:55.279 -> [4134] 
20:06:55.279 ->     ___  __          __
20:06:55.279 ->    / _ )/ /_ _____  / /__
20:06:55.279 ->   / _  / / // / _ \/  '_/
20:06:55.279 ->  /____/_/\_, /_//_/_/\_\
20:06:55.279 ->         /___/ v0.6.1 on ESP32
20:06:55.279 -> 
20:06:55.279 -> [4143] Connecting to blynk-cloud.com:80
20:07:00.292 -> [9144] Connecting to blynk-cloud.com:80
20:07:19.699 -> [28575] Connecting to blynk-cloud.com:80
20:07:28.102 -> [36970] Connecting to blynk-cloud.com:80
20:07:35.411 -> [44284] Connecting to blynk-cloud.com:80
20:07:41.509 -> [50351] Login timeout
20:07:43.487 -> [52351] Connecting to blynk-cloud.com:80
20:07:47.579 -> [56445] Login timeout
20:07:49.576 -> [58445] Connecting to blynk-cloud.com:80
20:07:57.192 -> [66065] Connecting to blynk-cloud.com:80
20:08:03.868 -> [72736] Connecting to blynk-cloud.com:80
20:08:07.701 -> [76566] Login timeout
20:08:09.722 -> [78566] Connecting to blynk-cloud.com:80

I don’t think that this serial output was created by the code that you’ve posted.

Pete.

You are right, the code link to a local server :rofl:

I’m also unsure why he’s doing WiFi.begin, then using Blynk.begin rather than Blynk.connect, but clearly nothing to do with the original topic, so I’ve moved it to a new topic.

Pete.

1 Like

[Unformatted code removed by moderator]

Sorry for last time, I didnt notice that. But now I still stuck with same issue, please help

Once again, you’ve used the wrong characters to format your code, so it has been removed.
The difference between how correctly formatted code looks in your post compared to unformatted code is fairly obvious, so when you you look at the preview, or after you’ve hit the Post/Reply button, you should look to see if you’ve done it correctly.

If you can’t find the correct key on your keyboard then just copy’paste the characters that I’ve previously provided for you.

Pete.

1 Like

int relay1       = 5;
int relay2       = 18;
int relay3       = 19;
int relay4       = 21;

#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>

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

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

void setup() {
  pinMode(relay1, OUTPUT);
  pinMode(relay2, OUTPUT);
  pinMode(relay3, OUTPUT);
  pinMode(relay4, OUTPUT);
  pinMode(relay1, HIGH);
  pinMode(relay2, HIGH);
  pinMode(relay3, HIGH);
  pinMode(relay4, HIGH);
  Serial.begin(115200);

  delay(10);
  Serial.print("Connecting to ");
  Serial.println(ssid);

  WiFi.begin(ssid, pass);
  int wifi_ctr = 0;
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }

  Serial.println("WiFi connected");

  Blynk.begin(auth, ssid, pass);

}

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

I’m sorry sir

So what is the difference between this code and your previous code?
You’re still doing the WiFi.begin stuff, which is unnecessary with Blynk.begin, and your screenshot of the serial monitor tells only half the story (copying and pasting, using triple backticks again, is much better than screenshots.

BTW, the triple backticks need to be on a line of their own to work correctly, otherwise you lose the first line of code.

Pete.

So what should I do? I’m sorry, I’m still newbie at this sir. Please forgive me

Please help me