-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wifimanger do not remember pass nor SSID in Confriguation mode, and save empty "strings" when closing after changing other parameters? #1010
Comments
What version? |
Ups.....that part I did forget to write....I am using the version Ken Taloy made, so maybe that is the reason? |
yes |
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! |
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? |
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. |
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 |
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? |
I am using the D1 mini, same issue here. |
I'm getting inconsistent results. It seems that 1/2 of the time it connects correctly whilst the other half it starts the ap |
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 ******** But if I enter the unchanged ssid & psk it works every time: |
What works? What is not working |
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: |
Did you pull recently? I tested this the other day I think. There is no save if its blank |
Yes today from development branch. |
It is not actually blank, it is populated with existing ssid and password (shows ********) |
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 |
Also esp8266 or esp32? You can make a new issue for this if you want |
I will take a look asap at this |
Sorry if i am not being clear .. |
Thats how it is supposed to work. No wifi change so skipping the wifi save |
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? |
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 |
you have to set shouldbreakafterconfig right now for it to work, I do not have it refactored yet |
Hi there, I aosl thought this was a faoult and did not assume it was the normal behavier! |
REgarding, |
What version ? |
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: I'm not sure if i've broken anything else or missed cases but it seems solid for my purposes. |
which version, development branch ? It might be broken still, let me check.. |
you are posting 2 different issues, savecallbacks do not occur if not saving wifi you have to set //if this is set, it will exit after config, even if connection is unsuccessful.
void setBreakAfterConfig(boolean shouldBreak); erasing wifi credentials if blank is a bug and was fixed in 0.15 and should not exist in development branch |
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. *WM: [2] <- HTTP WiFi save
*WM: [3] Method: POST
*WM: [2] Parameters
*WM: [2] --------------------
*WM: [2] localDeviceName: 1527Rawlings
*WM: [2] remoteDeviceName: RSU-B
*WM: [2] mqttServer: broker.mqtt-dashboard.com
*WM: [2] mqttUserId:
*WM: [2] mqttPassword:
*WM: [2] tempLabel_0: Outside
*WM: [2] tempLabel_1: Attic
*WM: [2] tempLabel_2:
*WM: [2] tempLabel_3:
*WM: [2] tempLabel_4:
*WM: [2] tempLabel_5:
*WM: [2] tempLabel_6:
*WM: [2] --------------------
*WM: [3] Sent wifi save page
*WM: [2] process connect
*WM: [2] No ssid, skipping wifi save
Should save config
*WM: [2] disconnect configportal
*WM: [2] restoring usermode STA
*WM: [2] wifi status: WL_CONNECTED
*WM: [2] wifi mode: STA
*WM: [1] config portal exiting
failed to connect to wifiManager and hit timeout
ets Jan 8 2013,rst cause:2, boot mode:(3,6)
load 0x4010f000, len 1392, room 16
tail 0
chksum 0xd0
csum 0xd0
v3d128e5c
~ld Here's the full Diagnostic print from initiating AP to Reboot with setBreakAfterConfig(true) and not touching SSID/PSK |
works for me *WM: [3] -> captive.apple.com
*WM: [2] <- Request redirected to captive portal
*WM: [2] <- HTTP Root
*WM: [3] -> 192.168.4.1
*WM: [3] lastconxresulttmp: WL_NO_SSID_AVAIL
*WM: [3] lastconxresult: WL_NO_SSID_AVAIL
*WM: [2] Scan is cached 5811 ms ago
*WM: [2] <- HTTP WiFi save
*WM: [3] Method: POST
*WM: [3] Sent wifi save page
*WM: [2] process connect
*WM: [2] No ssid, skipping wifi save
*WM: [1] WiFi/Param save callback
[CALLBACK] saveCallback fired
*WM: [2] disconnect configportal
*WM: [2] restoring usermode STA
*WM: [2] wifi status: WL_DISCONNECTED
*WM: [2] wifi mode: STA
*WM: [1] config portal exiting
failed to connect and hit timeout
Mode: STA
Channel: 1
SSID (5): Shawn
Passphrase (8): 12345678
BSSID set: 0
YES
SSID:
PASS: 12345678
OTA server at: esp32-a4cf1224c810.local:3232 |
I updated the logging messages a little |
Ah Ha! Found it! Your results helped me track it down... now it works like yours.. Here's the issue I had : 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)) { |
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.
|
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. |
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
The text was updated successfully, but these errors were encountered: