Dynamically changing Wifi credentials withou hardcoring

I am aware of the WiFiManager and I tried it, my problem is that I cant apply it when using blynk because it keeps giving errors and I dont want to dynamically change the blynk auth token, just the WiFi credentials, so if you know the code, Ill be grateful (I`m using NodeMcu esp8266)

WiFiManager is perfectly capable of running with Blynk, either with or without a dynamically changed Auth code.

However, you might be better-off looking at some of the new alternative libraries that have been written by @khoih


1 Like

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 cant 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");"", "ESP8266 Alert", "Someone Opened the Door");
  else if (isButtonPressed==0)
void setup()
Blynk.begin(auth, ssid, pass);
void loop()


@Wall-e I’ve merged your two topics together as they are about the same thing. Please keep discussions about the same topic together.


1 Like

okay no problem, soo do you have any idea what I should do?

The bottom line is that you need to become more proficient at C++ coding, and probably the best way of doing that is trial and error, with some support.

Post the code that you’ve created, along with details of what does and doesn’t work, and people will probably chip-in with advice.


Here’s an example that should get you going with using blynk and wifimanager together: