WiFimanager how to know when exiting "Portal"?

Hi!

When entering "Configuration Portal" it's easy to execute code where you find "Serial.println("Configportal running");" here below.

But is there any way to get notice of when leaving the portal? Like a bool set to true when exiting.
Or maybe even more info like status when saving settings or something other useful?

// Example file from: https://github.com/tzapu/WiFiManager/blob/master/examples/NonBlocking/AutoConnectNonBlocking/AutoConnectNonBlocking.ino

#include <WiFiManager.h> // https://github.com/tzapu/WiFiManager
WiFiManager wm;

void setup() {
    WiFi.mode(WIFI_STA); // explicitly set mode, esp defaults to STA+AP    
    // put your setup code here, to run once:
    Serial.begin(115200);
    
    //reset settings - wipe credentials for testing
    //wm.resetSettings();

    wm.setConfigPortalBlocking(false);
    wm.setConfigPortalTimeout(60);
    //automatically connect using saved credentials if they exist
    //If connection fails it starts an access point with the specified name
    if(wm.autoConnect("AutoConnectAP")){
        Serial.println("connected...yeey :)");
    }
    else {
        Serial.println("Configportal running");
    }
}

void loop() {
    wm.process();
    // put your main code here, to run repeatedly:
}

https://github.com/tzapu/WiFiManager#save-settings

I could not make it work the non blocking way, but I don't remember why

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.