-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
AP connect failures when stored client fails. #115
Comments
nice investigative work:
and maybe it won t erase the settings. this should be tested as well, that if you reboot, instead of reconfigure after starting the portal, it would still remember the old settings. i think this is very important thanks |
Eraseconfig requires a reboot but yeah the problem goes away cause theres nothing to connect to. Disconnect should not erase config it should turn off radio. Maybe i read wrong cause that makes no sense. |
if persistent is true, disconnect will also erase config. that s what i used in resetSettings, seems very effective erase config deletes calibration data, so if it s done before connecting to anything, should it not help? ( i haven t look in what it actually does, i just saw the recommandation at some point by igrr to put it in front of everything, before connecting, etc...i think...if i remember correctly) |
Erase config wipes your config file so it requires a reboot to take effect and like you said you lose config which could be bad if you make mistake or cancel config |
i tried it without reset so that s why i didn t see the erase of ssid pass as well |
so yes, 1 doesn t seem to be a go... |
Yeah its probably async I always manually restart never tried automating it. |
well, i looked at it, it actually wipes the flash sectors cotaning the data, so it matters when that data is read, to see if it needs a reset or not |
I can't even find the definition for WiFi.disconnect in the source, Did you see it even documented somewhere? |
yeah not sure how I was missing it. So I cannot reproduce this outside of wifimanager. I am trying to replicate as close as possible, but no luck. Strange.
I am not doing the dns and webserver stuff... I wonder. |
i ve been trying the same with no luck, but did not get to webserver level like you that should simulate the client being connected as well |
retracted, i missed something so simple |
It is If you add a delay of 1-2s after it, or remove it, its works fine. no clue why, done for today. |
hi, i ve noticed another scenario that seems to be leading to a deadlock in WiFi.waitForConnectResult() i ran into it and added a possible fix to wifi manager, but that only works when you try with a good user and password |
Yeah its a odd thing I never did figure it out, but its a timing issue of where in an ap autoconnect failure scan process you try to start the softap, I am thinking it is something to do with a reset state or which channel the scan is on or landed on (it ends at 14, which is not supported by some hardware) so maybe that is why my IOS has issues. But I gave up for a while until I can get more advanced debugging and find out where that code is and how it works. |
the issue in waitForConnectResult i found, seems realted to the fact that the SDK starts connecting on boot, even before we call any functions in wifimanager |
I find that if you can do your stuff before it even has a chance then you are usually ok. Either way autoconnect = false should theoretically resolve, but i guess it saves and then you need to restart for it to take effect also. wificonnect() is probably in the sdk and out of the libraries control, that I could see. |
hi, finally i was able to reproduce this outside wifi manager |
hi, i ve just made another commit to this, could you please try the github version of WiFiManager and see if anything changed for you? |
paste the commit hashes ? It does seem more stable now. |
ahh, interesting fixes. |
did anyone figure out how to do this yet, i "persisted" an accesspoint i've never even connected to and now it won't even try other AP's. |
Do you have alot of AP in the area ? You have 2 options as this thread notes. add WiFi.disconnect(true); before your ap connect in your sketch. erase_config using esptool |
this does absolutely nothing, doesn't even blink the serial led i don't think: https://github.com/igrr/esptool-ck/#erase-flash-on-a-nodemcu-board running this a few times seems to do it randomly:
|
I never could get esptool.exe to erase flash, i had to use esptool.py |
For a low effort flash erasure, there is an Arduino sketch at https://github.com/kentaylor/EraseEsp8266Flash |
nicely documented too @kentaylor |
Hey guys, Figured something out! Turns out the host definition in both the WiFiClientBasic and WifiClient example scripts was wrong. Change this: Something about the way the libraries define whether we are asking for a IP or a DNS. Especially working with teeny dumb boards (I am on a NodeMCU 0.9). And I could connect to google via my home wifi but then couldn't seem to connect to 192.168.4.1 on my second NodeBoard And wow that's like 10 hours of my life I won't get back. Also the WifiClientBasic script doesn't have a GET command so doesn't ever print out the webpage, but at least the WifiClient example script does. Things that didn't help For seeing the IPaddress thingo in action look up the ChatServer example |
So this is a pretty normal thing. You move your board from one network to another ( I do this everyday for development )
And I noticed if there is a stored config, and it fails to connect or find the SSID, then soft AP mode does 2 things.
I am tracking this issue as similar
esp8266/Arduino#1094
also see my notes on it.
I added an explicit disconnect to
startConfigPortal()
and it seems to have stabilized my setup. ( IOS always fails to connect to AP )I am not sure why changing mode doesn't handle this alone, but it seems some channel scan or something keeps running in the background ( no debugging revealed what it was ), maybe some interrupt problem or memory problem or by design.
fyi
ESP.eraseConfig()
and reboot also fixes the issue, but not ideal solution obviously.The text was updated successfully, but these errors were encountered: