WiFiManager icon indicating copy to clipboard operation
WiFiManager copied to clipboard

How to Determine AP Credential Failure using autoConnect()?

Open tonyc770 opened this issue 3 years ago • 5 comments

I am using the autoConnect() function, but if the wrong WiFi credentials are entered there is no feedback while in AP mode. Only when the credentials are correct does the autoConnect() return true, or if there is a timeout, returns false.

Is there a way to detect that the credentials failed?

Thanks...

tonyc770 avatar Jul 31 '21 19:07 tonyc770

I am also interested to know if there's a good way to determine this.

monodop avatar Nov 02 '21 21:11 monodop

you might be able to use

    // get last connection result, includes autoconnect and wifisave
    uint8_t       getLastConxResult();

tablatronix avatar Nov 03 '21 13:11 tablatronix

is there a callback we can use to check once an attempt to save the configuration has been made?

For success, we have setSaveConfigCallback, but I can't see a corresponding callback for failure.

Edit: I also see that you can set setBreakAfterConfig but it would be good to be able to get a callback on failure without aborting the autoConnect

monodop avatar Nov 04 '21 22:11 monodop

Hmm could be handy let me see what works best

tablatronix avatar Nov 06 '21 00:11 tablatronix

Any thoughts?

monodop avatar Jan 05 '22 05:01 monodop