Disconnected from Blynk server ("Connecting to blynk.cloud:80")

Hello,

My Arduino MKR WiFi 1010 board keeps disconnecting from the Blynk server and it fails to reconnect, even after some days of unsuccessful attempts. Rebooting the board solves the problem immediately. It reconnects until it disconnects again after some time (about 1 hour).

I am using Blynk library 1.1.0.

Here is the output to the serial monitor (I’ve replaced sensitive information with *):

10:03:03.400 -> [14275] Connecting to ***********
10:03:41.406 -> [52265] IP: 192.168.0.23
10:03:41.406 -> [52265] 
10:03:41.406 ->     ___  __          __
10:03:41.406 ->    / _ )/ /_ _____  / /__
10:03:41.406 ->   / _  / / // / _ \/  '_/
10:03:41.406 ->  /____/_/\_, /_//_/_/\_\
10:03:41.406 ->         /___/ v1.1.0 on MKR WiFi 1010
10:03:41.406 -> 
10:03:41.406 ->  #StandWithUkraine    https://bit.ly/swua
10:03:41.406 -> 
10:03:41.406 -> 
10:03:41.406 -> [52266] Connecting to blynk.cloud:80
10:03:41.439 -> [52322] <[1D|00|01|00] ****************************
10:03:41.505 -> [52362] >[00|00|01|00|C8]
10:03:41.505 -> [52362] Ready (ping: 38ms).
10:03:41.505 -> [52363] Free RAM: 27031
10:03:41.572 -> [52429] <[11|00|02|00|82]ver[00]1.1.0[00]h-beat[00]45[00]buff-in[00]1024[00]dev[00]MKR WiFi 1010[00]con[00]WiFiNINA[00]fw-type[00]*****************[00]build[00]Jul 12 2022 10:02:42[00]tmpl[00]**************[00]
10:03:41.689 -> [52482] >[00|00|02|00|C8]
10:04:26.545 -> [97434] <[06|00|03|00|00]
10:04:26.612 -> [97476] >[00|00|03|00|C8]
10:05:11.572 -> [142436] <[06|00|04|00|00]
10:05:11.605 -> [142482] >[00|00|04|00|C8]
10:05:56.590 -> [187438] <[06|00|05|00|00]
10:05:56.623 -> [187486] >[00|00|05|00|C8]
10:06:41.576 -> [232440] <[06|00|06|00|00]
10:06:41.643 -> [232486] >[00|00|06|00|C8]
10:07:26.594 -> [277442] <[06|00|07|00|00]
10:07:26.627 -> [277486] >[00|00|07|00|C8]
10:08:11.610 -> [322444] <[06|00|08|00|00]
10:08:11.676 -> [322494] >[00|00|08|00|C8]
10:08:56.629 -> [367446] <[06|00|09|00|00]
10:08:56.662 -> [367488] >[00|00|09|00|C8]
10:09:41.650 -> [412448] <[06|00|0A|00|00]
10:09:41.683 -> [412489] >[00|00|0A|00|C8]
10:10:26.673 -> [457450] <[06|00|0B|00|00]
10:10:26.706 -> [457490] >[00|00|0B|00|C8]
10:11:11.691 -> [502452] <[06|00|0C|00|00]
10:11:11.757 -> [502500] >[00|00|0C|00|C8]
10:11:56.713 -> [547454] <[06|00|0D|00|00]
10:11:56.780 -> [547501] >[00|00|0D|00|C8]
10:12:41.740 -> [592456] <[06|00|0E|00|00]
10:12:41.773 -> [592500] >[00|00|0E|00|C8]
10:13:26.747 -> [637458] <[06|00|0F|00|00]
10:13:26.814 -> [637501] >[00|00|0F|00|C8]
10:14:11.794 -> [682460] <[06|00|10|00|00]
10:14:11.828 -> [682502] >[00|00|10|00|C8]
10:14:56.797 -> [727462] <[06|00|11|00|00]
10:14:56.864 -> [727510] >[00|00|11|00|C8]
10:15:41.839 -> [772464] <[06|00|12|00|00]
10:15:41.872 -> [772517] >[00|00|12|00|C8]
10:16:26.855 -> [817466] <[06|00|13|00|00]
10:16:26.888 -> [817514] >[00|00|13|00|C8]
10:17:11.873 -> [862468] <[06|00|14|00|00]
10:17:11.939 -> [862512] >[00|00|14|00|C8]
10:17:56.895 -> [907470] <[06|00|15|00|00]
10:17:56.962 -> [907519] >[00|00|15|00|C8]
10:18:41.916 -> [952473] <[06|00|16|00|00]
10:18:41.982 -> [952527] >[00|00|16|00|C8]
10:19:26.968 -> [997475] <[06|00|17|00|00]
10:19:27.001 -> [997515] >[00|00|17|00|C8]
10:20:11.988 -> [1042477] <[06|00|18|00|00]
10:20:12.070 -> [1042523] >[00|00|18|00|C8]
10:20:57.009 -> [1087479] <[06|00|19|00|00]
10:20:57.042 -> [1087530] >[00|00|19|00|C8]
10:21:42.033 -> [1132482] <[06|00|1A|00|00]
10:21:42.067 -> [1132529] >[00|00|1A|00|C8]
10:22:27.052 -> [1177484] <[06|00|1B|00|00]
10:22:27.085 -> [1177529] >[00|00|1B|00|C8]
10:23:12.072 -> [1222486] <[06|00|1C|00|00]
10:23:12.115 -> [1222526] >[00|00|1C|00|C8]
10:23:57.092 -> [1267488] <[06|00|1D|00|00]
10:23:57.158 -> [1267533] >[00|00|1D|00|C8]
10:24:42.112 -> [1312490] <[06|00|1E|00|00]
10:24:42.178 -> [1312549] >[00|00|1E|00|C8]
10:25:27.143 -> [1357492] <[06|00|1F|00|00]
10:25:27.210 -> [1357533] >[00|00|1F|00|C8]
10:26:12.196 -> [1402494] <[06|00] [00|00]
10:26:12.229 -> [1402537] >[00|00] [00|C8]
10:26:57.227 -> [1447496] <[06|00]![00|00]
10:26:57.260 -> [1447540] >[00|00]![00|C8]
10:27:42.248 -> [1492498] <[06|00]"[00|00]
10:27:42.281 -> [1492550] >[00|00]"[00|C8]
10:28:27.273 -> [1537500] <[06|00]#[00|00]
10:28:27.306 -> [1537539] >[00|00]#[00|C8]
10:29:12.296 -> [1582502] <[06|00]$[00|00]
10:29:12.363 -> [1582549] >[00|00]$[00|C8]
10:29:57.324 -> [1627504] <[06|00]%[00|00]
10:29:57.390 -> [1627551] >[00|00]%[00|C8]
10:30:42.373 -> [1672507] <[06|00]&[00|00]
10:30:42.414 -> [1672552] >[00|00]&[00|C8]
10:31:27.416 -> [1717509] <[06|00]'[00|00]
10:31:27.456 -> [1717552] >[00|00]'[00|C8]
10:32:12.423 -> [1762511] <[06|00]([00|00]
10:32:12.462 -> [1762553] >[00|00]([00|C8]
10:32:57.459 -> [1807513] <[06|00])[00|00]
10:32:57.525 -> [1807561] >[00|00])[00|C8]
10:33:42.515 -> [1852516] <[06|00]*[00|00]
10:33:42.548 -> [1852560] >[00|00]*[00|C8]
10:34:27.537 -> [1897518] <[06|00]+[00|00]
10:34:27.570 -> [1897568] >[00|00]+[00|C8]
10:35:12.552 -> [1942521] <[06|00],[00|00]
10:35:12.619 -> [1942578] >[00|00],[00|C8]
10:35:57.604 -> [1987524] <[06|00]-[00|00]
10:35:57.637 -> [1987569] >[00|00]-[00|C8]
10:36:42.629 -> [2032526] <[06|00].[00|00]
10:36:42.663 -> [2032567] >[00|00].[00|C8]
10:37:27.679 -> [2077529] <[06|00]/[00|00]
10:37:27.712 -> [2077578] >[00|00]/[00|C8]
10:38:12.705 -> [2122532] <[06|00]0[00|00]
10:38:12.744 -> [2122576] >[00|00]0[00|C8]
10:38:57.726 -> [2167534] <[06|00]1[00|00]
10:38:57.766 -> [2167576] >[00|00]1[00|C8]
10:39:42.782 -> [2212536] <[06|00]2[00|00]
10:39:42.815 -> [2212575] >[00|00]2[00|C8]
10:40:27.811 -> [2257538] <[06|00]3[00|00]
10:40:27.844 -> [2257586] >[00|00]3[00|C8]
10:41:12.839 -> [2302541] <[06|00]4[00|00]
10:41:12.872 -> [2302590] >[00|00]4[00|C8]
10:41:57.864 -> [2347543] <[06|00]5[00|00]
10:41:57.899 -> [2347591] >[00|00]5[00|C8]
10:42:42.886 -> [2392545] <[06|00]6[00|00]
10:42:42.925 -> [2392592] >[00|00]6[00|C8]
10:43:27.910 -> [2437547] <[06|00]7[00|00]
10:43:28.043 -> [2437683] >[00|00]7[00|C8]
10:44:12.967 -> [2482549] <[06|00]8[00|00]
10:44:13.133 -> [2482724] >[00|00]8[00|C8]
10:44:57.976 -> [2527551] <[06|00]9[00|00]
10:44:58.043 -> [2527596] >[00|00]9[00|C8]
10:45:43.001 -> [2572554] <[06|00]:[00|00]
10:45:43.067 -> [2572595] >[00|00]:[00|C8]
10:46:28.054 -> [2617556] <[06|00];[00|00]
10:46:28.187 -> [2617694] >[00|00];[00|C8]
10:47:13.075 -> [2662558] <[06|00]<[00|00]
10:47:13.142 -> [2662616] >[00|00]<[00|C8]
10:47:58.128 -> [2707560] <[06|00]=[00|00]
10:47:58.161 -> [2707615] >[00|00]=[00|C8]
10:48:43.146 -> [2752563] <[06|00]>[00|00]
10:48:43.212 -> [2752646] >[00|00]>[00|C8]
10:49:28.191 -> [2797565] <[06|00]?[00|00]
10:49:28.228 -> [2797627] >[00|00]?[00|C8]
10:50:13.201 -> [2842567] <[06|00]@[00|00]
10:50:13.267 -> [2842618] >[00|00]@[00|C8]
10:50:58.225 -> [2887569] <[06|00]A[00|00]
10:50:58.325 -> [2887661] >[00|00]A[00|C8]
10:51:43.275 -> [2932571] <[06|00]B[00|00]
10:51:43.341 -> [2932655] >[00|00]B[00|C8]
10:52:28.301 -> [2977574] <[06|00]C[00|00]
10:52:28.467 -> [2977749] >[00|00]C[00|C8]
10:53:13.322 -> [3022576] <[06|00]D[00|00]
10:53:13.388 -> [3022652] >[00|00]D[00|C8]
10:53:58.341 -> [3067579] <[06|00]E[00|00]
10:53:58.441 -> [3067655] >[00|00]E[00|C8]
10:54:43.367 -> [3112581] <[06|00]F[00|00]
10:54:43.433 -> [3112649] >[00|00]F[00|C8]
10:55:28.423 -> [3157583] <[06|00]G[00|00]
10:55:28.556 -> [3157732] >[00|00]G[00|C8]
10:56:13.437 -> [3202585] <[06|00]H[00|00]
10:56:13.603 -> [3202754] >[00|00]H[00|C8]
10:56:58.457 -> [3247587] <[06|00]I[00|00]
10:56:58.656 -> [3247788] >[00|00]I[00|C8]
10:57:43.480 -> [3292589] <[06|00]J[00|00]
10:57:43.613 -> [3292712] >[00|00]J[00|C8]
10:58:28.513 -> [3337591] <[06|00]K[00|00]
10:58:28.712 -> [3337769] >[00|00]K[00|C8]
10:59:13.566 -> [3382593] <[06|00]L[00|00]
10:59:13.601 -> [3382651] >[00|00]L[00|C8]
10:59:58.590 -> [3427595] <[06|00]M[00|00]
10:59:58.656 -> [3427674] >[00|00]M[00|C8]
11:00:43.611 -> [3472597] <[06|00]N[00|00]
11:00:43.713 -> [3472687] >[00|00]N[00|C8]
11:01:28.633 -> [3517599] <[06|00]O[00|00]
11:01:28.699 -> [3517660] >[00|00]O[00|C8]
11:02:13.661 -> [3562602] <[06|00]P[00|00]
11:02:13.727 -> [3562653] >[00|00]P[00|C8]
11:02:58.686 -> [3607604] <[06|00]Q[00|00]
11:02:58.752 -> [3607645] >[00|00]Q[00|C8]
11:03:43.744 -> [3652606] <[06|00]R[00|00]
11:03:43.877 -> [3652748] >[00|00]R[00|C8]
11:04:09.241 -> [3678108] Connecting to blynk.cloud:80
11:04:15.683 -> [3684559] Connecting to blynk.cloud:80
11:04:22.687 -> [3691555] Connecting to blynk.cloud:80
11:04:29.694 -> [3698551] Connecting to blynk.cloud:80
11:04:36.700 -> [3705548] Connecting to blynk.cloud:80
11:04:43.703 -> [3712544] Connecting to blynk.cloud:80
11:04:50.707 -> [3719541] Connecting to blynk.cloud:80
11:04:57.714 -> [3726538] Connecting to blynk.cloud:80
11:05:04.686 -> [3733535] Connecting to blynk.cloud:80
11:05:11.692 -> [3740532] Connecting to blynk.cloud:80
11:05:18.696 -> [3747529] Connecting to blynk.cloud:80
11:05:25.702 -> [3754526] Connecting to blynk.cloud:80
11:05:32.708 -> [3761524] Connecting to blynk.cloud:80
11:05:39.713 -> [3768522] Connecting to blynk.cloud:80
11:05:46.685 -> [3775520] Connecting to blynk.cloud:80
11:05:53.690 -> [3782518] Connecting to blynk.cloud:80
11:06:00.695 -> [3789516] Connecting to blynk.cloud:80
11:06:07.701 -> [3796514] Connecting to blynk.cloud:80
11:06:14.707 -> [3803512] Connecting to blynk.cloud:80
...

And this is the output after rebooting the board:

07:32:50.041 -> [4153] IP: 192.168.0.23
07:32:50.041 -> [4154] 
07:32:50.041 ->     ___  __          __
07:32:50.041 ->    / _ )/ /_ _____  / /__
07:32:50.041 ->   / _  / / // / _ \/  '_/
07:32:50.041 ->  /____/_/\_, /_//_/_/\_\
07:32:50.041 ->         /___/ v1.1.0 on MKR WiFi 1010
07:32:50.041 -> 
07:32:50.041 ->  #StandWithUkraine    https://bit.ly/swua
07:32:50.041 -> 
07:32:50.041 -> 
07:32:50.041 -> [4155] Connecting to blynk.cloud:80
07:32:50.107 -> [4215] <[1D|00|01|00] ***************************************
07:32:50.140 -> [4258] >[00|00|01|00|C8]
07:32:50.140 -> [4259] Ready (ping: 41ms).
07:32:50.140 -> [4259] Free RAM: 27031
07:32:50.207 -> [4325] <[11|00|02|00|82]ver[00]1.1.0[00]h-beat[00]45[00]buff-in[00]1024[00]dev[00]MKR WiFi 1010[00]con[00]WiFiNINA[00]fw-type[00]*************[00]build[00]Jul 12 2022 10:02:42[00]tmpl[00]**************[00]
07:32:50.273 -> [4379] >[00|00|02|00|C8]
07:33:35.225 -> [49330] <[06|00|03|00|00]
07:33:35.258 -> [49381] >[00|00|03|00|C8]

