Why WiFi-Manager directs to 192.168.244.1 instead of 192.168.4.1? (SOLVED)

Hi,

Does anyone know why this happens? Takes me to a site where i should type “IP unset”-fields. I´m using NodeMCU 1.0.

Is there some way to fix this problem?

Thanks.

Pete.

Thanks, but thereś still something I don´t get now. I tried with these 2, but the first one changed to address I need to use to get to the config and second one filled those “IP unset”-fields. Still it takes me to that 192.168.244.1. And login doesn´t work. Hereś the code I try to use also. What I´m doing wrong here?

So these i tested to add:

wifiManager.setAPStaticIPConfig(IPAddress(10,0,1,1), IPAddress(10,0,1,1), IPAddress(255,255,255,0));

wifiManager.setSTAStaticIPConfig(IPAddress(192,168,0,99), IPAddress(192,168,0,1), IPAddress(255,255,255,0));

/*
This example will open a configuration portal for 60 seconds when first powered up. ConfigOnSwitch is a a bettter example for most situations but this has the advantage 
that no pins or buttons are required on the ESP8266 device at the cost of delaying 
the user sketch for the period that the configuration portal is open.
 
Also in this example a password is required to connect to the configuration portal 
network. This is inconvenient but means that only those who know the password or those 
already connected to the target WiFi network can access the configuration portal and 
the WiFi network credentials will be sent from the browser over an encrypted connection and
can not be read by observers.
 
*/
#include <ESP8266WiFi.h>          //https://github.com/esp8266/Arduino
 
//needed for library
#include <ESP8266WebServer.h>
#include <DNSServer.h>
#include <WiFiManager.h>          //https://github.com/kentaylor/WiFiManager
// Onboard LED I/O pin on NodeMCU board
const int PIN_LED = 2; // D4 on NodeMCU and WeMos. Controls the onboard LED.
 
void setup() {
  // put your setup code here, to run once:
  // initialize the LED digital pin as an output.
  pinMode(PIN_LED, OUTPUT);
 
  Serial.begin(115200);
  Serial.println("\n Starting");
  unsigned long startedAt = millis();

 
  WiFi.printDiag(Serial); //Remove this line if you do not want to see WiFi password printed
  Serial.println("Opening configuration portal");
  digitalWrite(PIN_LED, LOW); // turn the LED on by making the voltage LOW to tell us we are in configuration mode.
  //Local intialization. Once its business is done, there is no need to keep it around
 
  WiFiManager wifiManager;  
  //sets timeout in seconds until configuration portal gets turned off.
  //If not specified device will remain in configuration mode until
  //switched off via webserver.

//    wifiManager.setAPStaticIPConfig(IPAddress(10,0,1,1), IPAddress(10,0,1,1), IPAddress(255,255,255,0));

//      wifiManager.setSTAStaticIPConfig(IPAddress(198,168,0,99), IPAddress(192,168,0,1), IPAddress(255,255,255,0));

  if (WiFi.SSID()!="") wifiManager.setConfigPortalTimeout(60); //If no access point name has been previously entered disable timeout.
 
  //it starts an access point 
  //and goes into a blocking loop awaiting configuration
  if (!wifiManager.startConfigPortal("Samsara Exit","password"))  //Delete these two parameters if you do not want a WiFi password on your configuration access point
  {
     Serial.println("Not connected to WiFi but continuing anyway.");
  } 
  else 
  {
     //if you get here you have connected to the WiFi
     Serial.println("connected...yeey :)");
  }
      digitalWrite(PIN_LED, HIGH); // Turn led off as we are not in configuration mode.
      // For some unknown reason webserver can only be started once per boot up 
      // so webserver can not be used again in the sketch.
 
  Serial.print("After waiting ");
  int connRes = WiFi.waitForConnectResult();
  float waited = (millis()- startedAt);
  Serial.print(waited/1000);
  Serial.print(" secs in setup() connection result is ");
  Serial.println(connRes);
  if (WiFi.status()!=WL_CONNECTED)
  {
      Serial.println("failed to connect, finishing setup anyway");
  } 
  else
  {
    Serial.print("local ip: ");
    Serial.println(WiFi.localIP());
  }
}
 
 
void loop() {
 delay(10000);
  // put your main code here, to run repeatedly:
 
}


I clicked on Pete’s link above, it turned out to be a pretty good resource, and i was able to find that others were having the same issue, two years ago.

The problem, as i read it , was for no reason, no one could tell why it seemed to pick on them.

Someone said the fix was to reflash your device.
But i see what you’re doing is just trying to re-write your code. Im not sure why. Can you tell us why you’ve decided not to use the fix on the github, and just go for writing different code? It says right on there that they were fixed after reflashing. Can you explain a little more?

I have tried many different codes and everytime the same happens. I also have tried to ran this “EraseEsp8266Flash-master” via Arduino IDE, but it hasn´t worked for me. It gives an error and resets for some reason. I also ran NodeMCU flasher with a blank flash.

Just a minute ago I tested “Template_ESP8266.ino” from github (Blynk-library/examples/Blynk-inject/Template_ESP8266) and it took me first time to 192.168.4.1 and asked WiFi SSID, Password, Auth token, Host and Port.

I use Blynk server, so I guess the “host” should be “Blynk.cloud-com” And port “80” or “8080”?

And it still doesn´t connect. What is going on here? Or what fix you meant Ivennard?

I also have 2 NodeMCU´s in this “machine” of mine. Is it possible to set the SSID and password for 2 NodemMCU´s at one time?

I think you need to decide if you’re trying to get WifiManager or Blynk inject working, as asking questions about both in the same thread is difficult.

I notice from the code that you’ve no supplied that you’re not using the main tzapu branch of WiFiManager but a Ken Taylor branch. I like the stuff that Ken Taylor does, but there have been no code updates for two and a half years, so I’d say that branch is now dead.
The tzapu master branch also hasn’t had any updates for two and a half years, but this branch is being actively developed:
https://github.com/tzapu/WiFiManager/tree/development

I’ve never used Blynk Inject, but if its asking for a server IP address then you probably need to ping blynk-cloud.com from your PC to get the correct IP address for your local server.

No, the config is stored in the memory of the individual NodeMCU.

One other comment - I see lots of people struggling to get WifiManager or similar provisioning software to work when the majority of time it’s not actually needed.
I only use WifiManager for projects that other people are going to use in their own homes. The rest of the time I hard-code all the credentials I need into the sketch for that device. If I want to change these then I use OTA to allow me to change the sketch without the need for physical access to the NodeMCU.

Pete.

I really don´t know now what is going on. I pinged the Blynk-cloud:

“Pinging blynk-cloud.com(192.168.244.1) with 32 bytes of data”

Why it gives that “244”?

And tried all variations for server to log in, but no luck. I also use that “tzapu/WiFiManager”.

I´m totally lost now. But I continue struggling with this, cause I´m trying to do couple of these for my friends. Otherwise I could just hardcode it i know that.

But thanks anyway for trying to help.

Assuming that you’ve not mis-typed this IP address, you have something VERY strange happening with your network setup.
Can you please post the actual output from your command prompt window when you do this ping?

Pete.

