BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Never gets connected to the local server

#1

So below is my code which i was going to use for a door lock in my house , below is the code,

#define BLYNK_PRINT Serial


#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <DNSServer.h>
#include <ESP8266WebServer.h>
#include <WiFiManager.h>
#include <EEPROM.h>


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

// Your WiFi credentials.
// Set password to "" for open networks.
/*char ssid[] = "Freedom";
char pass[] = "pajik@1234";*/

void setup()
{
  EEPROM.begin(512);
  // Debug console
  Serial.begin(9600);
  WiFiManager wifiManager;
  wifiManager.resetSettings();
  wifiManager.autoConnect("NodeMcu");
  Serial.println("connected.....");
  pinMode(LED_BUILTIN,OUTPUT);
  
  Blynk.begin(auth,WiFi.SSID().c_str(),WiFi.psk().c_str(), IPAddress(xx,xxx,xx,xx), 8080);
}

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

This code uplaods successfully and it does connects to my wifi as well , but it says it keeps on connecting to my local server but never connects. anyone knows the asnwer for this issue

0 Likes

Can't Connect my device to Local server
#2

Are you thinking that it’s connected to your Wi-Fi because it says “connected…” in your serial monitor?

There seems to be quite a bit of WiFiManager code missing from the sketch to me.

Pete.

0 Likes

#3

this is what outcomes from my serial monitor ,

Connecting to Freedom
[76880] Connected to WiFi
[76880] IP: 192.168.8.108
[76880] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v0.6.0 on NodeMCU

[77010] Connecting to xx.xxx.xx.xx
[82011] Connecting to xx.xxx.xx.xx
[87012] Connecting to xx.xxx.xx.xx
0 Likes

#4

Is this what it actually says or did you mask it?? You know no one can access your LAN IP, so safe even to broadcast, as you just did with the NodeMCU’s IP :wink:

Anyhow, it is saying the correct IP? And what port are you using?

EDIT…

I think you need to set some stuff up still :smile:

0 Likes

#5

No , that’s my google cloud IP address that’s why i used those signs , anyways the port i used in the google cloud is 9443 , for the hardware i used 8080 … And the IP address which is node mcu is trying to connect is correct as well.

0 Likes

#6

Ah, OK… better to say something upfront as it literally looks like a sample setting :slight_smile:

I don’t use cloud services for my Local Server, so I may not be much help… but can you ping your Google cloud, er, Local Server IP?

0 Likes

#7

The Phone app connects just fine to port 9443 ?

if you web to “http://(mypersonal.cloud.server):8080” you get forwared to blynk.cc ?

0 Likes

#8

What happens if you try “http://(mypersonal.cloud.server):8080/dfe6363f9e624390ad666d8048f71c6b/project”

Pete.

0 Likes

#9

It did work . thanks for the time folks. I have not enabled the 8443 port in my google cloud server.

Aaron

1 Like