Could you please provide some guidance on how to figure out the cause of the problem?

Thank you for your support.


#define BLYNK_DEBUG
#define BLYNK_PRINT Serial
#define BLYNK_TEMPLATE_ID "*********************"
#define BLYNK_DEVICE_NAME "********************"
#define BLYNK_AUTH_TOKEN "******************"

#include <SPI.h>
#include <WiFiNINA.h>
#include <BlynkSimpleWiFiNINA.h>

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

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

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

  Blynk.begin(auth, ssid, pass);
  // You can also specify server:
  //Blynk.begin(auth, ssid, pass, "blynk-cloud.com", 80);
  //Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8080);
}

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

Regards.

@estfigueroa please edit your post, using the pencil icon at the bottom, and add triple backticks at the beginning and end of each of your serial outputs, so that they display correctly.

Also, are you 100% sure that this is the sketch which produced this serial output?

Pete.

@PeteKnight, thank you for your comments and sorry for the wrong formatting. I hope it is ok now. It is my first post in the forum.

I am pretty sure that it is the sketch that produced the output, but I will upload it again and double-check. I had the same problem with the original sketch and with a similar board as well (also an MKR WiFi 1010 at a different location). This is the reason I decided to upload the example sketch to prevent side effects.

Regards.

@PeteKnight, I uploaded the sketch again and added a line to check whether the expected code was loaded (“Example sketch loaded!”).

