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

Blynk starts up OK but restarts about 10 times an hour


#1

I have a stable 200/200 WiFi and Blynk connected to an Arduino Mega with a Cytron ESP 8266. Blynk starts up OK but restarts about 10 times an hour and then sometimes it will freeze as follows:

[1924506] Connecting to Madrid
[1927694] AT version:0.52.0.0(Jan  7 2016 18:44:24)
SDK version:1.5.1(e67da894)
compile time:Jan  7 2016 19:03:11
OK
[1930977] +CIFSR:STAIP,"192.168.86.94"
+CIFSR:STAMAC,"5c:cf:7f:10:73:14"
[1930989] Connected to WiFi

And it will never recover unless I reset the Arduino. This is the setup:

#define BLYNK_PRINT Serial
#define Blynk_DEBUG
#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>
#include <TimeLib.h>
#include <WidgetRTC.h>
char auth[] = "...";
const char *ssid = "xxxxx";
const char *pass = "yyyyyyy";
#include <SoftwareSerial.h>
SoftwareSerial EspSerial(12, 13); // RX, TX
#define ESP8266_BAUD 9600
ESP8266 wifi(&EspSerial);

in setup() I have
Blynk.begin(auth, wifi, ssid, pass);


Mega+ESP will freeze if there is a connection problem
#2

I moved your post into your own topic… Please do not tack a new issue into someone else’s topic, particularly a solved 7 month old one.

Yup, looks like you need to find the root issue for the restarts… We can’t see anything wrong with what little you showed :wink:

Although I do wonder what you are using SoftwareSerial with an Arduino MEGA that has 4 hardware serial ports??


#3

The problem with the Cytron board is the selection of the pins are limited to the following:

There are no options for communicating with the Arduino Mega Hardware Ports.

I will contact Cytron Technologies and see what comes up. I may of course be missing something here.


#4

I see now… it is a hardwired physical shield board. Just pick up a ESP-01 for a buck or two and wire it up any way you want to the Mega. That’s how I do :stuck_out_tongue_winking_eye:


#5

I notice I get a Blynk Heartbeat timeout when Blynk restarts. What causes the hearbeat timeout and how long is it?

I will get some simple ESP’s and wire them up.

Herman


#6

Bad/blocking code and I think it defaults to 10 seconds.

Don’t forget to read them pesky documentations

http://docs.blynk.cc/#blynk-main-operations-devices-online-status


#7

Where do I even start to look. I will have to simplify the code and add section by section until I can identify what is bad or blocking comms.

I assume it has to be in my code or can it be one of the libraries I am using. I do not use delay() in my code at all except during setup().


#8

You can paste your code here… properly formatted… so others can take a look

Blynk%20-%20FTFC