[GH-ISSUE #1127] Store parameters even when WiFi cannot connect #965

Open
opened 2026-02-28 01:27:53 +03:00 by kerem · 4 comments
Owner

Originally created by @Jeppedy on GitHub (Sep 17, 2020).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1127

Basic Infos

Hardware

WiFimanager Branch/Release:

  • [ X] Master

Esp8266/Esp32:

  • ESP8266
  • ESP32

Hardware: ESP-12e, esp01, esp25
Adafruit Feather Huzzah - ESP8266-based

Description

Feature Request:
Today, the additional parameters are not being stored if a connection to the Wifi cannot be established.
As I'm sure many are, I'm using your library both to manage the Wifi config and as an easy way to allow me to adjust parameters on the device (even when it can connect to WiFi).
All works fine. No bugs...
But, you've made the design decision to NOT call the "SaveParams" callback if you cannot get a connection, or if the new SSID/PSWD are not supplied.
The params I have are unrelated to the WiFi connection.

Preferred:
When exiting the Portal and you asked to save the params...
First call the Save callback.
Then...
If the SSID or PSWD are null, fall back to the previously-configured params and attempt connection as you do today (About line 255 in WiFiManager.cpp).
This allows me to change my additional params without even touching the wifi config.

Or, have two callbacks: "Wifi Connection related", called as it is today, and "Unrelated to Wifi", which is always called when the config portal calls for a save.

If you believe this is worthy, I can clean up my mods to your library and submit...

Originally created by @Jeppedy on GitHub (Sep 17, 2020). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1127 ### Basic Infos #### Hardware **WiFimanager Branch/Release:** - [ X] Master **Esp8266/Esp32:** - [X] ESP8266 - [ ] ESP32 **Hardware: ESP-12e, esp01, esp25** Adafruit Feather Huzzah - ESP8266-based ### Description Feature Request: Today, the additional parameters are not being stored if a connection to the Wifi cannot be established. As I'm sure many are, I'm using your library both to manage the Wifi config and as an easy way to allow me to adjust parameters on the device (even when it can connect to WiFi). All works fine. No bugs... But, you've made the design decision to NOT call the "SaveParams" callback if you cannot get a connection, or if the new SSID/PSWD are not supplied. The params I have are unrelated to the WiFi connection. Preferred: When exiting the Portal and you asked to save the params... First call the Save callback. Then... If the SSID or PSWD are null, fall back to the previously-configured params and attempt connection as you do today (About line 255 in WiFiManager.cpp). This allows me to change my additional params without even touching the wifi config. Or, have two callbacks: "Wifi Connection related", called as it is today, and "Unrelated to Wifi", which is always called when the config portal calls for a save. If you believe this is worthy, I can clean up my mods to your library and submit...
Author
Owner

@tablatronix commented on GitHub (Sep 17, 2020):

already possible

    //if this is set, it will exit after config, even if connection is unsuccessful.
    void          setBreakAfterConfig(boolean shouldBreak);

also
In alpha/dev version you can move params to a seperate page and have seperate callbacks.

<!-- gh-comment-id:694371329 --> @tablatronix commented on GitHub (Sep 17, 2020): already possible ```C++ //if this is set, it will exit after config, even if connection is unsuccessful. void setBreakAfterConfig(boolean shouldBreak); ``` also In alpha/dev version you can move params to a seperate page and have seperate callbacks.
Author
Owner

@Jeppedy commented on GitHub (Sep 17, 2020):

Can you point me to an example sketch?

On Thu, Sep 17, 2020, 12:07 Shawn A notifications@github.com wrote:

already possible

//if this is set, it will exit after config, even if connection is unsuccessful.
void          setBreakAfterConfig(boolean shouldBreak);

In alpha/dev version you can move params to a seperate page and have
seperate callbacks.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/tzapu/WiFiManager/issues/1127#issuecomment-694371329,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AB32XYYVYMYKUULSASKNYBTSGI66FANCNFSM4RQXCCRQ
.

<!-- gh-comment-id:694390929 --> @Jeppedy commented on GitHub (Sep 17, 2020): Can you point me to an example sketch? On Thu, Sep 17, 2020, 12:07 Shawn A <notifications@github.com> wrote: > already possible > > //if this is set, it will exit after config, even if connection is unsuccessful. > void setBreakAfterConfig(boolean shouldBreak); > > In alpha/dev version you can move params to a seperate page and have > seperate callbacks. > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > <https://github.com/tzapu/WiFiManager/issues/1127#issuecomment-694371329>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AB32XYYVYMYKUULSASKNYBTSGI66FANCNFSM4RQXCCRQ> > . >
Author
Owner

@Jeppedy commented on GitHub (Sep 17, 2020):

So setBreakAfterConfig means "save params even if connection didn't
succeed"?

J

On Thu, Sep 17, 2020, 12:39 Jeffrey Herr jeff@theherrs.com wrote:

Can you point me to an example sketch?

On Thu, Sep 17, 2020, 12:07 Shawn A notifications@github.com wrote:

already possible

//if this is set, it will exit after config, even if connection is unsuccessful.
void          setBreakAfterConfig(boolean shouldBreak);

In alpha/dev version you can move params to a seperate page and have
seperate callbacks.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/tzapu/WiFiManager/issues/1127#issuecomment-694371329,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AB32XYYVYMYKUULSASKNYBTSGI66FANCNFSM4RQXCCRQ
.

<!-- gh-comment-id:694394206 --> @Jeppedy commented on GitHub (Sep 17, 2020): So setBreakAfterConfig means "save params even if connection didn't succeed"? J On Thu, Sep 17, 2020, 12:39 Jeffrey Herr <jeff@theherrs.com> wrote: > Can you point me to an example sketch? > > On Thu, Sep 17, 2020, 12:07 Shawn A <notifications@github.com> wrote: > >> already possible >> >> //if this is set, it will exit after config, even if connection is unsuccessful. >> void setBreakAfterConfig(boolean shouldBreak); >> >> In alpha/dev version you can move params to a seperate page and have >> seperate callbacks. >> >> — >> You are receiving this because you authored the thread. >> Reply to this email directly, view it on GitHub >> <https://github.com/tzapu/WiFiManager/issues/1127#issuecomment-694371329>, >> or unsubscribe >> <https://github.com/notifications/unsubscribe-auth/AB32XYYVYMYKUULSASKNYBTSGI66FANCNFSM4RQXCCRQ> >> . >> >
Author
Owner

@tablatronix commented on GitHub (Sep 17, 2020):

Yeah its an old throwback thing, it should be noted in the readme.
It was to stop the configportal after connect fail, but a side effect was that the callback never occurs also, and this also fixes that.

<!-- gh-comment-id:694433445 --> @tablatronix commented on GitHub (Sep 17, 2020): Yeah its an old throwback thing, it should be noted in the readme. It was to stop the configportal after connect fail, but a side effect was that the callback never occurs also, and this also fixes that.
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#965
No description provided.