Yes I think so too. Something VERY strange. But hereś what it says:

Pinging blynk-cloud.com [192.168.244.1] with 32 bytes of data:
Reply from 192.168.244.1: bytes=32 time=2ms TTL=255
Reply from 192.168.244.1: bytes=32 time=2ms TTL=255
Reply from 192.168.244.1: bytes=32 time=2ms TTL=255
Reply from 192.168.244.1: bytes=32 time=2ms TTL=255

Ping statistics for 192.168.244.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 2ms, Maximum = 2ms, Average = 2ms

I just tested and my other computer gives this (sorry its in finnish)… This comp is connected via ethernet cable:

Ping-isäntä: blynk-cloud.com [139.59.206.133] 32 tavua tietoja:
Vastaus isännältä 139.59.206.133: tavuja=32 aika=44 ms TTL=53
Vastaus isännältä 139.59.206.133: tavuja=32 aika=44 ms TTL=53
Vastaus isännältä 139.59.206.133: tavuja=32 aika=43 ms TTL=53
Vastaus isännältä 139.59.206.133: tavuja=32 aika=43 ms TTL=53

Ping-tilastot 139.59.206.133:
Paketit: Lähetetty = 4, Vastaanotettu = 4, Kadonnut = 0
(0% hävikki),
Arvioitu kiertoaika millisekunteina:
Pienin = 43 ms, Suurin = 44 ms, Keskiarvo = 43 ms

This is the IP address of the Blynk cloud server in Frankfurt, so that’s the correct result.

With your other computer, and possibly your NodeMCU, it’s seeing what I assume to be an internal IP address. What IP address range are you using for your home network?
You mentioned that the computer that gives the correct IP address is connected via a cable. Is the other connected via Wi-Fi? if so, what happens of you connect that via cable and disable Wi-Fi?

Do you have any weird and wonderful network setup - private DNS server, local routing table entries on the “strange” PC, multiple DHCP servers etc?

Pete.

I just noticed that I´ve made a mistake. I have somehow mixed those different WiFi-Manager-libraries. Now when I use the “WiFiManager-development”-library, I managed to connect with my phone and WiFi-manager. It still directed to 192.168.244.1 and asked many things there in the config, but I filled only those SSID and password-fields. And it connected.

So seems like it was because of wrong WiFi-manager-library. Done only one test now, but looks promising.

Thanks for your help. I do more tests and see if it really works.

1 Like

