Hello i’m trying to make a simple esp8266 program to detect water I’ve tried basing it off of the email code but the device drops the WiFi connection before it can send the email.
Here is my code
#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "8f5fc55b2cc24**-/*/-/-/*/-*/58bc8";
void setup()
{
Serial.begin(9600);
Blynk.begin(auth, "Blue*****", "some*****");
}
void loop()
{
Blynk.run();
int iswaterdetected = !digitalRead(4);
if(iswaterdetected){
BLYNK_LOG("Water Detected");
Blynk.email("8******11@vtext.com", "No Title", "alert water detected");
}
}
yes I have installed the email widget and the app is active
its also continuing to drop connection to the server and i know its not the wifi because i have another steadily connected
this is the serial port it keeps repeating this
[324934] Connecting to cloud.blynk.cc:8442
[325120] Water Detected
[325223] Ready (ping: 103ms).
[325224] Water Detected
[325288] Water Detected
[325353] Water Detected
[325418] Water Detected
[325483] Water Detected
[325651] Water Detected
[325715] Water Detected
[325780] Water Detected
[325843] Water Detected
[325912] Water Detected
[325977] Water Detected
[326042] Water Detected
[326107] Water Detected
[326171] Water Detected
[326236] Water Detected
[326301] Water Detected
[326366] Water Detected
[326431] Water Detected
[326496] Water Detected
[326563] Water Detected
[326731] Water Detected
[326797] Water Detected
[326861] Water Detected
[326926] Water Detected
[326990] Water Detected
You’ll need to install SimpleTimer library. I recommend you download the latest Blynk package - it has this library included : Releases · blynkkk/blynk-library · GitHub
When you send lot’s of messages, we disconnect you. So you need to decrease the amount of messages, by sending them, for example one each second. This is what Simple Timer does for you.
I just checked the email widget on Android - everything works perfectly.