I try to built a flood detector. The idea is that after water shorts two pins on polulu board - the board switches ESP8266.
ESP8266 boots up and simply send push notification to my phone. It works with modified example from Blynk “push notification button”.
But now I try to adopt another example “Template_ESP8266”. I need to have standalone app with possibility to set WIFI credentials from the app. With the code below, my app can be connected to WIFI, and I am getting push notifications that my device is connected/disconnected. But there is no push notification that “water detected” after boot up.
In “Template_ESP8266” I have modified only 2 files: “Template_ESP8266” and “settings.h” Please see below the code.
I have posted only part of settings.h which I have modified
Details :
• ESP8266 -01 (it is written 15, but looks like 01)
• Android 4.2.2
• Blynk server
• Blynk 0.5.2
//Template_ESP8266
//#define USE_SPARKFUN_BLYNK_BOARD // Uncomment the board you are using
//#define USE_NODE_MCU_BOARD // Comment out the boards you are not using
//#define USE_WITTY_CLOUD_BOARD
#define USE_CUSTOM_BOARD // For all other ESP8266-based boards -
// see "Custom board configuration" in Settings.h
#define APP_DEBUG // Comment this out to disable debug prints
#define BLYNK_PRINT Serial
#include <BlynkSimpleEsp8266.h>
#include "BlynkProvisioning.h"
#include <ESP8266WiFi.h>
void setup() {
Serial.begin(115200);
BlynkProvisioning.begin();
Serial.println("Water detected!");
Blynk.notify("Water detected!");
}
void loop() {
// This handles the network and cloud connection
Blynk.run();
BlynkProvisioning.run();
}
//settings.h
#define BOARD_FIRMWARE_VERSION "1.0.1"
#define BOARD_HARDWARE_VERSION "1.0.0"
#define BOARD_NAME "Flood sensor" // Name of your product. Should match App Export request info.
#define BOARD_VENDOR "Company Name" // Name of your company. Should match App Export request info.
#define BOARD_TEMPLATE_ID "TMPL0000"
#define PRODUCT_WIFI_SSID "flood sensor" // Name of the device, to be displayed during configuration. Should match export request info.
#define BOARD_CONFIG_AP_URL "our-product.cc" // Config page will be available in a browser at 'http://our-product.cc/'