Connecting to blynk-cloud.com:80 - Not a happy blynking :)

Hi guys,

I know this topic has been posted a zillion times, I’ve read many different posts but still have a doubt about this and need to clarify what’s the problem.

Just started to use Blynk for personal projects using nodeMCU ESP2866, hopefully for commercial use in the future.

Let’s talk about the example provided by Blynk arduino library (code below) so code is really simple.

This was my nightmare trying to connect blynk:

  • At home everything worked perfectly and straightforward. I could make ESP2866 board and blynk interact perfectly using my home network.

  • BUT When I moved the arduino board to my office (different network), I changed the ‘ssid’ and ‘pass’, re-compiled the code and tried to reconnect to blynk, but it didn’t work anymore.
    Even though serial monitor said:
    “Connected to WiFi. IP: 186.167.1.100”
    I started to get message in the serial monitor:
    “Connecting to blynk-cloud.com:80

  • Of course I reset the router, and get as closer as I could to the wifi signal…

  • I also suspected that the port 80 could be reserved, as there are to routers (one in bridge mode with some surveillance camera system connected to the internet )

  • I looked in the router admin settings and didn’t find anything.

  • I also tried enabling port 80 to the ip 186.167.1.100 in the server admin port forward options

  • I also tried changing the file BlynkConfig.h BLYNK_DEFAULT_PORT, instead of 80, I tried connecting to the 8080 and the 8442 as suggested over there in the forum.
    Non of this workaround worked, no luck at all…

Finally, I tried in the Terminal command: $ ping blynk-cloud.com
And the ping was succesful and I was able to get the Blynk server IP address: 45.55.96.146
and instead of calling

“Blynk.begin(auth, ssid, pass)”
I changed for this
“Blynk.begin(auth, ssid, pass, IPAddress(45,55,96,146),80);”
and this worked !

I have a few questions:

  • Why in certain network this workaround works and the default example not ?
    In other words: Why in some scenarios Blynk.begin(auth, ssid, pass); doesn’t work ?
  • Is this workaround stable and reliable ?? 45.55.96.146 couldn’t change at some point ?
  • Do you think this is associated with port 80 really?? If it was reserved by other device or firewall, how would you connect blynk correctly otherwise (I already mentioned connecting to 8080 or 8442 didn’t cooperate)

Thanks in advance for any help and advice !
I did not have a happy blynk and need to check what is going on here…

Sebastian

CODE AS IS IN THE BLYNK LIBRARY EXAMPLE , only one line changed IN ORDER TO MAKE IT WORK:

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

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

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

void setup()
{
  // Debug console
  Serial.begin(9600);

  //Blynk.begin(auth, ssid, pass); // <--- THIS WAS NOT WORKING , DUE TO PORT 80 ISSUE

Blynk.begin(auth, ssid, pass, IPAddress(45,55,96,146),80); // <---- THIS LINE COOPERATED, WHY?
}

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

You shouldn’t be editing the library files to achieve this, it’s done here:

Available ports are 80, 8080 and 443 on the cloud servers that you are using.

Many ISPs block traffic on port 80, so 8080 is often better.

I guess your issue is caused by your work DNS server not resolving the correct Blynk server (there are three, each with different IP addresses, but your project only lives on one of them) so using the IP address of the server where your Blynk project resides is the workaround. Alternately, your firewall could be objecting to the re-direction that takes place when Blynk attempts to route your data to the correct server.

Pete.

1 Like