No. Seems like my phone just made it look like it connected, but I think it only disconnected from NodeMCU`s and picked up the old WiFi from the list automatically. So… Now this ask a lot more in the WiFi-config. SSid, password, Static IP, Static Gateway, Subnet and Static DNS. And it still directs to 192.168.244.1. So when it works it should ask only SSID and Password… right?

This is really weird.

I’m sorry, I don’t really understand the question.

Usually, when people are using WifiManager with Blynk they add fields to the static portal to allow SSID, WiFi Password and Blynk Auth Code to be inputted.

They then use Blynk.begin(auth, ssid, pass); to use a DHCP allocated IP address for the device and connect to Blynk cloud.

If you need to be able to specify a static IP address for your device, as opposed to one allocated by your DHCP server (router) then you’ll need to change your code to manage your own Wi-Fi setup using something like
WiFi.config(device_ip, dns, gateway, subnet);
followed by
Blynk.config(auth, blynk_server, blynk_port);
Blynk.connect();
commands.

Maybe if you explained a little more about what exactly you’re trying to achieve, why you need to use a library like WiFiManager rather than hard-coding credentials, and sort of scenarios where your devices are likely to be used, we’d be able to give you more targeted advice.

Pete.

Well… This is a automatic hydroponic system, which checks the water level using ultrasound sensor and uses valves and pumps during watering process. Here´s part of the code, whole code is too long here… To this I´d like to include WiFi-Manager cause I´d like to make couple more of these… For my friends without profiting. But still it´s too hard to use hardcoded method here. Maybe I try with other computer… this is so strange anyway.


/**************************************************************

   Samsara Exit Hydroponics V1.0

  13.03.2019

   Hydroponics System for NodeMCU 1.0

 * ************************************************************

Blynk app Tab-1:

   V0: On-Off Button (Water Pump ON/OFF)
   V1: Value Display
   V2: On-off button (Lights Manual)
   V3: Terminal  // Label will be the clock + wifi signal
   V4: On-Off Button (Main watering ON/OFF)
   V5: On-Off Button (Water Leak Sensor ON/OFF)
   V7: Virtual LED (lights)
   V8: Segmented switch (1-Veg, 2-Bloom1, 3-Bloom2, 4-Plain Water, 5-Drain and End)
   V10: Timer - Time Input widget on V10
   V11: On-Off button (Lights Timer)

Blynk app Tab-2 (settings):

V6: Numeric Input Display (Water Capacity (Litres)
V9: Numeric Input Display (Drain Time (minutes)
V12: Numeric Input Display (Water Level Full (distance from the sensor cm)
V13: Numeric Input Display (Water Level Low (distance from the sensor cm)
V14: Numeric Input Display (Vegetative State - Fertilizer A (Grow) Ml/100L)
V15: Numeric Input Display (Vegetative State - Fertilizer B (Bloom) Ml/100L)
V16: Numeric Input Display (Vegetative State - Fertilizer C (Micro) Ml/100L)
V17: Numeric Input Display (Bloom 1 State - Fertilizer A (Grow) Ml/100L)
V18: Numeric Input Display (Bloom 1 State - Fertilizer B (Bloom) Ml/100L)
V19: Numeric Input Display (Bloom 1 State - Fertilizer C (Micro) Ml/100L)
V20: Numeric Input Display (Bloom 2 State - Fertilizer A (Grow) Ml/100L)
V21: Numeric Input Display (Bloom 2 State - Fertilizer B (Bloom) Ml/100L)
V22: Numeric Input Display (Bloom 2 State - Fertilizer C (Micro) Ml/100L)
V23: Numeric Input Display  (Water Pump OFF time (minutes)
V24: Numeric Input Display (Water Pump ON time (minutes)

 **************************************************************/

#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h>
#include <TimeLib.h>
#include <WidgetRTC.h>
#include <SPI.h>


SimpleTimer timer;

WidgetRTC rtc;
WidgetTerminal terminal(V3);

#define server "blynk.cloud-com"   // or "blynk.cloud-com" for Blynk's cloud server


char Date[16];
char Time[16];
char auth[] = "***********";
char ssid[] = "*********";
char pass[] = "**********";
long startsecondswd;            // weekday start time in seconds
long stopsecondswd;             // weekday stop  time in seconds
long nowseconds;                // time now in seconds
bool isFirstConnect = true;


// Set water sensor analog pins

float water_sensor_a = A0;
float sensorValue = 0;

float capacityAdjustValue = 0;
float WaterFullOutputValue = 0;
float WaterLowOutputValue = 0;
float WaterLevelMeterAdjustValue = 0;


unsigned long WaterPumpUserONPeriod = 0;  //Set Water Pump Open Time
unsigned long WaterPumpUserOFFPeriod = 0;  //Set Water Pump Closed Time
//int WaterPumpState = LOW;



unsigned long DrainValvePeriod = 0;  //Set Drain Valve Open Time

unsigned long PumpAVPeriod = 0;  //Fertilizer Pump 1 Fertilizer A (GROW) ON Vegetative State period
unsigned long PumpBVPeriod = 0;  //Fertilizer Pump 2 Fertilizer B (BLOOM) ON Vegetative State period
unsigned long PumpCVPeriod = 0;  //Fertilizer Pump 3 Fertilizer C (MICRO) ON Vegetative State period

unsigned long PumpABPeriod = 0;  //Fertilizer Pump 1 Fertilizer A (GROW) ON BLOOM 1 State period
unsigned long PumpBBPeriod = 0;  //Fertilizer Pump 2 Fertilizer B (BLOOM) ON BLOOM 1 State period
unsigned long PumpCBPeriod = 0;  //Fertilizer Pump 3 Fertilizer C (MICRO) ON BLOOM 1 State period

unsigned long PumpABFPeriod = 0;  //Fertilizer Pump 1 Fertilizer A (GROW) ON BLOOM 2 State period
unsigned long PumpBBFPeriod = 0;  //Fertilizer Pump 2 Fertilizer B (BLOOM) ON BLOOM 2 State period
unsigned long PumpCBFPeriod = 0;  //Fertilizer Pump 3 Fertilizer C (MICRO) ON BLOOM 2 State period

unsigned long DrainValveStartMillis;

unsigned long PumpABStartMillis;
unsigned long PumpBBStartMillis;
unsigned long PumpCBStartMillis;

unsigned long PumpABFStartMillis;
unsigned long PumpBBFStartMillis;
unsigned long PumpCBFStartMillis;

unsigned long PumpAVStartMillis;
unsigned long PumpBVStartMillis;
unsigned long PumpCVStartMillis;

unsigned long WaterPumpStartMillis;
unsigned long WaterPumpCurrentMillis = 0;

unsigned long DrainValveCurrentMillis = 0;

unsigned long PumpABCurrentMillis = 0;
unsigned long PumpBBCurrentMillis = 0;
unsigned long PumpCBCurrentMillis = 0;

unsigned long PumpAVCurrentMillis = 0;
unsigned long PumpBVCurrentMillis = 0;
unsigned long PumpCVCurrentMillis = 0;

unsigned long PumpABFCurrentMillis = 0;
unsigned long PumpBBFCurrentMillis = 0;
unsigned long PumpCBFCurrentMillis = 0;

#define DHTPIN3 = 0;  //D3
#define DHTPIN4 = 2;  //D4
#define DHTPIN5 = 14; //D5
#define DHTPIN6 = 12; //D6
#define DHTPIN7 = 13; //D7
#define DHTPIN8 = 15; //D8
#define DHTPIN0 = 16;  //D0


enum VEGWaterStates {IsVEGWaterNeeded, VEGStep1, VEGStep2, VEGStep3, VEGStep4, VEGWaterNotNeeded, VEGWaterNeeded};
VEGWaterStates VEGState = IsVEGWaterNeeded;

enum BLOOMWaterStates {IsBLOOMWaterNeeded, BLOOMStep1, BLOOMStep2, BLOOMStep3, BLOOMStep4, BLOOMWaterNotNeeded, BLOOMWaterNeeded};
BLOOMWaterStates BLOOMState = IsBLOOMWaterNeeded;

enum BLOOMFWaterStates {IsBLOOMFWaterNeeded, BLOOMFStep1, BLOOMFStep2, BLOOMFStep3, BLOOMFStep4, BLOOMFWaterNotNeeded, BLOOMFWaterNeeded};
BLOOMFWaterStates BLOOMFState = IsBLOOMFWaterNeeded;

enum PLAINWaterStates {IsPLAINWaterNeeded, PLAINStep1, PLAINStep2, PLAINWaterNotNeeded, PLAINWaterNeeded};
PLAINWaterStates PLAINState = IsPLAINWaterNeeded;

enum DRAINWaterStates {IsDRAINWaterNeeded, DRAINStep1, DRAINStep2, DRAINWaterNotNeeded, DRAINWaterNeeded};
DRAINWaterStates DRAINState = IsDRAINWaterNeeded;

enum WateringStates {WateringON, WateringOFF};
WateringStates WateringState = WateringOFF;


enum LowWaterNotifyStates {LowWaterNotifyDone, LowWaterNotifyUnDone};
LowWaterNotifyStates LowWaterNotifyState = LowWaterNotifyUnDone;


enum LeakStates {WaterLeakNO, WaterLeakYES};
LeakStates LeakState = WaterLeakNO;


enum WaterPumpStates {WaterPumpON, WaterPumpOFF};
WaterPumpStates WaterPumpState = WaterPumpON;

enum WaterPumpUserStates {WaterPumpUserON, WaterPumpUserOFF};
WaterPumpUserStates WaterPumpUserState = WaterPumpUserON;

enum MainWateringStates {MainWateringON, MainWateringOFF};
MainWateringStates MainWateringState = MainWateringON;

enum LeakSensorStates {LeakSensorON, LeakSensorOFF};
LeakSensorStates LeakSensorState = LeakSensorON;

byte MainValveState = LOW;
byte DrainValveState = LOW;
byte PumpAState = LOW;
byte PumpBState = LOW;
byte PumpCState = LOW;

int RELAY1 = D3; //Main Valve
int RELAY2 = D4; //Lights ON/OFF

const byte RELAY6 = D8; //Drain Valve

const byte RELAY3 = D5; //Fertilizer Pump 1 GROW
const byte RELAY4 = D6; //Fertilizer Pump 2 BLOOM
const byte RELAY5 = D7; //Fertilizer Pump 3 MICRO

const byte RELAY7 = D0; //Water Pump


String displaycurrenttimepluswifi;
int wifisignal;
int manual = 0;
int oldstatus;

int uptoyou;


//-------------------
//ultrasound sensor:

unsigned long echo = 0;
int ultraSoundSignal = 5; // Ultrasound trig signal pin D1
int ultraSoundSignalIN = 4; // Ultrasound echo signal pin D2

unsigned long ultrasoundValue = 0;



void setup()
{
  pinMode(RELAY1, OUTPUT);
  pinMode(RELAY2, OUTPUT);
  pinMode(RELAY3, OUTPUT);
  pinMode(RELAY4, OUTPUT);
  pinMode(RELAY5, OUTPUT);
  pinMode(RELAY6, OUTPUT);
  pinMode(RELAY7, OUTPUT);

  digitalWrite(RELAY1, LOW); // set Main Valve OFF

  digitalWrite(RELAY2, LOW); // set LIGHTS OFF
  digitalWrite(RELAY3, LOW); // set Fertilizer Pump 1 GROW OFF
  digitalWrite(RELAY4, LOW); // set Fertilizer Pump 2 BLOOM OFF
  digitalWrite(RELAY5, LOW); // set Fertilizer Pump 3 MICRO OFF
  digitalWrite(RELAY6, LOW); // set Drain Valve OFF
  digitalWrite(RELAY7, LOW); // set Water Pump OFF

  pinMode(ultraSoundSignal, OUTPUT);
  pinMode(ultraSoundSignalIN, INPUT);

  Serial.begin(115200);
  Serial.println("\Starting");
  Blynk.begin(auth, ssid, pass, IPAddress(139, 59, 206, 133), 80);
  int mytimeout = millis() / 1000;

  WaterPumpStartMillis = millis();  //initial start time of Water Pump

  while (Blynk.connect() == false) { // try to connect to server for 10 seconds
    if ((millis() / 1000) > mytimeout + 8) { // try local server if not connected within 9 seconds
      break;
    }
  }
  rtc.begin();
  timer.setInterval(10000L, activetoday);  // check every 10 SECONDS if schedule should run today
  timer.setInterval(30000L, reconnectBlynk);  // check every 30s if still connected to server
  timer.setInterval(5000L, clockvalue);  // check value for time
  timer.setInterval(5000L, sendWifi);    // Wi-Fi singal
  timer.setInterval(1000L, ultrasoundsensor_send); //ultrasoundsensorvalue
  timer.setInterval(2000L, MoistureSensor); // Moisture Sensor Value

}


unsigned long ping()
{
  pinMode(ultraSoundSignal, OUTPUT); // Switch signalpin to output
  digitalWrite(ultraSoundSignal, LOW); // Send low pulse
  delayMicroseconds(2); // Wait for 2 microseconds
  digitalWrite(ultraSoundSignal, HIGH); // Send high pulse
  delayMicroseconds(15); // Wait for 15 microseconds
  digitalWrite(ultraSoundSignal, LOW); // Holdoff
  pinMode(ultraSoundSignalIN, INPUT); // Switch signalpin to input
  digitalWrite(ultraSoundSignalIN, HIGH); // Turn on pullup resistor
  // please note that pulseIn has a 1sec timeout, which may
  // not be desirable. Depending on your sensor specs, you
  // can likely bound the time like this — marcmerlin
  // echo = pulseIn(ultraSoundSignal, HIGH, 38000)
  echo = pulseIn(ultraSoundSignalIN, HIGH); //Listen for echo
  Serial.println(echo);
  ultrasoundValue = (echo / 58.138); // * .39; //convert to CM then to inches


 

BLYNK_WRITE(V6)  //Water Capacity Value Input
{
  int capacityValueIn = param.asInt(); //Get value as integer
  capacityAdjustValue = capacityValueIn * 100.00 / 10000.00; //Calculate User Water Capacity Adjusting Value

}

BLYNK_WRITE(V9)  //Drain Time Value Calculations
{
  int DrainTimeValueIn = param.asInt(); //Get value as integer
  DrainValvePeriod = DrainTimeValueIn * 60000;  //Calculate User Drain Time Value

}

BLYNK_WRITE(V24)  //Water Pump ON Time Value Calculations
{
  int WaterPumpONTimeValueIn = param.asInt(); //Get value as integer
  WaterPumpUserONPeriod = WaterPumpONTimeValueIn * 60000;  //Calculate User Water Pump ON Time Value
}

BLYNK_WRITE(V23)  //Water Pump OFF Time Value Calculations
{
  int WaterPumpOFFTimeValueIn = param.asInt(); //Get value as integer
  WaterPumpUserOFFPeriod = WaterPumpOFFTimeValueIn * 60000;  //Calculate User Water Pump OFF Time Value
}

BLYNK_WRITE(V12)  //Water Level Full Distance Value Calculations
{
  int WaterFullValueIn = param.asInt(); //Get value as integer
  float WaterFullAdjustValue = WaterFullValueIn * 100.00 / 10000.00; //Calculate User Water Full Adjusting Value
  WaterFullOutputValue = (WaterFullAdjustValue  * 2860.00) * 2; //Calculate User Water Full Value (2860.00 = 50cm)
}

BLYNK_WRITE(V13)  //Water Level Low Distance & Water Level Meter Adjust Values Calculations
{
  int WaterLowValueIn = param.asInt(); //Get value as integer
  float WaterLowAdjustValue = WaterLowValueIn * 100.00 / 10000.00; //Calculate User Water Low Adjusting Value
  WaterLowOutputValue = (WaterLowAdjustValue  * 2860.00) * 2; //Calculate User Water Low Value (2860.00 = 50cm)
  WaterLevelMeterAdjustValue = (WaterLowOutputValue - WaterFullOutputValue) / 20; // Calculate Water Level Meter Adjust Value. 5% of the User Water Level Scale

}

BLYNK_WRITE(V14)  //Vegetative State Fertilizer A (Grow) Value Calculations
{
  int VegFertAValueIn = param.asInt(); //Get value as integer
  float VegFertAAdjustValue = VegFertAValueIn * 100.00 / 10000.00; //Calculate User Vegetative State Fertilizer A (Grow) Adjusting Value
  PumpAVPeriod = (VegFertAAdjustValue * 62000) * capacityAdjustValue; //Calculate User Vegetative State Fertilizer A (Grow) Output Value (62000 = 100Ml)
}

BLYNK_WRITE(V15)  //Vegetative State Fertilizer B (Bloom) Value Calculations
{
  int VegFertBValueIn = param.asInt(); //Get value as integer
  float VegFertBAdjustValue = VegFertBValueIn * 100.00 / 10000.00; //Calculate User Vegetative State Fertilizer B (Bloom) Adjusting Value
  PumpBVPeriod = (VegFertBAdjustValue * 62000) * capacityAdjustValue; //Calculate User Vegetative State Fertilizer B (Bloom) Output Value (62000 = 100Ml)
}

BLYNK_WRITE(V16)  //Vegetative State Fertilizer C (Micro) Value Calculations
{
  int VegFertCValueIn = param.asInt(); //Get value as integer
  float VegFertCAdjustValue = VegFertCValueIn * 100.00 / 10000.00; //Calculate User Vegetative State Fertilizer C (Micro) Adjusting Value
  PumpCVPeriod = (VegFertCAdjustValue * 62000) * capacityAdjustValue; //Calculate User Vegetative State Fertilizer C (Micro) Output Value (62000 = 100Ml)
}


//Bloom 1 State Fertilizer Calculations


BLYNK_WRITE(V17)  //Bloom 1 State Fertilizer A (Grow) Value Calculations
{
  int Bloom1FertAValueIn = param.asInt(); //Get value as integer
  float Bloom1FertAAdjustValue = Bloom1FertAValueIn * 100.00 / 10000.00; //Calculate User Bloom 1 State Fertilizer A (Grow) Adjusting Value
  PumpABPeriod = (Bloom1FertAAdjustValue * 62000) * capacityAdjustValue; //Calculate User Bloom 1 State Fertilizer A (Grow) Output Value (62000 = 100Ml)
}

BLYNK_WRITE(V18)  //Bloom 1 State Fertilizer B (Bloom) Value Calculations
{
  int Bloom1FertBValueIn = param.asInt(); //Get value as integer
  float Bloom1FertBAdjustValue = Bloom1FertBValueIn * 100.00 / 10000.00; //Calculate User Bloom 1 State Fertilizer B (Bloom) Adjusting Value
  PumpBBPeriod = (Bloom1FertBAdjustValue * 62000) * capacityAdjustValue; //Calculate User Bloom 1 State Fertilizer B (Bloom) Output Value (62000 = 100Ml)
}

BLYNK_WRITE(V19)  //Bloom 1 State Fertilizer C (Micro) Value Calculations
{
  int Bloom1FertCValueIn = param.asInt(); //Get value as integer
  float Bloom1FertCAdjustValue = Bloom1FertCValueIn * 100.00 / 10000.00; //Calculate User Bloom 1 State Fertilizer C (Micro) Adjusting Value
  PumpCBPeriod = (Bloom1FertCAdjustValue * 62000) * capacityAdjustValue; //Calculate User Bloom 1 State Fertilizer C (Micro) Output Value (62000 = 100Ml)
}

//Bloom 2 State Fertilizer Calculations


BLYNK_WRITE(V20)  //Bloom 2 State Fertilizer A (Grow) Value Calculations
{
  int Bloom2FertAValueIn = param.asInt(); //Get value as integer
  float Bloom2FertAAdjustValue = Bloom2FertAValueIn * 100.00 / 10000.00; //Calculate User Bloom 2 State Fertilizer A (Grow) Adjusting Value
  PumpABFPeriod = (Bloom2FertAAdjustValue * 62000) * capacityAdjustValue; //Calculate User Bloom 2 State Fertilizer A (Grow) Output Value (62000 = 100Ml)
}

BLYNK_WRITE(V21)  //Bloom 2 State Fertilizer B (Bloom) Value Calculations
{
  int Bloom2FertBValueIn = param.asInt(); //Get value as integer
  float Bloom2FertBAdjustValue = Bloom2FertBValueIn * 100.00 / 10000.00; //Calculate User Bloom 2 State Fertilizer B (Bloom) Adjusting Value
  PumpBBFPeriod = (Bloom2FertBAdjustValue * 62000) * capacityAdjustValue; //Calculate User Bloom 2 State Fertilizer B (Bloom) Output Value (62000 = 100Ml)
}

BLYNK_WRITE(V22)  //Bloom 2 State Fertilizer C (Micro) Value Calculations
{
  int Bloom2FertCValueIn = param.asInt(); //Get value as integer
  float Bloom2FertCAdjustValue = Bloom2FertCValueIn * 100.00 / 10000.00; //Calculate User Bloom 2 State Fertilizer C (Micro) Adjusting Value
  PumpCBFPeriod = (Bloom2FertCAdjustValue * 62000) * capacityAdjustValue; //Calculate User Bloom 2 State Fertilizer C (Micro) Output Value (62000 = 100Ml)
}

void sendUptime()
{
  // This function sends Arduino's up time every second to Virtual Pin (5).
  // In the app, Widget's reading frequency should be set to PUSH. This means
  // that you define how often to send data to Blynk App.

  Blynk.virtualWrite(V5, millis() / 1000);
  Blynk.virtualWrite(V6, millis() / 1000);
}



BLYNK_CONNECTED() {
  if (isFirstConnect) {
    Blynk.syncAll();
    Blynk.notify("TIMER STARTING!!!!");
    isFirstConnect = false;


  }
}


BLYNK_WRITE (V8) {

  switch (param.asInt())
  {

    case 1: // Vegetative Mix

      if (echo >= WaterLowOutputValue && echo < 9000)
      {

        VEGMachine();
      }
      else
      {
        if (WateringState == WateringON)
        {
          VEGMachine();
        }
      }

      break;

    case 2: // Bloom Mix

      if (echo >= WaterLowOutputValue && echo < 9000)
      {

        BLOOMMachine();
      }
      else
      {
        if (WateringState == WateringON)
        {
          BLOOMMachine();
        }
      }
      break;


    case 3: // Bloom Final Mix

      if (echo >= WaterLowOutputValue && echo < 9000)
      {

        BLOOMFMachine();
      }
      else
      {
        if (WateringState == WateringON)
        {
          BLOOMFMachine();
        }
      }
      break;

    case 4: // Plain Water Mix

      if (echo >= WaterLowOutputValue && echo < 9000)
      {

        PLAINMachine();
      }
      else
      {
        if (WateringState == WateringON)
        {
          PLAINMachine();
        }
      }
      break;

    case 5: // Drain All And Stop Growing

      DRAINMachine();
      break;

    default:
      // if nothing else matches, do the default
      // default is optional
      //watermixVEG();
      break;
  }

}


void ultrasoundsensor_send()

{
  int x = 0;
  x = ping();
  //Serial.println(x);
  //  delay(500); //delay 1/2 seconds.
}



void sendWifi() {
  wifisignal = map(WiFi.RSSI(), -105, -40, 0, 100);
}

void clockvalue() // Digital clock display of the time
{

  int gmthour = hour();
  if (gmthour == 24) {
    gmthour = 0;
  }
  String displayhour =   String(gmthour, DEC);
  int hourdigits = displayhour.length();
  if (hourdigits == 1) {
    displayhour = "0" + displayhour;
  }
  String displayminute = String(minute(), DEC);
  int minutedigits = displayminute.length();
  if (minutedigits == 1) {
    displayminute = "0" + displayminute;
  }

  displaycurrenttimepluswifi = "                                          Clock:  " + displayhour + ":" + displayminute + "               Signal:  " + wifisignal + " %";
  Blynk.setProperty(V3, "label", displaycurrenttimepluswifi);

}


void activetoday() {       // check if schedule should run today
  if (year() != 1970) {

    if (uptoyou == 1) {
      Blynk.syncVirtual(V10); // sync timeinput widget
    }
  }
}

void checklastbuttonpressed () {

  if (uptoyou == 1) {
    oldstatus = 5;
  }
  if (uptoyou == 0) {
    oldstatus = 6;
  }
}


void restorelastbuttonpressed () {

  if (oldstatus == 5) {
    uptoyou = 1;
    Blynk.virtualWrite(V11, 1);
  }
  if (oldstatus == 6) {

    uptoyou = 0;

    Blynk.virtualWrite(V11, 0);
  }
}


void resetTerminal()
{
  terminal.println();
  terminal.println();
  terminal.println();
  terminal.println("TIMER has been selected");
  terminal.println("Wait for update (10 seconds as maximum)");
  terminal.println();
  //terminal.println();
  //terminal.println();
  terminal.flush();
}

void resetManual()
{
  Blynk.virtualWrite(V1, 0);   //Turn OFF Manual Mode Widget
  Blynk.virtualWrite(V2, 0);   //Turn OFF Button Widget Device
  Blynk.virtualWrite(V7, 0); //Turn OFF virtual LED V7
  digitalWrite(RELAY2, LOW); // set LIGHTS OFF
}


BLYNK_WRITE(V2)  // ON-OFF Manual
{
  if (param.asInt() == 1) { //
    terminal.println();
    terminal.println();
    terminal.println();
    terminal.println("Manual MODE is ON");
    terminal.println("Press ON/OFF button if required");
    terminal.println("Lights Are ON");
    terminal.println();
    // terminal.println();
    terminal.flush();

    if (manual == 0) { 
      checklastbuttonpressed ();
      manual = 1;

      uptoyou = 0;

      Blynk.virtualWrite(V11, 0);
      Blynk.virtualWrite(V7, 1023); //Turn ON virtual LED V7
      digitalWrite(RELAY2, HIGH); // set LIGHTS ON
      Blynk.virtualWrite(V2, 1);   //Turn ON Button Widget

    } else {             //está en modo manual

      uptoyou = 0;

      Blynk.virtualWrite(V11, 0);
      Blynk.virtualWrite(V7, 1023); //Turn ON virtual LED V7
      digitalWrite(RELAY2, HIGH); // set LIGHTS ON
      Blynk.virtualWrite(V2, 1);   //Turn ON Button Widget
    }
  } else {

    terminal.println();
    terminal.println();
    terminal.println();
    terminal.println("Manual MODE is ON");
    terminal.println("Press ON/OFF button if required");
    terminal.println("Light Are OFF");
    terminal.println();
    //terminal.println();
    terminal.flush();

    if (manual == 0) {   //modo automático
      checklastbuttonpressed ();
      manual = 1;

      uptoyou = 0;

      Blynk.virtualWrite(V11, 0);
      Blynk.virtualWrite(V7, 0); //Turn OFF virtual LED V7
      digitalWrite(RELAY2, LOW); // set LIGHTS OFF
      Blynk.virtualWrite(V2, 0);   //Turn OFF Button Widget
    } else {

      uptoyou = 0;

      Blynk.virtualWrite(V11, 0);
      Blynk.virtualWrite(V7, 0); //Turn OFF virtual LED V7
      digitalWrite(RELAY2, LOW); // set LIGHTS OFF
      Blynk.virtualWrite(V2, 0);   //Turn OFF Button Widget
    }
  }
}


BLYNK_WRITE(V0)  // ON-OFF Water Pump
{
  if (param.asInt() == 1) { 
    terminal.println();
    terminal.println();
    terminal.println();
    terminal.println();
    terminal.println();
    terminal.println("Water Pump Manual ON");
    terminal.println();
    // terminal.println();
    terminal.flush();
    Serial.println("Water Pump Manual ON");
    LeakState = WaterLeakNO;
    WaterPumpState = WaterPumpON;


  } else {

    terminal.println();
    terminal.println();
    terminal.println();
    terminal.println();
    terminal.println();
    terminal.println("Water Pump Manual OFF");
    terminal.println();
    //terminal.println();
    terminal.flush();
    Serial.println("Water Pump Manual OFF");

    WaterPumpState = WaterPumpOFF;

  }
}



BLYNK_WRITE(V4)  // ON-OFF Main Watering
{
  if (param.asInt() == 1) { // boton encendido
    terminal.println();
    terminal.println();
    terminal.println();
    terminal.println();
    terminal.println();
    terminal.println("Main Watering ON");
    terminal.println();
    // terminal.println();
    terminal.flush();
    Serial.println("Main Watering ON");
    MainWateringState = MainWateringON;



  } else {

    terminal.println();
    terminal.println();
    terminal.println();
    terminal.println();
    terminal.println();
    terminal.println("Main Watering OFF");
    terminal.println();
    //terminal.println();
    terminal.flush();


    digitalWrite(RELAY1, LOW);  //change the state of the Main Valve to Closed


    //    Serial.println("Main Valve Closed");
    MainValveState = LOW;


    digitalWrite(RELAY6, LOW);  //change the state of the Drain Valve to Closed
    DrainValveState = LOW;


    digitalWrite(RELAY3, LOW);  //change the state of the Fertilizer Pump 1 (GROW) to Closed
    PumpAState = LOW;

    digitalWrite(RELAY4, LOW);  //change the state of the Fertilizer Pump 2 (BLOOM) to Closed
    PumpBState = LOW;

    digitalWrite(RELAY5, LOW);  //change the state of the Fertilizer Pump 3 (MICRO) to Closed
    PumpCState = LOW;

    Serial.println("All Fertilizer Pumps + Drain & Main Valves Closed");


    WateringState = WateringOFF;
    BLOOMState = IsBLOOMWaterNeeded;
    BLOOMFState = IsBLOOMFWaterNeeded;
    VEGState = IsVEGWaterNeeded;
    PLAINState = IsPLAINWaterNeeded;
    DRAINState = IsDRAINWaterNeeded;
    Serial.println("Main Watering OFF");

    MainWateringState = MainWateringOFF;
  }
}


BLYNK_WRITE(V5)  // ON-OFF WaterLeak Sensor
{
  if (param.asInt() == 1) { // boton encendido
    terminal.println();
    terminal.println();
    terminal.println();
    terminal.println();
    terminal.println();
    terminal.println("Leak Sensor Is ON");
    terminal.println();
    // terminal.println();
    terminal.flush();

    LeakSensorState = LeakSensorON;

  } else {

    terminal.println();
    terminal.println();
    terminal.println();
    terminal.println();
    terminal.println();
    terminal.println("Leak Sensor Is OFF");
    terminal.println();
    //terminal.println();
    terminal.flush();

    LeakSensorState = LeakSensorOFF;
  }
}

BLYNK_WRITE(V11)  // Up to you selected
{
  if (param.asInt() == 1) {
    timer.setTimeout(50, resetTerminal);
    timer.setTimeout(50, resetManual);
    timer.setTimeout(50, checklastbuttonpressed);

    uptoyou = 1;

  } else {

    uptoyou = 0;
  }
}

BLYNK_WRITE(V10)//Up to you
{
  if (uptoyou == 1) {
    sprintf(Date, "%02d/%02d/%04d",  day(), month(), year());
    sprintf(Time, "%02d:%02d:%02d", hour(), minute(), second());

    TimeInputParam t(param);

    terminal.print("TIMER Checked schedule at: ");
    terminal.println(Time);
    terminal.flush();
    int dayadjustment = -1;
    if (weekday() == 1) {
      dayadjustment =  6; // needed for Sunday, Time library is day 1 and Blynk is day 7
    }
    if (t.isWeekdaySelected(weekday() + dayadjustment)) { //Time library starts week on Sunday, Blynk on Monday
      terminal.println("TIMER ACTIVE today");
      terminal.flush();
      if (t.hasStartTime()) // Process start time
      {
        terminal.println(String("Start: ") + t.getStartHour() + ":" + t.getStartMinute());
        terminal.flush();
      }
      if (t.hasStopTime()) // Process stop time
      {
        terminal.println(String("Stop : ") + t.getStopHour() + ":" + t.getStopMinute());
        terminal.flush();
      }
      // Display timezone details, for information purposes only
      terminal.println(String("Time zone: ") + t.getTZ()); // Timezone is already added to start/stop time
      terminal.println("At least ONE day MUST be selected");
      // terminal.println(String("Time zone offset: ") + t.getTZ_Offset()); // Get timezone offset (in seconds)
      terminal.flush();

      for (int i = 1; i <= 7; i++) {  // Process weekdays (1. Mon, 2. Tue, 3. Wed, ...)
        if (t.isWeekdaySelected(i)) {
          terminal.println(String("Day ") + i + " is selected");
          terminal.flush();
        }
      }
      nowseconds = ((hour() * 3600) + (minute() * 60) + second());
      startsecondswd = (t.getStartHour() * 3600) + (t.getStartMinute() * 60);
      //Serial.println(startsecondswd);  // used for debugging
      if (nowseconds >= startsecondswd) {
        terminal.print("TIMER STARTED at");
        terminal.println(String(" ") + t.getStartHour() + ":" + t.getStartMinute());
        terminal.flush();
        if (nowseconds <= startsecondswd + 90) {  // 90s on 60s timer ensures 1 trigger command is sent

          Blynk.virtualWrite(V7, 1023); //Turn ON virtual LED V7
          digitalWrite(RELAY2, HIGH); // set LIGHTS ON
          Blynk.virtualWrite(V2, 0);   //Turn OFF Button Widget

          // code here to switch the relay ON
        }
      }
      else {
        terminal.println("Lights Are OFF");
        terminal.flush();

      }
      stopsecondswd = (t.getStopHour() * 3600) + (t.getStopMinute() * 60);
      //Serial.println(stopsecondswd);  // used for debugging
      if (nowseconds >= stopsecondswd) {

        Blynk.virtualWrite(V7, 0); //Turn OFF virtual LED V7
        digitalWrite(RELAY2, LOW); // set LIGHTS OFF
        Blynk.virtualWrite(V2, 0);
        terminal.print("TIMER STOPPED at");
        terminal.println(String(" ") + t.getStopHour() + ":" + t.getStopMinute());

        terminal.flush();
        if (nowseconds <= stopsecondswd + 90) { // 90s on 60s timer ensures 1 trigger command is sent

          Blynk.virtualWrite(V7, 0); //Turn OFF virtual LED V7
          digitalWrite(RELAY2, LOW); // set LIGHTS OFF
          Blynk.virtualWrite(V2, 0);
          // code here to switch the relay OFF
        }
      }
      else {
        if (nowseconds >= startsecondswd) {

          Blynk.virtualWrite(V7, 0); //Turn OFF virtual LED V7
          digitalWrite(RELAY2, HIGH); // set LIGHTS ON
          Blynk.virtualWrite(V2, 0);
          terminal.println("Lights Are ON");
          terminal.flush();

        }
      }
    }
    else {
      terminal.println("TIMER INACTIVE today");
      terminal.flush();
      // nothing to do today, check again in 30 SECONDS time
    }
    terminal.println();
  }
}

void reconnectBlynk() {
  if (!Blynk.connected()) {
    if (Blynk.connect()) {
      BLYNK_LOG("Reconnected");
    } else {
      BLYNK_LOG("Not reconnected");
    }
  }
}

void WaterPump()  //function to ON/OFF Water Pump
{
  if ((WaterPumpUserState == WaterPumpUserON) && (WaterPumpCurrentMillis - WaterPumpStartMillis >= WaterPumpUserONPeriod))  //test whether the period has elapsed
  {
    WaterPumpUserState = WaterPumpUserOFF;
    digitalWrite(RELAY7, LOW);  //if so, change the state of the Water Pump to OFF
    WaterPumpStartMillis = WaterPumpCurrentMillis;  //IMPORTANT to save the start time of the current RELAY state.
    Serial.println("Water Pump OFF");
    terminal.println();
    terminal.println();
    terminal.println();
    terminal.println();
    terminal.println();
    terminal.println("Water Pump Turned OFF");
    terminal.println();
    // terminal.println();
    terminal.flush();
  }
   else if ((WaterPumpUserState == WaterPumpUserOFF) && (WaterPumpCurrentMillis - WaterPumpStartMillis >= WaterPumpUserOFFPeriod))  //test whether the period has elapsed
  {
    WaterPumpUserState = WaterPumpUserON;
    digitalWrite(RELAY7, HIGH);  //if so, change the state of the Water Pump to ON
    WaterPumpStartMillis = WaterPumpCurrentMillis;  //IMPORTANT to save the start time of the current RELAY state.
    Serial.println("Water Pump ON");
    terminal.println();
    terminal.println();
    terminal.println();
    terminal.println();
    terminal.println();
    terminal.println("Water Pump Turned ON");
    terminal.println();
    // terminal.println();
    terminal.flush();
  }
}


void MoistureSensor()
{

  sensorValue = analogRead(water_sensor_a);
  Serial.println(sensorValue);

  if (sensorValue >= 50 && sensorValue < 900)


    }
  }
  if (sensorValue >= 900 && sensorValue < 1300)
  {

    if (LeakSensorState == LeakSensorON) {

      //      if (LeakStateNotifyState == LeakStateNotifyUnDone) {

      if (LeakState == WaterLeakYES)
      {
        terminal.print("No Water Leak Found Anymore.");
        Blynk.notify("No Water Leak Found Anymore");
        Serial.print("No Water Leak Found Anymore.");


        Blynk.syncVirtual(V0);
        //          LeakStateNotifyState = LeakStateNotifyDone;
        LeakState = WaterLeakNO;

      }
    }
  }
}

void loop()
{

  if (Blynk.connected()) {
    Blynk.run();
  }
  timer.run();
  if (WaterPumpState == WaterPumpON)  {
    if (WateringState == WateringOFF) {

      WaterPumpCurrentMillis = millis();  //get the current time of Water Pump

      WaterPump();
    }
    if (WateringState == WateringON) {
      Blynk.syncVirtual(V8);
    }
  }
}

```cpp

