Esp32 and local server didn't work

In the beginning, I looked a lot at the topics and did not find a solution to my problem
I started connecting to the local server with command prompt C:\Users\abdal\Desktop\blynk>java -jar blynk.jar -dataFolder C:\Users\abdal\Desktop\blynk\

Blynk Server 0.41.12 successfully started.
All server output is stored in folder 'C:\Users\abdal\Desktop\blynk\.\logs' file.
Your Admin url is https://192.168.1.112:9443/admin
Your Admin login email is admin@blynk.cc
Your Admin password is admin

I entered this link https://192.168.1.112:9443/admin and it opened without problems
Then from the phone I registered with a new account and changed to custom server and put this IP 192.168.1.112 port 9443
After logging in, the device appeared on Local Server
Then I took Auth And confirmed its authenticity And put it in the code

#define BLYNK_PRINT Serial
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
#include <DHT.h>


char auth[] = "295FE16smljNCU5aMt0kIWGVBIYvmMvy";
char ssid[] = "MAX";
char pass[] = "YallA11295467";

#define DHTPIN 13   


#define DHTTYPE DHT11     // DHT 11
DHT dht(DHTPIN, DHTTYPE);
BlynkTimer timer;

void sendSensor()
{
  float h = dht.readHumidity();
  float t = dht.readTemperature(); 

  if (isnan(h) || isnan(t)) {
    Serial.println("Failed to read from DHT sensor!");
    return;
  }
  Blynk.virtualWrite(V5, h);
  Blynk.virtualWrite(V6, t);
}

void setup()
{
  Serial.begin(9600);
  //Blynk.begin(auth, ssid, pass, "blynk-cloud.com", 80);
  Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,112), 8080);
  dht.begin();
  timer.setInterval(1000L, sendSensor);
}

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

But the problem is that the device is already connected to the Wi-Fi network but writes in the app Wasn't online yet
using : server-0.41.12.jar / arduino 1.8.12
So what is the problem

What does your serial monitor say?

What happens if you turn on Blynk debugging?

Pete.

1 Like
[2568420] Login timeout
[2570420] Connecting to 192.168.1.112
[2576493] Connecting to 192.168.1.112
[2579510] Login timeout
[2581510] Connecting to 192.168.1.112
[2584529] Login timeout
[2586529] Connecting to 192.168.1.112
[2589542] Login timeout
[2591542] Connecting to 192.168.1.112
[D][WiFiGeneric.cpp:337] _eventCallback(): Event: 0 - WIFI_READY
[D][WiFiGeneric.cpp:337] _eventCallback(): Event: 2 - STA_START
[D][WiFiGeneric.cpp:337] _eventCallback(): Event: 4 - STA_CONNECTED
[D][WiFiGeneric.cpp:337] _eventCallback(): Event: 7 - STA_GOT_IP
[D][WiFiGeneric.cpp:381] _eventCallback(): STA IP: 192.168.1.103, MASK: 255.255.255.0, GW: 192.168.1.1

https://docs.blynk.cc/#blynk-firmware-debugging

Pete.

1 Like
[30983] Connecting to 192.168.1.112
[30990] <[1D|00|01|00] 295FE16smljNCU5aMt0kIWGVBIYvmMvy
[33992] Login timeout
[35992] Connecting to 192.168.1.112
[35998] <[1D|00|01|00] 295FE16smljNCU5aMt0kIWGVBIYvmMvy
[41000] Connecting to 192.168.1.112
[41008] <[1D|00|01|00] 295FE16smljNCU5aMt0kIWGVBIYvmMvy
[44010] Login timeout
[46010] Connecting to 192.168.1.112
[46149] <[1D|00|01|00] 295FE16smljNCU5aMt0kIWGVBIYvmMvy
[49151] Login timeout
[51151] Connecting to 192.168.1.112
[51166] <[1D|00|01|00] 295FE16smljNCU5aMt0kIWGVBIYvmMvy
[54168] Login timeout

Does your local server have an internet connection?

1 Like

I cant understand how local server have an internet connection

Is your local server a PC or is it a Raspberry Pi?

1 Like

my server on pc

Make sure your PC has internet. If I understand right there is a certain point in the initializing that Blynk needs to talk to the Blynk server over the internet.

1 Like

Iā€™d also disable the firewall for a while. It might be blocking the ports used by Blynk.

Pete.

1 Like