Hello, I need some help with notification widget.
Thanks in advance.
I have started a project to monitor different parameters of a recifal aquarium.
To be informed, for alarming, I want to use email and notification.
Config:
-arduino mega with a wifi shield ESP8266
-Blynk installed on a smartphone huawei P8light2017
-Notification for Blink is fully enabled on the smartphone
-The mailing is working perfectly, but the notification not.
Here a simple code:
#define BLYNK_PRINT Serial
/* Set this to a bigger number, to enable sending longer messages */
//#define BLYNK_MAX_SENDBYTES 256
#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>
char auth[] = "xxxx";
char ssid[] = "yyy";
char pass[] = "zzz";
#define EspSerial Serial1 // for arduino mega
#define ESP8266_BAUD 115200
ESP8266 wifi(&EspSerial);
void setup()
{
Serial.begin(9600);
Serial.println("Setup start ........");
EspSerial.begin(ESP8266_BAUD);
delay(100);
Serial.println("Blynk start ........");
Blynk.begin(auth, wifi, ssid, pass);
delay(1000);
Serial.println("Blynk started.");
Serial.println("Setup done.");
}
//GET NOTIF
BLYNK_WRITE(V6) // If button"Get Notif is pressed on blynk appli on smatphone, this is executed
{
int valueV6 = param.asInt(); // Get value as integer
if (valueV6 ==1)
{
Serial.println("Start: Button V6 is pressed on appli gsm.");
Blynk.notify("Notif: button V6 is pressed!");
Blynk.email("Subject: Notif", "Button V6 is pressed");
Serial.println("End: Button V6 is pressed on appli gsm.");
}
}
void loop()
{
Blynk.run();
}
If I press on the smartphone button V6, the “GET NOTIF” is activated, the mail is sent, but nothing for notification.
The serial console log (I have pressed the button “get notif” on the blynk appli on the smartphone)
12:00:31.305 -> Setup start ........
12:00:31.406 -> Blynk start ........
12:00:31.406 -> [100]
12:00:31.406 -> ___ __ __
12:00:31.440 -> / _ )/ /_ _____ / /__
12:00:31.474 -> / _ / / // / _ \/ '_/
12:00:31.508 -> /____/_/\_, /_//_/_/\_\
12:00:31.542 -> /___/ v0.6.1 on Arduino Mega
12:00:31.578 ->
12:00:32.047 -> [713] Connecting to babar
12:00:35.110 -> [3761] AT version:1.2.0.0(Jul 1 2016 20:04:45)
12:00:35.157 -> SDK version:1.5.4.1(39cb9a32)
12:00:35.157 -> v1.0.0
12:00:35.157 -> Mar 11 2018 18:27:31
12:00:35.204 -> OK
12:00:38.204 -> [6853] +CIFSR:STAIP,"192.168.1.51"
12:00:38.251 -> +CIFSR:STAMAC,"50:02:91:e0:83:bc"
12:00:38.298 -> [6860] Connected to WiFi
12:00:48.469 -> [17018] Ready (ping: 13ms).
12:00:49.735 -> Blynk started.
12:00:49.735 -> Setup done.
12:00:53.672 -> Start: Button V6 is pressed on appli gsm.
12:00:53.953 -> End: Button V6 is pressed on appli gsm.
12:01:01.287 -> Start: Button V6 is pressed on appli gsm.
12:01:01.568 -> End: Button V6 is pressed on appli gsm.