Cannot connect to Local Blynk server

In the serial monitor, it shows me this message over and over

Connecting to 192.168.8.102
Connecting to 192.168.8.102
Connecting to 192.168.8.102

#define BLYNK_PRINT Serial


#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[] = "zqpOHa-SxDY-gxSJO1LyioIL0ziuzTh4";
const char* ssid = "HUAWEI-7E6F";
const char* password = "f67fb1q1";
const char* mqtt_server = "192.168.8.102";
const int Led = 21;
void setup()
{
  pinMode(Led, OUTPUT); 
  // Debug console
  Serial.begin(9600);

 // Blynk.begin(auth, ssid, pass);
  // You can also specify server:
  //Blynk.begin(auth, ssid, pass, "blynk-cloud.com", 80);
  Blynk.begin(auth, ssid, password,IPAddress(192,168,8,102), 9443);
  //
}

void loop()
{
  Blynk.run();
  // You can inject your own code or combine it with other sketches.
  // Check other examples on how to communicate with Blynk. Remember
  // to avoid delay() function!
   Blynk.virtualWrite(V0, Led);
}

Why are you using port 9443?

Pete.

I have tried to use others like 8443, 8442 and 80
all of them gave me cannot find host.
beside, I won’t to use blynk local server on raspberry pi and I have done all the steps to make sure it works. I am trying to implement this scenario

As you aren’t using the SSL version of the library then the correct port would be 80 or 8080, unless you’ve gone for a non-standard port setup on your server.

Pete.

1 Like

I connect to 8080 it says can’t connect to host. then I changed to 9443 it opens. log out then log in with 8080 port says can’t connect to host.

I assume that you’re talking about the custom server settings option on the app login screen?
For this you use 9443.

Within your sketch, you would normally use 8080 or 80, so you have a problem here in your sketch:

Pete.

1 Like

It workeddddd!
Thank you a lot. You cleared the confusion I had.

1 Like