I have tested the below code for whole morning, and the code can sent out the emails successfully and no missing.
However, since 3 pm, there is no any emails sent out, but the notification can be sent out and serial monitor show that the program is operating normally.
I have also tried to change another email (company email or Gmail), both are not success, even I changed another board and re-upload the program.
My board is ESP8266 NodeMCU
#define BLYNK_PRINT Serial
//#define BLYNK_MAX_SENDBYTES 128
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
char auth[] = "";
char ssid[] = "";
char pass[] = "";
const String SiteNo = "XXX";
volatile byte bFlag1; //Status of air blower 1
volatile byte bFlag2; //Status of air blower 2
volatile byte bFlag; //Status of whole system
BlynkTimer timer;
void setup()
{
// Debug console
Serial.begin(115200);
Blynk.begin(auth, ssid, pass);
Blynk.email("xxx@gmail.com", String(SiteNo) + "Online", "My Blynk project is online.");
Blynk.notify(String(SiteNo) + " online");
pinMode(14, INPUT); //Initial is 0V
pinMode(12, INPUT); //Initial is 0V
attachInterrupt(digitalPinToInterrupt(14), email_B1, CHANGE);
attachInterrupt(digitalPinToInterrupt(12), email_B2, CHANGE);
timer.setInterval(20000L, system_status);
}
void email_B1()
{
int B1Fault = digitalRead(14); //Air Blower No.1
if (B1Fault == HIGH) //if this pin is 3.3V
bFlag1 |= 0x01; //this byte changes to 0000 0001
else if
(B1Fault == LOW)
bFlag1 = 0x00; //if this pin is 0v, changes to 0000 0000
}
void email_B2()
{
int B2Fault = digitalRead(12); //Air Blower No.2
if (B2Fault == HIGH) //if this pin is 3.3V
bFlag2 |= 0x02; //this byte changes to 0000 0010
else if
(B2Fault == LOW)
bFlag2 = 0x00; //if this pin is 0v, changes to 0000 0000
}
void system_status()
{
Blynk.email("xxx@gmail.com", String(SiteNo), bFlag);
Blynk.notify(String(SiteNo) + " alarm sent");
Serial.println(String(SiteNo));
Serial.println(bFlag, BIN);
}
void loop()
{
Blynk.run();
timer.run();
bFlag = bFlag1 |= bFlag2;
}