Okay, so you’ve shared a load of code that has no WifiManager items in it, and the only item of interest is the shightly strange way in which you’re doing you’re Blynk.begin…

Blynk.begin(auth, ssid, pass, IPAddress(139, 59, 206, 133), 80);

if you did

Blynk.begin(auth, ssid, pass);

Then it would achieve exactly the same result.

As I said before, the Auth code, SSID and Wi-Fi password are the only three fields that you need to capture when using WifiManager with Blynk Cloud, provided you don’t need your devices to have a static IP address (which you’re not doing at the moment in this code).

If you want examples of how to capture these three items via the WifiManager static portal and save them to EEPROM then you’d be better searching this forum than github.

Pete.

Yeah I´ve tried to test that WiFi-manager by itself before including it to this long code. To find the best way to do it first. So there is no WiFi-manager stuff in this code yet, but you asked about this project so I told you about it.

I try to search the Blynk-forum and keep on struggling. That´s ok I´m used to it.

Thanks.

1 Like

If you get compile errors with that code then you need to downgrade your ArduinoJson library from 6.x.x to 5.13.5

Pete.

Thanks.

I managed to compile this to NodeMCU 1.0. So it directs me again to 192.168.244.1 and ask a lot of things in the config. Blynk token is already filled, so if I fill only SSID and password this is what I get out from serial monitor:


