NodeMCU - problem with connection to the blynk.cloud

Hello,
I have a problem woth connecting my NodeMCU to the blynk.cloud. I can connect to wireless network. I obsevred traffic in Wireshark and I have noticed that after PUSH message with authtoken server sends RST message. The situation repeats every time. (with Internet connection shared from smartphone everyting is ok. I have uploaded screens from Wireshark.

Seeing your code and serial output (both as text with triple backticks rather than screenshots) would be far more helpful.

Pete.

Code is the following:

#define BLYNK_PRINT Serial

/* Fill-in your Template ID (only if using Blynk.Cloud) */
//#define BLYNK_TEMPLATE_ID   "YourTemplateID"
#define BLYNK_TEMPLATE_ID "TMPLIHVdGppE"
#define BLYNK_DEVICE_NAME "LED Wemos"
#define BLYNK_AUTH_TOKEN "1BtBBgfo7i1yD6TpM3TZKWRAI7D9mQ4R"

#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
//#include <BlynkSimpleEsp8266_SSL.h>


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


#define LEDPin D2
#define VPIN_BUTTON_1 V1

int V1_state=0;

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

BLYNK_WRITE(VPIN_BUTTON_1) {
  V1_state=param.asInt();
  digitalWrite(LEDPin, V1_state);
}

void setup()
{
  // Debug console
  Serial.begin(9600);
  pinMode(LEDPin, OUTPUT);

  digitalWrite(LEDPin, LOW);
//WiFi.begin(ssid,pass);
//Blynk.config(auth);
 Blynk.begin(auth, ssid, pass, "blynk.cloud", 80);
 // Blynk.begin(auth, ssid, pass);
  //Blynk.begin(auth, ssid, pass, IPAddress(46,101,217,214), 8443);
  //Blynk.begin(auth, ssid, pass, "blynk.cloud", 443);
}

void loop()
{

  Blynk.run();
}

Output from the Serial monitor:

[14301] Connected to WiFi

[14301] IP: 192.168.1.103

  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v1.1.0 on ESP8266

 #StandWithUkraine    https://bit.ly/swua


[14430] Connecting to blynk.cloud:80
[19530] Connecting to blynk.cloud:80
[25599] Connecting to blynk.cloud:80
[30639] Connecting to blynk.cloud:80
[35680] Connecting to blynk.cloud:80
[40724] Connecting to blynk.cloud:80

@Maciej Please edit your post, using the pencil icon at the bottom, and add triple backticks at the beginning and end of your code and serial output so that they display correctly.
Triple backticks look like this:
```

Copy and paste these if you can’t find the correct symbol on your keyboard.

Pete.

Done:)

No.

Pete.

Now should be ok.

Does this mean that when you use your home WiFi you see the results shown above, but when you connect via a mobile hotspot then the device connects without any problems?

Pete.

Yes. But I don’t know what is blocked in the case of home WiFi? Does ISP block something? Blynk uses in that case only port 80.

It’s using port 80 because you’re specifying that in your Blynk.begin statement and because you’re not using the SSL version of the library.

You could try specifying port 8080 if your ISP is blocking traffic on port 80.

Pete.

Port 8080 is blocked for sure. 80 is not blocked. But why I recived from Blynk server RST message?
In the Wireshark I can see that I recived messages from Blynkserver on port 80.

I doubt that it was an RST message, but that’s simply how WireShark is interpreting it.

If you want to see the actual data flow then you should add #define BLYNK_DEBUG to your sketch.

Is there any reason why you aren’t using SSL and port 443 ?

Pete.

SSL also doesn’t work.

I think you need to be talking to your ISP.

Pete.

In debug mode I see only this:

[1218326] Connecting to blynk.cloud:80
[1218366] <[1D|00|01|00] 0BtBBgfo7i1yD6TpM3TZKWRAI7D9mQ4R

That’s the device sending a login request to the server and receiving no reply.

Pete.

You should really switch to using Blynk Library 1.2.0

1 Like

This is a great suggestion here