One of my sketches works fine for a while then after a Hartbeat timeout the Arduino Nano with ESP8266 hardserial cannot recover. What should I do?
[408650] Heartbeat timeout (last in: 392644)
[408750] Cmd not sent
[410750] Cmd not sent
[416837] <msg 2,1,32
<auth
followed by Login Timeouts
#define BLYNK_DEBUG
#include <SoftwareSerial.h>
SoftwareSerial MySerial(9,10); // RX, TX
#define BLYNK_PRINT MySerial
// Set ESP8266 Serial object
#include <ESP8266_HardSer.h>
#include <BlynkSimpleShieldEsp8266_HardSer.h>
#define EspSerial Serial
ESP8266 wifi(EspSerial);
char auth[] = "auth";
WidgetBridge bridge1(V30);
WidgetLED led21(21);
#include <SimpleTimer.h>
int vacation = 0;
int UP_PIN = V1;
int ALARM_PIN = V11;
bool runn = 0;
void setup()
{
MySerial.begin(9600);
// Set ESP8266 baud rate
EspSerial.begin(115200);
delay(10);
Blynk.begin(auth, wifi, "mywireless", "mykey");
while (Blynk.connect() == false) { // Wait until connected
}
bridge1.setAuthToken("other auth");
Blynk.virtualWrite(UP_PIN,0); // turn Up off
Blynk.virtualWrite(ALARM_PIN,0); // turn Alarm off
vacation = led21.getValue();
timer.setInterval(2000L, sendData);
}
void loop()
{
Blynk.run();
timer.run(); // Initiates SimpleTimer
}
void sendData()
{
Blynk.virtualWrite(UP_PIN,runn); // turn Up off
runn = !runn;
}