*WM: [1] AP IP address: 192.168.244.1
*WM: [3] setupConfigPortal 
*WM: [1] Starting Web Portal 
*WM: [3] dns server started with ip:  192.168.244.1
*WM: [2] HTTP server started 
*WM: [2] WiFi Scan ASYNC started 
*WM: [2] Config Portal Running, blocking, waiting for clients... 
*WM: [2] NUM CLIENTS: 0 
*WM: [2] WiFi Scan ASYNC completed in 2209 ms
*WM: [2] WiFi Scan ASYNC found: 4
*WM: [3] -> detectportal.firefox.com 
*WM: [2] <- Request redirected to captive portal 
*WM: [2] <- HTTP Root 
*WM: [3] -> 192.168.244.1 
*WM: [3] lastconxresult: WL_IDLE_STATUS
*WM: [2] Scan is cached 16560 ms ago
*WM: [3] -> www.msftncsi.com 
*WM: [2] <- Request redirected to captive portal 
*WM: [3] -> detectportal.firefox.com 
*WM: [2] <- Request redirected to captive portal 
*WM: [2] <- HTTP Root 
*WM: [3] -> 192.168.244.1 
*WM: [3] lastconxresult: WL_IDLE_STATUS
*WM: [2] Scan is cached 19709 ms ago
*WM: [3] -> ncc.avast.com 
*WM: [2] <- Request redirected to captive portal 
*WM: [3] -> detectportal.firefox.com 
*WM: [2] <- Request redirected to captive portal 
*WM: [2] <- HTTP Root 
*WM: [3] -> 192.168.244.1 
*WM: [3] lastconxresult: WL_IDLE_STATUS
*WM: [2] WiFi Scan ASYNC started 
*WM: [2] WiFi Scan ASYNC completed in 2207 ms
*WM: [2] WiFi Scan ASYNC found: 4
*WM: [3] -> ip-info.ff.avast.com 
*WM: [2] <- Request redirected to captive portal 
*WM: [3] -> detectportal.firefox.com 
*WM: [2] <- Request redirected to captive portal 
*WM: [2] <- HTTP Root 
*WM: [3] -> 192.168.244.1 
*WM: [3] lastconxresult: WL_IDLE_STATUS
*WM: [2] Scan is cached 1097 ms ago
*WM: [2] NUM CLIENTS: 1 
*WM: [3] -> detectportal.firefox.com 
*WM: [2] <- Request redirected to captive portal 
*WM: [2] <- HTTP Root 
*WM: [3] -> 192.168.244.1 
*WM: [3] lastconxresult: WL_IDLE_STATUS
*WM: [2] Scan is cached 4347 ms ago
*WM: [3] -> detectportal.firefox.com 
*WM: [2] <- Request redirected to captive portal 
*WM: [2] <- HTTP Root 
*WM: [3] -> 192.168.244.1 
*WM: [3] lastconxresult: WL_IDLE_STATUS
*WM: [2] Scan is cached 7556 ms ago
*WM: [3] -> detectportal.firefox.com 
*WM: [2] <- Request redirected to captive portal 
*WM: [2] <- HTTP Root 
*WM: [3] -> 192.168.244.1 
*WM: [3] lastconxresult: WL_IDLE_STATUS
*WM: [2] Scan is cached 10735 ms ago
*WM: [3] -> detectportal.firefox.com 
*WM: [2] <- Request redirected to captive portal 
*WM: [2] <- HTTP Root 
*WM: [3] -> 192.168.244.1 
*WM: [3] lastconxresult: WL_IDLE_STATUS
*WM: [2] Scan is cached 13916 ms ago
*WM: [3] -> ncc.avast.com 
*WM: [2] <- Request redirected to captive portal 
*WM: [3] -> detectportal.firefox.com 
*WM: [2] <- Request redirected to captive portal 
*WM: [2] <- HTTP Root 
*WM: [3] -> 192.168.244.1 
*WM: [3] lastconxresult: WL_IDLE_STATUS
*WM: [2] Scan is cached 17130 ms ago
*WM: [3] -> detectportal.firefox.com 
*WM: [2] <- Request redirected to captive portal 
*WM: [2] <- HTTP Root 
*WM: [3] -> 192.168.244.1 
*WM: [3] lastconxresult: WL_IDLE_STATUS
*WM: [2] WiFi Scan ASYNC started 
*WM: [2] WiFi Scan ASYNC completed in 2209 ms
*WM: [2] WiFi Scan ASYNC found: 4
*WM: [3] -> www.msftncsi.com 
*WM: [2] <- Request redirected to captive portal 
*WM: [3] -> ncc.avast.com 
*WM: [2] <- Request redirected to captive portal 
*WM: [2] <- HTTP Root 
*WM: [3] -> ncc.avast.com 
*WM: [2] <- Request redirected to captive portal 
*WM: [2] <- HTTP Root 
*WM: [3] -> ncc.avast.com 
*WM: [2] <- Request redirected to captive portal 
*WM: [2] <- HTTP Root 
*WM: [3] -> ncc.avast.com 
*WM: [2] <- Request redirected to captive portal 
*WM: [2] <- HTTP WiFi save  
*WM: [3] Method: POST
*WM: [2] Parameters 
*WM: [2] -------------------- 
*WM: [2] blynk: *************************
*WM: [2] -------------------- 
*WM: [3] static ip: (IP unset)
*WM: [3] static gateway: (IP unset)
*WM: [3] static netmask: (IP unset)
*WM: [3] static DNS: (IP unset)
*WM: [3] Sent wifi save page 
*WM: [2] process connect 
*WM: [2] Connecting as wifi client... 
*WM: [1] STA static IP: (IP unset)
*WM: [2] Custom static IP/GW/Subnet/DNS 
*WM: [2] Custom static DNS 
*WM: [1] STA IP set: (IP unset)
*WM: [3] WIFI station disconnect 
*WM: [1] Connecting to new AP: *************
*WM: [3] Using Password: ************
*WM: [3] WiFi station enable 
*WM: [3] enableSTA PERSISTENT ON 
*WM: [1] connectTimeout not set, ESP waitForConnectResult... 
*WM: [2] Connection result: WL_CONNECTED
*WM: [3] lastconxresult: WL_CONNECTED
*WM: [1] Connect to new AP [SUCCESS] 
*WM: [1] Got IP Address: 
*WM: [1] 192.168.10.54 
Should save config
*WM: [2] disconnect configportal 
*WM: [2] restoring usermode STA
*WM: [2] wifi status: WL_CONNECTED
*WM: [2] wifi mode: STA
*WM: [1] config portal exiting 
connected...yeey :)
saving config
failed to open config file for writing
{"blynk_token":"****************"}BLYNK Connected
*WM: [3] freeing allocated params! 
*WM: [3] unloading 

Browser gets stuck at http://192.168.244.1/wifisave
and says:
"
Saving Credentials
Trying to connect ESP to network.
If it fails reconnect to AP to try again
"
And my laptop (which I used to set the config) is not connected to any network anymore.

What this means? Is NodeMCU connected or not? This is a bit confusing.

Update:

I tried this with 2 more NodeMCU´s and I get the same result. Second time I connect power to NodeMCU the serial monitor gives this:

*WM: [2] Connection result: WL_CONNECTED
*WM: [3] lastconxresult: WL_CONNECTED
*WM: [1] AutoConnect: SUCCESS 
*WM: [1] STA IP Address: 192.168.10.54
connected...yeey :)
BLYNK Connected
*WM: [3] freeing allocated params! 
*WM: [3] unloading 

So seems like it connects to Blynk automatically. So how this works? How can I set new SSID and password for it when I want to use other network? How to reset it?

Sorry I´m totally novice with this WiFi-manager.

Thanks

Can you post your full WifiManager code?

Pete.