I got this code from a website and it works well… (its a door alarm security that sends a notification and email by Blynk when a door is opened) The problem is that I want to be able to change the wifi credentials dnamically, I know about the WiFiManager and I am able to use it seperatly but I can
t combine the two codes as Im not a professional so please can you help me in using this code and be able to change the wifi credentials (WiFi credentials only not the blynk auth token) ? Im using Blynk on android 9, Node mcu esp8266.
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
BlynkTimer timer;
char auth[] = "xxxxx"; //Enter the authentication code sent by Blynk to your Email
char ssid[] = "xxxxx"; //Enter your WIFI SSID
char pass[] = "xxxxx"; //Enter your WIFI Password
int flag=0;
void notifyOnButtonPress()
{
int isButtonPressed = digitalRead(D1);
if (isButtonPressed==1 && flag==0) {
Serial.println("Someone Opened the door");
Blynk.notify("Alert : Someone Opened the door");
Blynk.email("xxxx@gmail.com", "ESP8266 Alert", "Someone Opened the Door");
flag=1;
}
else if (isButtonPressed==0)
{
flag=0;
}
}
void setup()
{
Serial.begin(9600);
Blynk.begin(auth, ssid, pass);
pinMode(D1,INPUT_PULLUP);
timer.setInterval(16000L,notifyOnButtonPress);
}
void loop()
{
Blynk.run();
timer.run();
}
TIA