Here is the code I uploaded (* replacing sensitive data):

#define BLYNK_DEBUG
#define BLYNK_PRINT Serial
#define BLYNK_TEMPLATE_ID "*"
#define BLYNK_DEVICE_NAME "*"
#define BLYNK_AUTH_TOKEN "*"

#include <SPI.h>
#include <WiFiNINA.h>
#include <BlynkSimpleWiFiNINA.h>

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

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

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

  Blynk.begin(auth, ssid, pass);
  // You can also specify server:
  //Blynk.begin(auth, ssid, pass, "blynk-cloud.com", 80);
  //Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8080);
  Serial.println("Example sketch loaded!");
}

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

And here is the Serial output:

21:24:21.014 -> [872] WiFi firmware: 1.4.8
21:24:21.014 -> [872] Connecting to *
21:24:33.263 -> [13132] Connecting to *
21:24:38.674 -> [18548] IP: 192.168.0.23
21:24:38.674 -> [18548] 
21:24:38.674 ->     ___  __          __
21:24:38.674 ->    / _ )/ /_ _____  / /__
21:24:38.674 ->   / _  / / // / _ \/  '_/
21:24:38.674 ->  /____/_/\_, /_//_/_/\_\
21:24:38.674 ->         /___/ v1.1.0 on MKR WiFi 1010
21:24:38.674 -> 
21:24:38.674 ->  #StandWithUkraine    https://bit.ly/swua
21:24:38.674 -> 
21:24:38.674 -> 
21:24:38.674 -> [18549] Connecting to blynk.cloud:80
21:24:38.807 -> [18683] <[1D|00|01|00] *
21:24:38.873 -> [18751] >[00|00|01|00|C8]
21:24:38.873 -> [18751] Ready (ping: 66ms).
21:24:38.873 -> [18751] Free RAM: 27031
21:24:38.939 -> [18818] <[11|00|02|00|82]ver[00]1.1.0[00]h-beat[00]45[00]buff-in[00]1024[00]dev[00]MKR WiFi 1010[00]con[00]WiFiNINA[00]fw-type[00]*[00]build[00]Jul 13 2022 21:24:13[00]tmpl[00]*[00]
21:24:38.939 -> Example sketch loaded!
21:24:39.077 -> [18901] >[00|00|02|00|C8]
21:25:23.924 -> [63824] <[06|00|03|00|00]
21:25:24.023 -> [63893] >[00|00|03|00|C8]
21:26:08.911 -> [108827] <[06|00|04|00|00]
21:26:08.977 -> [108868] >[00|00|04|00|C8]
21:26:53.927 -> [153829] <[06|00|05|00|00]
21:26:54.026 -> [153944] >[00|00|05|00|C8]
21:27:38.884 -> [198831] <[06|00|06|00|00]
21:27:39.017 -> [198960] >[00|00|06|00|C8]
21:28:23.868 -> [243834] <[06|00|07|00|00]
21:28:23.934 -> [243888] >[00|00|07|00|C8]
21:29:08.852 -> [288837] <[06|00|08|00|00]
21:29:08.918 -> [288877] >[00|00|08|00|C8]
21:29:53.844 -> [333840] <[06|00|09|00|00]
21:29:53.910 -> [333889] >[00|00|09|00|C8]
21:30:38.833 -> [378843] <[06|00|0A|00|00]
21:30:38.899 -> [378900] >[00|00|0A|00|C8]
21:31:23.817 -> [423845] <[06|00|0B|00|00]
21:31:23.850 -> [423890] >[00|00|0B|00|C8]
21:32:08.799 -> [468848] <[06|00|0C|00|00]
21:32:08.832 -> [468903] >[00|00|0C|00|C8]
21:32:53.764 -> [513850] <[06|00|0D|00|00]
21:32:53.830 -> [513893] >[00|00|0D|00|C8]
21:33:38.740 -> [558852] <[06|00|0E|00|00]
21:33:38.806 -> [558896] >[00|00|0E|00|C8]
21:34:23.720 -> [603854] <[06|00|0F|00|00]
21:34:23.787 -> [603899] >[00|00|0F|00|C8]
21:35:08.714 -> [648857] <[06|00|10|00|00]
21:35:08.747 -> [648905] >[00|00|10|00|C8]
21:35:40.784 -> [680943] Connecting to blynk.cloud:80
21:35:47.686 -> [687845] Connecting to blynk.cloud:80
21:35:54.691 -> [694849] Connecting to blynk.cloud:80
21:36:01.663 -> [701853] Connecting to blynk.cloud:80
21:36:08.668 -> [708858] Connecting to blynk.cloud:80
21:36:15.673 -> [715863] Connecting to blynk.cloud:80
21:36:22.678 -> [722868] Connecting to blynk.cloud:80

Any suggestions?

Thank you.

Do you have any other hardware, such as a NodeMCU, that you could try this with?

Pete.

Unfortunately, I only have an Arduino Uno available (probably useless in this case).

I will add some code to figure out the connectivity status of the device while attempting to connect to the Blynk server and I will post the result. If you have any suggestions to gather more information, please let me know.

Thank you.

I’m not sure you’ll get any more than the debug output is showing at the moment.

Heartbeat time is 45 seconds.

Device sends a “00” heartbeat.
Server replies with “C8” (200 decimal) which is “Okay”

Then, 7 seconds later the device is trying to reconnect…

I have no hands-on experience with the MKR devices, so can’t really suggest where the issue might be.

Pete.

Thank you, @PeteKnight. It is somewhat frustrating. It is the second MKR WiFi 1010 board I test with similar results.

Let’s see if someone else has experience with the board. I will post any new findings.

Regards.

I really wonder why you are using MKR WiFi 1010 at $35 instead of $5 ESP32 :thinking: