[GH-ISSUE #263] Is it possible to reconfigure after autoconnect? #219

Closed
opened 2026-02-28 01:24:08 +03:00 by kerem · 47 comments
Owner

Originally created by @smadds on GitHub (Dec 12, 2016).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/263

This is such a great library. I cannot thank you enough for the time it has saved.

Can I ask how to force a reconfigure after using autoconnect? I read in your docs:

Instead of calling autoConnect() which does all the connecting and failover configuration portal setup for you, you need to use startConfigPortal(). Do not use BOTH.

I would like to give users the opportunity to reconfigure some of the parameters (including the additional ones I have created), even if the unit has connected to wifi. I'd like to look for a continuous button press for a few seconds to trigger the config mode.

Originally created by @smadds on GitHub (Dec 12, 2016). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/263 This is such a great library. I cannot thank you enough for the time it has saved. Can I ask how to force a reconfigure after using autoconnect? I read in your docs: > _Instead of calling autoConnect() which does all the connecting and failover configuration portal setup for you, you need to use startConfigPortal(). Do not use BOTH._ I would like to give users the opportunity to reconfigure some of the parameters (including the additional ones I have created), even if the unit has connected to wifi. I'd like to look for a continuous button press for a few seconds to trigger the config mode.
kerem closed this issue 2026-02-28 01:24:09 +03:00
Author
Owner

@kentaylor commented on GitHub (Dec 13, 2016):

In my view @smadds would be better off to use the IOT configurator for setting parameters other than WiFi configuration.

Here is an example of configuration on button press and here is an example where the button must be pushed for a few seconds to respond, and in this case you see a sliding bar on a screen. A button library is used that detects short press, long press, double press and, is button pressed now.

<!-- gh-comment-id:266644498 --> @kentaylor commented on GitHub (Dec 13, 2016): In my view @smadds would be better off to use the [IOT configurator](http://configure.urremote.com/) for setting parameters other than WiFi configuration. Here is an example of configuration on [button press](https://github.com/kentaylor/WiFiManager/tree/master/examples/ConfigOnSwitch) and here is [an example](https://github.com/kentaylor/esp8266-weather-station/blob/master/examples/WeatherDHT22ThreeScreensWiFiManager/WeatherDHT22ThreeScreensWiFiManager.ino) where the button must be pushed for a few seconds to respond, and in this case you see a sliding bar on a screen. A button library is used that detects short press, long press, double press and, is button pressed now.
Author
Owner

@smadds commented on GitHub (Dec 13, 2016):

Thanks, Ken. I had a look at IOT Configurator and it looks interesting - albeit putting a dependency for a 3rd-party system. My main problem is not the button, but how to reconfigure the WiFi settings within WM. The best I've come up with so far is to use the WM reset function and then restart the device. This is not ideal, however, as it clears all of the settings - but works as a "restore to factory defaults" type of use case.

<!-- gh-comment-id:266669545 --> @smadds commented on GitHub (Dec 13, 2016): Thanks, Ken. I had a look at IOT Configurator and it looks interesting - albeit putting a dependency for a 3rd-party system. My main problem is not the button, but how to reconfigure the WiFi settings within WM. The best I've come up with so far is to use the WM reset function and then restart the device. This is not ideal, however, as it clears all of the settings - but works as a "restore to factory defaults" type of use case.
Author
Owner

@kentaylor commented on GitHub (Dec 13, 2016):

When @smadds says:

but how to reconfigure the WiFi settings within WM.

I don't understand but that's fine.

<!-- gh-comment-id:266704418 --> @kentaylor commented on GitHub (Dec 13, 2016): When @smadds says: > but how to reconfigure the WiFi settings within WM. I don't understand but that's fine.
Author
Owner

@tablatronix commented on GitHub (Dec 29, 2016):

Theres an example called ondemand why not just do that or handle the button press how ever you want to start it. Whats the problem?

<!-- gh-comment-id:269577938 --> @tablatronix commented on GitHub (Dec 29, 2016): Theres an example called ondemand why not just do that or handle the button press how ever you want to start it. Whats the problem?
Author
Owner

@jaygrooms commented on GitHub (Jan 3, 2017):

@smadds Did you ever figure out your button press to factory defaults? I am TOTALLY new to programming and have been beating my head against the wall for about a week trying to figure it out.

Any help you could give would be great!

Tnx
-J

<!-- gh-comment-id:270039116 --> @jaygrooms commented on GitHub (Jan 3, 2017): @smadds Did you ever figure out your button press to factory defaults? I am TOTALLY new to programming and have been beating my head against the wall for about a week trying to figure it out. Any help you could give would be great! Tnx -J
Author
Owner

@tzapu commented on GitHub (Jan 3, 2017):

guys, here s an example that includes logic for a button triggered reset of settings
https://github.com/tzapu/SonoffBoilerplate/blob/master/SonoffBoilerplate.ino

<!-- gh-comment-id:270056236 --> @tzapu commented on GitHub (Jan 3, 2017): guys, here s an example that includes logic for a button triggered reset of settings https://github.com/tzapu/SonoffBoilerplate/blob/master/SonoffBoilerplate.ino
Author
Owner

@tablatronix commented on GitHub (Feb 8, 2017):

or


#define TRIGGER_PIN 0

void setup(){
  pinMode(TRIGGER_PIN, INPUT_PULLUP);
}

//crappy button handler for testing
//erase config reboot
void handleButton(){
  int debounce = 50;
  if ( digitalRead(TRIGGER_PIN) == LOW ){
    delay(debounce);
    if(digitalRead(TRIGGER_PIN) == LOW ){
      WiFiManager wifiManager;      
      wifiManager.resetSettings();
      delay(1000);
      ESP.reset();
    }
  }
}

void loop() {
  handleButton();
}
<!-- gh-comment-id:278396781 --> @tablatronix commented on GitHub (Feb 8, 2017): or ```C++ #define TRIGGER_PIN 0 void setup(){ pinMode(TRIGGER_PIN, INPUT_PULLUP); } //crappy button handler for testing //erase config reboot void handleButton(){ int debounce = 50; if ( digitalRead(TRIGGER_PIN) == LOW ){ delay(debounce); if(digitalRead(TRIGGER_PIN) == LOW ){ WiFiManager wifiManager; wifiManager.resetSettings(); delay(1000); ESP.reset(); } } } void loop() { handleButton(); } ```
Author
Owner

@smadds commented on GitHub (Feb 8, 2017):

My request was to make the web page reset button more protected by adding a
confirm stage, which Theo has kindly done.

There is a button sequence for clearing locally stored settings - hold
button down for more than 4 seconds. See wiki/button page.

One issue I constantly have is a new install tries to connect to Theo's
mqtt server and this has a very long timeout, during which the system is
unresponsive. Beware if this!!

I usually try to get it into web manager mode first (4 button presses) ,
set the log on to its Wi-Fi access point, then configure the client Wi-Fi
ssid & password. I then look for it showing up on my Dhcp server, go to the
web page and update the mqtt before anything else. Lots of reboots, but
once you are at this stage it's plain sailing.

On 3 Jan 2017 01:19, "jaygrooms" notifications@github.com wrote:

@smadds https://github.com/smadds Did you ever figure out your button
press to factory defaults? I am TOTALLY new to programming and have been
beating my head against the wall for about a week trying to figure it out.

Any help you could give would be great!

Tnx
-J


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/tzapu/WiFiManager/issues/263#issuecomment-270039116,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFBCXmX9gT19AZMV23YZe5eMlpqyNBTdks5rOaIPgaJpZM4LLD-o
.

<!-- gh-comment-id:278489980 --> @smadds commented on GitHub (Feb 8, 2017): My request was to make the web page reset button more protected by adding a confirm stage, which Theo has kindly done. There is a button sequence for clearing locally stored settings - hold button down for more than 4 seconds. See wiki/button page. One issue I constantly have is a new install tries to connect to Theo's mqtt server and this has a very long timeout, during which the system is unresponsive. Beware if this!! I usually try to get it into web manager mode first (4 button presses) , set the log on to its Wi-Fi access point, then configure the client Wi-Fi ssid & password. I then look for it showing up on my Dhcp server, go to the web page and update the mqtt before anything else. Lots of reboots, but once you are at this stage it's plain sailing. On 3 Jan 2017 01:19, "jaygrooms" <notifications@github.com> wrote: @smadds <https://github.com/smadds> Did you ever figure out your button press to factory defaults? I am TOTALLY new to programming and have been beating my head against the wall for about a week trying to figure it out. Any help you could give would be great! Tnx -J — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <https://github.com/tzapu/WiFiManager/issues/263#issuecomment-270039116>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AFBCXmX9gT19AZMV23YZe5eMlpqyNBTdks5rOaIPgaJpZM4LLD-o> .
Author
Owner

@tablatronix commented on GitHub (Feb 9, 2017):

Interesting, Button hold and mutiple presses are easy to implement,there are many ways to do that.

I even wrote this to use a reset button to reset stuff.
https://gist.github.com/tablatronix/efa5d525d704e4b8b9ece31af0c99fdf

<!-- gh-comment-id:278528366 --> @tablatronix commented on GitHub (Feb 9, 2017): Interesting, Button hold and mutiple presses are easy to implement,there are many ways to do that. I even wrote this to use a reset button to reset stuff. https://gist.github.com/tablatronix/efa5d525d704e4b8b9ece31af0c99fdf
Author
Owner

@rodri16 commented on GitHub (Aug 2, 2018):

Hi I was wondering how to implement an wifiManager.autoConnect() on Setup and a wifiManager.startConfigPortal() when the button is pressed.
Both work very well separated but together ESP8266 crashes.
The problem with OnDemand example is that ESP8266 doesn't connect from scratch.
I need the device to get connected when it is plugged if the router is available and have the possibility to reconfigure with the button

<!-- gh-comment-id:409871724 --> @rodri16 commented on GitHub (Aug 2, 2018): Hi I was wondering how to implement an wifiManager.autoConnect() on Setup and a wifiManager.startConfigPortal() when the button is pressed. Both work very well separated but together ESP8266 crashes. The problem with OnDemand example is that ESP8266 doesn't connect from scratch. I need the device to get connected when it is plugged if the router is available and have the possibility to reconfigure with the button
Author
Owner

@tablatronix commented on GitHub (Aug 2, 2018):

Just add autoconnect and either 2 wm instances or move the class obj outside of setup

<!-- gh-comment-id:410051329 --> @tablatronix commented on GitHub (Aug 2, 2018): Just add autoconnect and either 2 wm instances or move the class obj outside of setup
Author
Owner

@tablatronix commented on GitHub (Aug 2, 2018):

This exact thing is discussed in another issue i think

<!-- gh-comment-id:410051434 --> @tablatronix commented on GitHub (Aug 2, 2018): This exact thing is discussed in another issue i think
Author
Owner

@tzapu commented on GitHub (Aug 2, 2018):

if WiFi.SSID() is an empty string then you could call autoConnect() and on button you call startConfigPortal()
so in all other cases WiFiManager would be not started.
on most of my sketches i just use autoConnect with setTimeout and a restart on said timeout. if router is unavailable in a few mins, it reboots and tries connecting again. works pretty well (for me)

<!-- gh-comment-id:410078582 --> @tzapu commented on GitHub (Aug 2, 2018): if WiFi.SSID() is an empty string then you could call autoConnect() and on button you call startConfigPortal() so in all other cases WiFiManager would be not started. on most of my sketches i just use autoConnect with setTimeout and a restart on said timeout. if router is unavailable in a few mins, it reboots and tries connecting again. works pretty well (for me)
Author
Owner

@rodri16 commented on GitHub (Aug 9, 2018):

Great I made it work, both with Master and Dev branch. The problem is that with Dev branch after WiFi configuration I cannot connect to a server client to send data or to update the clock using NTP server.
Same code runs ok with Master branch and connects to servers...

<!-- gh-comment-id:411780360 --> @rodri16 commented on GitHub (Aug 9, 2018): Great I made it work, both with Master and Dev branch. The problem is that with Dev branch after WiFi configuration I cannot connect to a server client to send data or to update the clock using NTP server. Same code runs ok with Master branch and connects to servers...
Author
Owner

@tablatronix commented on GitHub (Aug 9, 2018):

Can you elaborate, are you in sta mode or sta + ap mode,
Also what does the debug say ?

<!-- gh-comment-id:411784055 --> @tablatronix commented on GitHub (Aug 9, 2018): Can you elaborate, are you in sta mode or sta + ap mode, Also what does the debug say ?
Author
Owner

@rodri16 commented on GitHub (Aug 9, 2018):

After doing ap mode and WiFi configuration.

Dev Branch. Problem trying to connect to servers
problem dev branch2

Master, connected to NTP and data servers. NTP pk and connected to server with a forbidden

problem solved master branch2

<!-- gh-comment-id:411789643 --> @rodri16 commented on GitHub (Aug 9, 2018): After doing ap mode and WiFi configuration. Dev Branch. Problem trying to connect to servers ![problem dev branch2](https://user-images.githubusercontent.com/7334666/43907503-dbfba778-9bf5-11e8-893e-fde27b875b8a.png) Master, connected to NTP and data servers. NTP pk and connected to server with a forbidden ![problem solved master branch2](https://user-images.githubusercontent.com/7334666/43907504-dc1cb364-9bf5-11e8-9f86-fc2714b416f6.png)
Author
Owner

@rodri16 commented on GitHub (Aug 9, 2018):

I checked and in Master, after pressing the button, startConfigPortal crashes after scan networks
In dev it works but never get connection to servers.

<!-- gh-comment-id:411812859 --> @rodri16 commented on GitHub (Aug 9, 2018): I checked and in Master, after pressing the button, startConfigPortal crashes after scan networks In dev it works but never get connection to servers.
Author
Owner

@rodri16 commented on GitHub (Aug 9, 2018):

In conclusion, in dev branch, after configuration or after startConfigPortal, connection to servers doesn't work.
With WiFi configuration done, if you reboot, it works!

<!-- gh-comment-id:411833757 --> @rodri16 commented on GitHub (Aug 9, 2018): In conclusion, in dev branch, after configuration or after startConfigPortal, connection to servers doesn't work. With WiFi configuration done, if you reboot, it works!
Author
Owner

@tablatronix commented on GitHub (Aug 9, 2018):

can you add an print mode after exit to see which mode you are in

or add WiFi.mode(WIFI_STA); after exiting portal, and see if it starts working ?

<!-- gh-comment-id:411863984 --> @tablatronix commented on GitHub (Aug 9, 2018): can you add an print mode after exit to see which mode you are in or add WiFi.mode(WIFI_STA); after exiting portal, and see if it starts working ?
Author
Owner

@tablatronix commented on GitHub (Aug 9, 2018):

( that crash in master is new also, hmm )

which esp lib ver are you using ?

<!-- gh-comment-id:411864300 --> @tablatronix commented on GitHub (Aug 9, 2018): ( that crash in master is new also, hmm ) which esp lib ver are you using ?
Author
Owner

@tablatronix commented on GitHub (Aug 9, 2018):

#688
similar issue

<!-- gh-comment-id:411865768 --> @tablatronix commented on GitHub (Aug 9, 2018): #688 similar issue
Author
Owner

@tablatronix commented on GitHub (Aug 9, 2018):

investigating..

<!-- gh-comment-id:411871714 --> @tablatronix commented on GitHub (Aug 9, 2018): investigating..
Author
Owner

@tablatronix commented on GitHub (Aug 9, 2018):

hmm I was trying to make a quick test sketch, but I cannot get this ntp example to work at all.
know a good ping lib ?

<!-- gh-comment-id:411875635 --> @tablatronix commented on GitHub (Aug 9, 2018): hmm I was trying to make a quick test sketch, but I cannot get this ntp example to work at all. know a good ping lib ?
Author
Owner

@tablatronix commented on GitHub (Aug 9, 2018):

ah i forgot to start udp nm

<!-- gh-comment-id:411879108 --> @tablatronix commented on GitHub (Aug 9, 2018): ah i forgot to start udp nm
Author
Owner

@tablatronix commented on GitHub (Aug 9, 2018):

cannot reproduce

*WM: [1] getCoreVersion():          2_4_1
*WM: [1] system_get_sdk_version():  2.2.1(cfd48f3)
*WM: [1] system_get_boot_version(): 31
*WM: [1] getFreeHeap():             42664

added some debugging to lib

<!-- gh-comment-id:411884323 --> @tablatronix commented on GitHub (Aug 9, 2018): cannot reproduce ``` *WM: [1] getCoreVersion(): 2_4_1 *WM: [1] system_get_sdk_version(): 2.2.1(cfd48f3) *WM: [1] system_get_boot_version(): 31 *WM: [1] getFreeHeap(): 42664 ``` added some debugging to lib
Author
Owner

@tablatronix commented on GitHub (Aug 9, 2018):

also added ntp example to the dev/ example

<!-- gh-comment-id:411884579 --> @tablatronix commented on GitHub (Aug 9, 2018): also added ntp example to the dev/ example
Author
Owner

@tablatronix commented on GitHub (Aug 9, 2018):

cannot reproduce on staging either

<!-- gh-comment-id:411886820 --> @tablatronix commented on GitHub (Aug 9, 2018): cannot reproduce on staging either
Author
Owner

@rodri16 commented on GitHub (Aug 10, 2018):

I am using this library https://github.com/gmag11/NtpClient

<!-- gh-comment-id:412026566 --> @rodri16 commented on GitHub (Aug 10, 2018): I am using this library https://github.com/gmag11/NtpClient
Author
Owner

@rodri16 commented on GitHub (Aug 10, 2018):

It works adding WiFi.mode(WIFI_STA);!!! Thanks

<!-- gh-comment-id:412037314 --> @rodri16 commented on GitHub (Aug 10, 2018): It works adding WiFi.mode(WIFI_STA);!!! Thanks
Author
Owner

@tablatronix commented on GitHub (Aug 10, 2018):

What version of esp lib? There is clearly a bug

<!-- gh-comment-id:412063168 --> @tablatronix commented on GitHub (Aug 10, 2018): What version of esp lib? There is clearly a bug
Author
Owner

@rodri16 commented on GitHub (Aug 10, 2018):

SDK Version 2.2.1
Core version 2.4.1
Boot version 4

<!-- gh-comment-id:412068607 --> @rodri16 commented on GitHub (Aug 10, 2018): SDK Version 2.2.1 Core version 2.4.1 Boot version 4
Author
Owner

@rodri16 commented on GitHub (Aug 10, 2018):

Also in Dev branch setAPStaticIPConfig does not work! It always goes to 192.168.4.1

*WM: [1] SETTINGS ERASED
*WM: [3] WiFi station enable
*WM: [3] enableSTA PERSISTENT ON
*WM: [3] allocating params bytes: 20
*WM: [2] Added Parameter: server
*WM: [2] Added Parameter: port
*WM: [2] Added Parameter: TimeZone
*WM: [1] AutoConnect
*WM: [2] Connecting as wifi client...
*WM: [3] WIFI station disconnect
*WM: [1] No saved credentials, skipping wifi
*WM: [2] Connection result: WL_NO_SSID_AVAIL
*WM: [3] lastconxresult: WL_NO_SSID_AVAIL
*WM: [1] AutoConnect: FAILED
*WM: [2] AccessPoint set password is VALID
*WM: [1] xxxxxx
*WM: [3] WIFI station disconnect
*WM: [3] WiFi station enable
*WM: [2] Disabling STA
*WM: [2] Enabling AP
*WM: [1] StartAP with SSID: xxxxxx
*WM: [1] AP IP address: 192.168.4.1
Entered config mode
192.168.4.1

//gets called when WiFiManager enters configuration mode
void configModeCallback (WiFiManager *myWiFiManager) {
Serial.println("Entered config mode");
myWiFiManager->setAPStaticIPConfig(IPAddress(10,0,1,1), IPAddress(10,0,1,1), IPAddress(255,255,255,0));
Serial.println(WiFi.softAPIP());
//if you used auto generated SSID, print it
Serial.println(myWiFiManager->getConfigPortalSSID());
//entered config mode, make led toggle faster
ticker.attach(0.2, tick);
}

<!-- gh-comment-id:412069962 --> @rodri16 commented on GitHub (Aug 10, 2018): Also in Dev branch setAPStaticIPConfig does not work! It always goes to 192.168.4.1 *WM: [1] SETTINGS ERASED *WM: [3] WiFi station enable *WM: [3] enableSTA PERSISTENT ON *WM: [3] allocating params bytes: 20 *WM: [2] Added Parameter: server *WM: [2] Added Parameter: port *WM: [2] Added Parameter: TimeZone *WM: [1] AutoConnect *WM: [2] Connecting as wifi client... *WM: [3] WIFI station disconnect *WM: [1] No saved credentials, skipping wifi *WM: [2] Connection result: WL_NO_SSID_AVAIL *WM: [3] lastconxresult: WL_NO_SSID_AVAIL *WM: [1] AutoConnect: FAILED *WM: [2] AccessPoint set password is VALID *WM: [1] xxxxxx *WM: [3] WIFI station disconnect *WM: [3] WiFi station enable *WM: [2] Disabling STA *WM: [2] Enabling AP *WM: [1] StartAP with SSID: xxxxxx *WM: [1] AP IP address: 192.168.4.1 Entered config mode 192.168.4.1 //gets called when WiFiManager enters configuration mode void configModeCallback (WiFiManager *myWiFiManager) { Serial.println("Entered config mode"); myWiFiManager->setAPStaticIPConfig(IPAddress(10,0,1,1), IPAddress(10,0,1,1), IPAddress(255,255,255,0)); Serial.println(WiFi.softAPIP()); //if you used auto generated SSID, print it Serial.println(myWiFiManager->getConfigPortalSSID()); //entered config mode, make led toggle faster ticker.attach(0.2, tick); }
Author
Owner

@tablatronix commented on GitHub (Aug 10, 2018):

thanks, callback was moved, fixed
5ee1ae78c0

<!-- gh-comment-id:412139852 --> @tablatronix commented on GitHub (Aug 10, 2018): thanks, callback was moved, fixed 5ee1ae78c0fc808ad5eacec398d19a658ec35aa3
Author
Owner

@tablatronix commented on GitHub (Aug 10, 2018):

I have added some debugging for this can you test and post debug log ?

<!-- gh-comment-id:412140650 --> @tablatronix commented on GitHub (Aug 10, 2018): I have added some debugging for this can you test and post debug log ?
Author
Owner

@rodri16 commented on GitHub (Aug 28, 2018):

*WM: [2] AccessPoint set password is VALID
*WM: [1] xxxxxx
*WM: [3] WiFi station enable
*WM: [2] Enabling AP
*WM: [1] StartAP with SSID: xxxxxx
*WM: [1] Custom AP IP/GW/Subnet:
*WM: [0] [ERROR] softAPConfig failed!
*WM: [1] AP IP address: 192.168.4.1
Entered config mode
192.168.4.1
xxxxxx
*WM: [3] setupConfigPortal
*WM: [1] Starting Web Portal
*WM: [3] dns server started with ip: 192.168.4.1
*WM: [2] HTTP server started
*WM: [2] WiFi Scan done in 1582ms
*WM: [2] Config Portal Running, blocking, waiting for clients...
*WM: [2] NUM CLIENTS: 0

<!-- gh-comment-id:416515588 --> @rodri16 commented on GitHub (Aug 28, 2018): *WM: [2] AccessPoint set password is VALID *WM: [1] xxxxxx *WM: [3] WiFi station enable *WM: [2] Enabling AP *WM: [1] StartAP with SSID: xxxxxx *WM: [1] Custom AP IP/GW/Subnet: *WM: [0] [ERROR] softAPConfig failed! *WM: [1] AP IP address: 192.168.4.1 Entered config mode 192.168.4.1 xxxxxx *WM: [3] setupConfigPortal *WM: [1] Starting Web Portal *WM: [3] dns server started with ip: 192.168.4.1 *WM: [2] HTTP server started *WM: [2] WiFi Scan done in 1582ms *WM: [2] Config Portal Running, blocking, waiting for clients... *WM: [2] NUM CLIENTS: 0
Author
Owner

@tablatronix commented on GitHub (Aug 28, 2018):

Are you still using callback? Did you try setting it before wm starts?

<!-- gh-comment-id:416555779 --> @tablatronix commented on GitHub (Aug 28, 2018): Are you still using callback? Did you try setting it before wm starts?
Author
Owner

@rodri16 commented on GitHub (Sep 3, 2018):

Yes still using callback, is it better not to use it? Added settings but still going to 192.168.4.1

<!-- gh-comment-id:418049146 --> @rodri16 commented on GitHub (Sep 3, 2018): Yes still using callback, is it better not to use it? Added settings but still going to 192.168.4.1
Author
Owner

@tablatronix commented on GitHub (Sep 3, 2018):

There is no need to use it, but curious where the bug is.
#720

<!-- gh-comment-id:418115330 --> @tablatronix commented on GitHub (Sep 3, 2018): There is no need to use it, but curious where the bug is. #720
Author
Owner

@rodri16 commented on GitHub (Sep 3, 2018):

Updated development branch but still...
*WM: [2] AccessPoint set password is VALID
*WM: [1] XXXXX
*WM: [3] WiFi station enable
*WM: [2] Enabling AP
*WM: [1] StartAP with SSID: XXXXX
Entered config mode
0.0.0.0
XXXXX
*WM: [1] Custom AP IP/GW/Subnet:
*WM: [0] [ERROR] softAPConfig failed!
*WM: [1] AP IP address: 192.168.4.1
*WM: [3] setupConfigPortal
*WM: [1] Starting Web Portal
*WM: [3] dns server started with ip: 192.168.4.1
*WM: [2] HTTP server started
*WM: [2] WiFi Scan ASYNC started
*WM: [2] Config Portal Running, blocking, waiting for clients...
*WM: [2] Portal Timeout In 118 seconds
*WM: [2] WiFi Scan ASYNC completed in 1589 ms
*WM: [2] WiFi Scan ASYNC found: 5
*WM: [2] Portal Timeout In 88 seconds

<!-- gh-comment-id:418190290 --> @rodri16 commented on GitHub (Sep 3, 2018): Updated development branch but still... *WM: [2] AccessPoint set password is VALID *WM: [1] XXXXX *WM: [3] WiFi station enable *WM: [2] Enabling AP *WM: [1] StartAP with SSID: XXXXX Entered config mode 0.0.0.0 XXXXX *WM: [1] Custom AP IP/GW/Subnet: *WM: [0] [ERROR] softAPConfig failed! *WM: [1] AP IP address: 192.168.4.1 *WM: [3] setupConfigPortal *WM: [1] Starting Web Portal *WM: [3] dns server started with ip: 192.168.4.1 *WM: [2] HTTP server started *WM: [2] WiFi Scan ASYNC started *WM: [2] Config Portal Running, blocking, waiting for clients... *WM: [2] Portal Timeout In 118 seconds *WM: [2] WiFi Scan ASYNC completed in 1589 ms *WM: [2] WiFi Scan ASYNC found: 5 *WM: [2] Portal Timeout In 88 seconds
Author
Owner

@rodri16 commented on GitHub (Sep 3, 2018):

Doing a wifiManager.resetSettings();

mounted file system
reading config file
opened config file
{"mqtt_server":"xxxx","mqtt_port":"80","TimeZone":"-3","ip":"192.168.1.198","gateway":"192.168.1.254","subnet":"255.255.255.0"}
parsed json
xxxx
-3
*WM: [1] SETTINGS ERASED
*WM: [3] WiFi station enable
*WM: [3] enableSTA PERSISTENT ON
*WM: [3] allocating params bytes: 20
*WM: [2] Added Parameter: server
*WM: [2] Added Parameter: port
*WM: [2] Added Parameter: TimeZone
*WM: [1] AutoConnect
*WM: [2] Connecting as wifi client...
*WM: [3] WIFI station disconnect
*WM: [1] No saved credentials, skipping wifi
*WM: [2] Connection result: WL_NO_SSID_AVAIL
*WM: [3] lastconxresult: WL_NO_SSID_AVAIL
*WM: [1] AutoConnect: FAILED
*WM: [2] AccessPoint set password is VALID
*WM: [1] xxxx
*WM: [3] WIFI station disconnect
*WM: [3] WiFi station enable
*WM: [2] Disabling STA
*WM: [2] Enabling AP
*WM: [1] StartAP with SSID: xxxx
*WM: [1] Custom AP IP/GW/Subnet:
*WM: [1] AP IP address: 10.0.1.1
*WM: [3] setupConfigPortal
*WM: [1] Starting Web Portal
*WM: [3] dns server started with ip: 10.0.1.1
*WM: [2] HTTP server started
*WM: [2] WiFi Scan ASYNC started
*WM: [2] Config Portal Running, blocking, waiting for clients...
*WM: [2] WiFi Scan ASYNC completed in 2186 ms
*WM: [2] WiFi Scan ASYNC found: 9

And then pressing the button to start config portal
*WM: [2] AccessPoint set password is VALID
*WM: [1] xxxx
*WM: [3] WiFi station enable
*WM: [2] Enabling AP
*WM: [1] StartAP with SSID: xxxx
*WM: [1] Custom AP IP/GW/Subnet:
*WM: [0] [ERROR] softAPConfig failed!
*WM: [1] AP IP address: 10.0.1.1
*WM: [3] setupConfigPortal
*WM: [1] Starting Web Portal
*WM: [3] dns server started with ip: 10.0.1.1
*WM: [2] HTTP server started
*WM: [2] WiFi Scan ASYNC started
*WM: [2] Config Portal Running, blocking, waiting for clients...
*WM: [2] Portal Timeout In 118 seconds
*WM: [2] WiFi Scan ASYNC completed in 1589 ms
*WM: [2] WiFi Scan ASYNC found: 8

Now it is working with 10.0.1.1 but when reset is deleted again it goes to 192.168.4.1

<!-- gh-comment-id:418193110 --> @rodri16 commented on GitHub (Sep 3, 2018): Doing a wifiManager.resetSettings(); mounted file system reading config file opened config file {"mqtt_server":"xxxx","mqtt_port":"80","TimeZone":"-3","ip":"192.168.1.198","gateway":"192.168.1.254","subnet":"255.255.255.0"} parsed json xxxx -3 *WM: [1] SETTINGS ERASED *WM: [3] WiFi station enable *WM: [3] enableSTA PERSISTENT ON *WM: [3] allocating params bytes: 20 *WM: [2] Added Parameter: server *WM: [2] Added Parameter: port *WM: [2] Added Parameter: TimeZone *WM: [1] AutoConnect *WM: [2] Connecting as wifi client... *WM: [3] WIFI station disconnect *WM: [1] No saved credentials, skipping wifi *WM: [2] Connection result: WL_NO_SSID_AVAIL *WM: [3] lastconxresult: WL_NO_SSID_AVAIL *WM: [1] AutoConnect: FAILED *WM: [2] AccessPoint set password is VALID *WM: [1] xxxx *WM: [3] WIFI station disconnect *WM: [3] WiFi station enable *WM: [2] Disabling STA *WM: [2] Enabling AP *WM: [1] StartAP with SSID: xxxx *WM: [1] Custom AP IP/GW/Subnet: *WM: [1] AP IP address: 10.0.1.1 *WM: [3] setupConfigPortal *WM: [1] Starting Web Portal *WM: [3] dns server started with ip: 10.0.1.1 *WM: [2] HTTP server started *WM: [2] WiFi Scan ASYNC started *WM: [2] Config Portal Running, blocking, waiting for clients... *WM: [2] WiFi Scan ASYNC completed in 2186 ms *WM: [2] WiFi Scan ASYNC found: 9 And then pressing the button to start config portal *WM: [2] AccessPoint set password is VALID *WM: [1] xxxx *WM: [3] WiFi station enable *WM: [2] Enabling AP *WM: [1] StartAP with SSID: xxxx *WM: [1] Custom AP IP/GW/Subnet: *WM: [0] [ERROR] softAPConfig failed! *WM: [1] AP IP address: 10.0.1.1 *WM: [3] setupConfigPortal *WM: [1] Starting Web Portal *WM: [3] dns server started with ip: 10.0.1.1 *WM: [2] HTTP server started *WM: [2] WiFi Scan ASYNC started *WM: [2] Config Portal Running, blocking, waiting for clients... *WM: [2] Portal Timeout In 118 seconds *WM: [2] WiFi Scan ASYNC completed in 1589 ms *WM: [2] WiFi Scan ASYNC found: 8 Now it is working with 10.0.1.1 but when reset is deleted again it goes to 192.168.4.1
Author
Owner

@tablatronix commented on GitHub (Sep 3, 2018):

Ok well there is no callback if already connected so probably always set config first

<!-- gh-comment-id:418193170 --> @tablatronix commented on GitHub (Sep 3, 2018): Ok well there is no callback if already connected so probably always set config first
Author
Owner

@rodri16 commented on GitHub (Sep 3, 2018):

Even adding setAPStaticIPConfig first

<!-- gh-comment-id:418195703 --> @rodri16 commented on GitHub (Sep 3, 2018): Even adding setAPStaticIPConfig first
Author
Owner

@tablatronix commented on GitHub (Sep 3, 2018):

same output ?

<!-- gh-comment-id:418199250 --> @tablatronix commented on GitHub (Sep 3, 2018): same output ?
Author
Owner

@rodri16 commented on GitHub (Sep 4, 2018):

Yes same output, even if I delete callback and add configuration first.
*WM: [2] AccessPoint set password is VALID
*WM: [1] xxxxx
*WM: [3] WiFi station enable
*WM: [2] Enabling AP
*WM: [1] StartAP with SSID: xxxxx
Entered config mode
0.0.0.0
xxxxx
*WM: [1] Custom AP IP/GW/Subnet:
*WM: [0] [ERROR] softAPConfig failed!
*WM: [1] AP IP address: 192.168.4.1
*WM: [3] setupConfigPortal
*WM: [1] Starting Web Portal
*WM: [3] dns server started with ip: 192.168.4.1
*WM: [2] HTTP server started
*WM: [2] WiFi Scan ASYNC started
*WM: [2] Config Portal Running, blocking, waiting for clients...
*WM: [2] Portal Timeout In 118 seconds
*WM: [2] WiFi Scan ASYNC completed in 1586 ms
*WM: [2] WiFi Scan ASYNC found: 14

<!-- gh-comment-id:418292503 --> @rodri16 commented on GitHub (Sep 4, 2018): Yes same output, even if I delete callback and add configuration first. *WM: [2] AccessPoint set password is VALID *WM: [1] xxxxx *WM: [3] WiFi station enable *WM: [2] Enabling AP *WM: [1] StartAP with SSID: xxxxx Entered config mode 0.0.0.0 xxxxx *WM: [1] Custom AP IP/GW/Subnet: *WM: [0] [ERROR] softAPConfig failed! *WM: [1] AP IP address: 192.168.4.1 *WM: [3] setupConfigPortal *WM: [1] Starting Web Portal *WM: [3] dns server started with ip: 192.168.4.1 *WM: [2] HTTP server started *WM: [2] WiFi Scan ASYNC started *WM: [2] Config Portal Running, blocking, waiting for clients... *WM: [2] Portal Timeout In 118 seconds *WM: [2] WiFi Scan ASYNC completed in 1586 ms *WM: [2] WiFi Scan ASYNC found: 14
Author
Owner

@tablatronix commented on GitHub (Sep 4, 2018):

Ok sorry this is ap sta config , so different issue, ill try to debug today

<!-- gh-comment-id:418341683 --> @tablatronix commented on GitHub (Sep 4, 2018): Ok sorry this is ap sta config , so different issue, ill try to debug today
Author
Owner

@tablatronix commented on GitHub (Sep 4, 2018):

@rodri16 can you create a new issue for this and fill out the info, I want to track this seperately this is getting confusing. You clearly have "softAPConfig failed" so this is either a sketch issue or a esp bug or wrong mode in wm before setting config.

<!-- gh-comment-id:418367331 --> @tablatronix commented on GitHub (Sep 4, 2018): @rodri16 can you create a new issue for this and fill out the info, I want to track this seperately this is getting confusing. You clearly have "softAPConfig failed" so this is either a sketch issue or a esp bug or wrong mode in wm before setting config.
Author
Owner

@guysoft commented on GitHub (May 6, 2019):

Implementation using the double reset library:
https://github.com/guysoft/Mqtt_Wifi_manager

<!-- gh-comment-id:489574963 --> @guysoft commented on GitHub (May 6, 2019): Implementation using the double reset library: https://github.com/guysoft/Mqtt_Wifi_manager
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/WiFiManager#219
No description provided.