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

ESP8266 static ip, bug report

esp8266

#1
#define BLYNK_PRINT Serial    
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h> 

char ssid[] = "x";
char  pass[] = "x";
char auth[] = "x";

IPAddress server_ip (192, 168, 10, 229);


IPAddress arduino_ip (192,168,1,55);
IPAddress gateway_ip (192,168,1,1);
IPAddress subnet_mask(255, 255, 255,0);

void setup()
{
  Serial.begin(115200);
  Serial.println();
  WiFi.config(arduino_ip, gateway_ip, subnet_mask);
  WiFi.begin(ssid, pass);
  Blynk.config(auth);
  while (Blynk.connect(1000) == false) { 
  }  
}

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

Blynk v0.5.4

[19955] 

[19958] Connecting to blynk-cloud.com:80
[24959] Connecting to blynk-cloud.com:80
[29960] Connecting to blynk-cloud.com:80
[34961] Connecting to blynk-cloud.com:80
[39962] Connecting to blynk-cloud.com:80
etc…

Blynk v0.4.4

[255] 

[5001] Connecting to blynk-cloud.com:8442
[5181] Ready (ping: 1ms).


#2

And what’s the problem or bug? Are you trying to connect to your local server or cloud? As per your config you’re connecting to cloud… credentials from cloud or local server?


#3

connect to cloud
my full code have http update code block and work fine on ip 192,168,1,55 but esp not connect to blynk-cloud.com:80 with blynk library 0.5.4


#4

Can you Ping www.blynk-cloud.com and try using that IP address instead?


#5

change code to

Blynk.config(auth,"blynk-cloud.com", 8442);

not connect again

[19891]

[19894] Connecting to blynk-cloud.com:8442
[24895] Connecting to blynk-cloud.com:8442
[29896] Connecting to blynk-cloud.com:8442
[34897] Connecting to blynk-cloud.com:8442
etc…

same code with library v0.4.4 work ok


#6

Port 8442 from the device is “obsolete” now… should be port 80 for Cloud (although 8080 should also work) or 443 for Cloud SSL.

There have also been some past issues when trying to connect from within Russia… no idea if those issues still exist

Probably just carry-over backward compatibility… but having such older library will cause other compatibility issues with the App… so should always be kept current.


#7

change code to

Blynk.config(auth,"139.59.206.133", 8442);

work ok

[19760]

[19763] Connecting to 139.59.206.133:8442
[24764] Connecting to 139.59.206.133:8442
[24833] <[02|00|01|00] 701d6ad98d6926c0958046110de72242
[24891] >[00|00|01|00|C8]
[24891] Ready (ping: 57ms).
[24892] Free RAM: 48528

yes, connect from Russia


#8

by the way when i not use static ip work ok with library 0.5.4

//#define STATICIP 

#ifdef STATICIP
  IPAddress arduino_ip(192,168,1,55);
  IPAddress gateway_ip(192,168,1,1);
  IPAddress subnet_mask(255,255,255,0);
#endif

 #ifdef STATICIP
   WiFi.config(arduino_ip, gateway_ip, subnet_mask);
 #endif

#9

Sounds like something needs to be adjusted in your router settings then. Not sure how it is affected by eh library except possibly due to the port routing. But again, best to keep up with the imes else you will run into other App compatibility issues.