mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 00:55:52 +03:00
[GH-ISSUE #1010] Wifimanger do not remember pass nor SSID in Confriguation mode, and save empty "strings" when closing after changing other parameters? #861
Labels
No labels
📶 WiFi
🕸️ HTTP
Branch
DEV Help Wanted
Discussion
Documentation
ESP32
Example
Good First Issue
Hotfix
In Progress
Incomplete
Needs Feeback
Priority
QA
Question
Task
Upstream/Dependancy
bug
duplicate
enhancement
invalid
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/WiFiManager#861
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kbaggen on GitHub (Feb 17, 2020).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1010
Hi there, not sure if this is an issue !
Shouldent Wifimanger remmeber the old pass/ssid if I just shnage the mqtt port or whatever?
.Anyone know what to do, e.g. to ensure to display the last used SSID and last use password so when saving other parameters the last used pass/ssis get saved automtically?
Some code to do this whould be nice......if possible! Might be I removed something I shouldent, but all my 5 other parameters remembers from time to time....just not pass nor SSID and it is a bugger to remember setting SSID and pass each time you just wish to change another parameter!
/Klaus
@tablatronix commented on GitHub (Feb 17, 2020):
What version?
@kbaggen commented on GitHub (Feb 17, 2020):
Ups.....that part I did forget to write....I am using the version Ken Taloy made, so maybe that is the reason?
@tablatronix commented on GitHub (Feb 17, 2020):
yes
@kbaggen commented on GitHub (Feb 17, 2020):
Just tried with 0.15 and same results.....the SSID nor pass is stored from time to time in confriguation! If resetting ESP it works fine and hence the SSID and pass is saved but jsut not get scripted into confirguation moe....any clue to what might be wrong!
@tablatronix commented on GitHub (Feb 18, 2020):
can you explain exactly what you are doing and expecting?
If you save config and leave ssid blank it should keep the one previously saved. Are you expecting it to reconnect and it does not and you have to reboot?
@kbaggen commented on GitHub (Feb 18, 2020):
Yes, that is what I want and assumed, eg. that if you enter confriguaion and do not change of SSI nor pass but only some additinal parameters I expect it to keep the "in-the-patst" set ssid/pass.
I have 6-7 parameters I included in wifimanger there sometimes is changed according till the function of the device (it is a temperature/activity logger for fermentation and hence I set setpoint, volumes, gravity of worts, etc. before each fermentation as parameters).
When I just change one parameters (and hence not changing the SSID nor pass) after reboot the device do not logon. Opposite, if I when I change the parameter remember to set the SSID and pass it functions....so it seems the Wifimanger do not remember the SSID/pass in confriguation from time to time unless they are written each time. All my untoched other parameters are finely remembered.
So if you have an idea where I should look, then, thanks, else I musr expplore. Will start fresh on 0.15 and just check with nofthing besides one parameter.
As said I started out on you script, and ended (not recalling why anymore) using Ken version, so even all besdies the pass/ssid now works, it is a mismatch I guess!
Thanks for responding, much appriciated.
@tablatronix commented on GitHub (Feb 18, 2020):
I suggest you switch to the development branch and start using it, it is the next version.
0.15 should remember your wifi..
Can you provide 0.15 serial logs? For save and reboot
@kbaggen commented on GitHub (Feb 18, 2020):
Hi Agian, tried both 0.15 and development branch........I will try a bit more the enxt days and see to provide some serials for it, but my code for the area of connection is:
Hence, as I use "startConfigPortal" this might be the reason?
@aguilaair commented on GitHub (Feb 18, 2020):
I am using the D1 mini, same issue here.
@aguilaair commented on GitHub (Feb 18, 2020):
I'm getting inconsistent results. It seems that 1/2 of the time it connects correctly whilst the other half it starts the ap
@Cat30Mk3 commented on GitHub (Feb 24, 2020):
I'm experiencing the exact same issue after switching to latest development version of WiFiManager (Feb 24 2020). Hardware is Adafruit HUZZAH ESP8266 , Connecting to access point with Win10 laptop OR with Apple Tablet IOS 12. gives same results. Did not experience this with latest WiFiManager Master branch.
This is an ON DEMAND trigger of WiFiManager.
When I connect to access point and open "Configure WiFi" SSID is correctly populated and Password shows ********
If I attempt to change a custom parameter WITHOUTre-entering ssid & password WM reports:
*WM: [3] Sent wifi save page
*WM: [2] process connect
*WM: [2] No ssid, skipping wifi save
*WM: [3] WIFI station disconnect
*WM: [3] WiFi station enable
*WM: [2] Disabling STA
.....
But if I enter the unchanged ssid & psk it works every time:
*WM: [3] Sent wifi save page
*WM: [2] process connect
*WM: [2] Connecting as wifi client...
*WM: [3] STA static IP:
*WM: [2] setSTAConfig static ip not set, skipping
*WM: [1] CONNECTED:
*WM: [1] Connecting to NEW AP: JohnAndLinda
*WM: [3] Using Password: 999999999
*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.2.43
Should save config
*WM: [2] disconnect configportal
*WM: [2] restoring usermode STA+AP
*WM: [2] wifi status: WL_CONNECTED
*WM: [2] wifi mode: STA+AP
*WM: [1] config portal exiting
connected to wifi after wifiManager AP ...yeey :)
...
Attached complete Access Point transaction here ...
Failed save at line 110 and success at line 143 onward
WM-Development-Feb 24 2020-defect.txt
@tablatronix commented on GitHub (Feb 24, 2020):
What works? What is not working
@Cat30Mk3 commented on GitHub (Feb 24, 2020):
wifi save page (custom parameter saving) only works when SSID and Password are entered.
wifi save page (custom parameter saving) does not work if ssid and password are left blank.
Your description from above:
"If you save config and leave ssid blank it should keep the one previously saved. "
is failing.
@tablatronix commented on GitHub (Feb 24, 2020):
Did you pull recently? I tested this the other day I think. There is no save if its blank
@Cat30Mk3 commented on GitHub (Feb 24, 2020):
Yes today from development branch.
@Cat30Mk3 commented on GitHub (Feb 24, 2020):
It is not actually blank, it is populated with existing ssid and password (shows ********)
@tablatronix commented on GitHub (Feb 24, 2020):
Ok so are you saying your wifi is wiped and no longer connects after rebooting?
Or that your savecallback is not being called ?
Set breakaftercpnfig true
@tablatronix commented on GitHub (Feb 24, 2020):
Also esp8266 or esp32? You can make a new issue for this if you want
@tablatronix commented on GitHub (Feb 24, 2020):
I will take a look asap at this
@Cat30Mk3 commented on GitHub (Feb 25, 2020):
Sorry if i am not being clear ..
(1) this is ESP8266 - have not tried on anything else
(2) using On Demand Access Point -- when I change a custom parameter and press Save,
[WM] reports "WM: [2] No ssid, skipping wifi save" BUT SSID and hidden psk were populated and are displayed -
(3) If I re-enter or pick from scan list the SSID and provide psk and change custom parameter, the save page functions correctly and the custom parameters are being saved and the ESP reboots correctly.
@tablatronix commented on GitHub (Feb 25, 2020):
Thats how it is supposed to work. No wifi change so skipping the wifi save
@Cat30Mk3 commented on GitHub (Feb 25, 2020):
So are you saying that even if the SSIS and PSK dont change I cant trigger a save of custom parameters without touching the SSID & PSK?
Is this a change from current production version?
@Cat30Mk3 commented on GitHub (Feb 25, 2020):
OK, I went back to existing production (master) and found same functionality - so my mistake -- I agree this was original design. But I question if this makes sense - if you only need to change a custom parameter why do you have to re-enter ssid and psk ?
Thanks for your patience
@tablatronix commented on GitHub (Feb 25, 2020):
you have to set shouldbreakafterconfig right now for it to work, I do not have it refactored yet
@kbaggen commented on GitHub (Feb 25, 2020):
Hi there,
what Cat30Mk3 describes is the same I see! And also propsoe that the saving of a a parameter should NOT need us also to set the SSID/password..........if possible!
I aosl thought this was a faoult and did not assume it was the normal behavier!
Anyway...thanks to all for support and disccussing!
@kbaggen commented on GitHub (Feb 25, 2020):
REgarding,
"Thats how it is supposed to work. No wifi change so skipping the wifi save"!
That is not what I see.......it seems if entering the portal I need to set SSID and pass else it braks, so even we wdo not change in SSID nor pass or parameter, just entering+saving (with no change at all) it breaks the connection later!
@tablatronix commented on GitHub (Feb 25, 2020):
What version ?
@Cat30Mk3 commented on GitHub (Feb 25, 2020):
Well, for what it's worth, and with the dislaimer that I am C++ incompetent and really don't appreciate the complexities of this remarkable library, I tried a small edit to the latest development version WiFiManager.cpp which seems to solve my issue: (inserted at line 626) :
I tested and was successful with the following:
(1) saves changes to custom parameter without touching SSID or PSK
(2) saves changes to SSID & PSK as previous
(3) will not save any changes if SSID is truly blank as previous (I'm assuming this is fundamental)
I'm not sure if i've broken anything else or missed cases but it seems solid for my purposes.
@tablatronix commented on GitHub (Feb 25, 2020):
which version, development branch ? It might be broken still, let me check..
@tablatronix commented on GitHub (Feb 25, 2020):
you are posting 2 different issues,
savecallbacks do not occur if not saving wifi you have to set
setBreakAfterConfigto truethis is a known issue
erasing wifi credentials if blank is a bug and was fixed in 0.15 and should not exist in development branch
@Cat30Mk3 commented on GitHub (Feb 25, 2020):
Not sure about the two issues you mention .. I am only focused on the fact that I can not save parameters without touching SSID/PSK.
I should have mentioned that I was unsuccesssful with setBreakAfterConfig(true); on latest development version. I tried this again, and get the same result...
With setBreakAfterConfig(true); It change the way the AP exited , but still failed to save parameters UNLESS SSID/PSK were touched.
Here's the result of Save without touching SSID/PSK (parameter temp_Label2 was provided value "Attic") but that value never reached the program. You can see the "*WM: [2] No ssid, skipping wifi save " diagnostic print partway through.
Here's the full Diagnostic print from initiating AP to Reboot with setBreakAfterConfig(true) and not touching SSID/PSK
WiFiManager Diagnostic with setBreakAfterConfig(true).txt
@tablatronix commented on GitHub (Feb 25, 2020):
#1013
@tablatronix commented on GitHub (Feb 25, 2020):
works for me
@tablatronix commented on GitHub (Feb 25, 2020):
I updated the logging messages a little
@Cat30Mk3 commented on GitHub (Feb 26, 2020):
Ah Ha! Found it! Your results helped me track it down... now it works like yours..
THANKS!
Here's the issue I had :
when setBreakAfterConfig(true) is used without touching SSID/PSK
wifiManager.startConfigPortal(wmConfigDb.ssid,wmConfigDb.password) return FALSE,
and when SSID/PSK is touched return TRUE
heres where my code failed .. on return from .startConfigPortal I would force a reset without capturing parameters assuming FALSE was a failure to connect
if (!wifiManager.startConfigPortal(wmConfigDb.ssid,wmConfigDb.password)) {
Serial.println("failed to connect to wifiManager and hit timeout");
nonBlockingDelay(3000);
ESP.reset();
}
@tablatronix commented on GitHub (Feb 26, 2020):
Yeah its a known issue and has always been a problem, I need to replace it all but there is no way to change without breaking 1 thing, either the return result or when the callback occurs. I am trying to wait until develop since it will be a breaking change for some people, if you check the result and expect it to be false for connect fail and we now ignore it, I guess we can return true now but you can see how that could also be a problem.. I added #1013 to discuss
I need to remove those resets from the examples they are bad practice.
@Cat30Mk3 commented on GitHub (Feb 26, 2020):
Thanks again for your help. I can proceed with my next project now. I do use WM extensively and this is important to me. Obviously this fix is only temporary as the returned result is no longer useful to detect failed connections. I'll give it some thought as I proceed and if i have any revelations i will share them in #1013. Personally i don't have problem with adapting my code to accommodate your fix, but I can appreciate the impact you are trying to avoid. I'm happy to test if that helps I typically work with ESP8266 and ESP32.