Heartbeat Timeout Woes

  Blynk library is licensed under MIT license
  This example code is in public domain.


  You’ll need:
   - Blynk App (download from AppStore or Google Play)
   - ESP32 board
   - Decide how to connect to Blynk
     (USB, Ethernet, Wi-Fi, Bluetooth, ...)

  There is a bunch of great example sketches included to show you how to get
  started. Think of them as LEGO bricks  and combine them as you wish.
  For example, take the Ethernet Shield sketch and combine it with the
  Servo example, or choose a USB sketch and add a code from SendData

/* Comment this out to disable prints and save space */

// #define BLYNK_HEARTBEAT 2

#define BLYNK_PRINT Serial
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>

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

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

void setup()
  // Debug console
  Blynk.begin(auth, ssid, pass);
  // You can also specify server:
  // Blynk.begin(auth, ssid, pass, "", 8080);
  // Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8080);

void loop()

Good afternoon all,

I’ve been struggling for days trying to overcome a “Heartbeat timeout” error. The project runs and will function for around 17 mins before generating the error. This is consistent and repeatable.

I have a good internet connection and a ping of 45ms.

I’ve tried changing the port to 8080 with the same results.

I’ve also tried experimenting with #define BLYNK_HEARTBEAT. I’m not sure if the syntax is correct but in any case, it has no effect.

I’ve tried different ESP32’s just in case but the results were the same.

I’ve also tried connecting via a mobile hotspot on my phone AND THAT WORKS! Even with a poor signal and a ping of 250ms. No problems!

I’m assuming that as it will initially connect and function that there’s no port blocking going on and my router settings are OK. I have have tried setting up a port forward but again it made no difference.

After the error is generated the router shows that the ESP32 is still connected.

After the error it tries to reconnect but always fails. A hardware reset will force it to reconnect.

Any help would be greatly appreciated. My last foray into the world of coding was with Basic in the mid 80’s on a Tutung Einstein so the “Noddy” guide would be prefered :-).

Thanks and regards.

Sounds like something your ISP is doing.
Have you tried connecting to a different WiFi network, preferably one provided by a different ISP?


Thanks for the suggestion Pete, that sounds like a plan. Might have to wait until after lockdown now though.