-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
Documentation for WiFi.persistent() is misleading #3641
Comments
All functions that use persistent and config equal or saves needs to have default/current conditional based on persistent. There are a few, I will make note of them. |
This also affects functions that check mode, but save persistent if(wifi_get_opmode() == (uint8) m) {
return true;
} It is also special note, that the docs say The main problem with persistent is that is assumes current config has not been changed from default, which it can be by toggling persistent on and off. So both need to be checked in comparisons. |
This is what I am thinking |
I'm not sure if the changes you propose are required or not. However they are unrelated to this issue. The problem here was that the code does something else than the documentation says. But the code's behavior is good so the documentation has to be changed. |
Then I will create another issue, because I believe it is wrong and badly implemented. I see what you mean about the negated persistent functionality now, I missed that before. |
@herm Just curious, whats the reason for the underscore in your line containing WiFi._persistent? |
That is the name of the variable used in the library. |
I haven't looked into it yet. Was looking at storing wireless credentials,
read the esp8266 core general class docs, and "WiFi.persistent(false)"
didn't contain the underscore. Was just curious if this was going to be a
"gotcha" when I finally come around to coding for the esp8266
…On Wed, Apr 25, 2018, 2:28 PM Shawn A ***@***.***> wrote:
That is the name of the variable used in the library.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#3641 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/APr_s0oDxICm-8Y5m-dp3nRys4sm70bRks5tsMBjgaJpZM4Phpgi>
.
|
No thats the private variable you have a function call your good |
Cool, thanx Shawn
…On Wed, Apr 25, 2018, 3:22 PM Shawn A ***@***.***> wrote:
No thats the private variable you have a function call your good
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#3641 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/APr_sxfkIGRyXDq9rMvMqnnxlUXmlgctks5tsMzygaJpZM4Phpgi>
.
|
Only if ! notconfigequals, perhaps we should add debugging strings when doing set config defaults to help debug that? |
Paranoia is your friend in these cases, so I agree. |
there is currently |
Documentation at http://arduino-esp8266.readthedocs.io/en/latest/esp8266wifi/generic-class.html says
Setting persistent to false will get SSID / password written to flash only if currently used values do not match what is already stored in flash.
But the code does something different:
Arduino/libraries/ESP8266WiFi/src/ESP8266WiFiSTA.cpp
Lines 136 to 151 in 35d5fab
It writes settings to flash if they don't match the values in flash if persistent is set to true. If it is false it will not write to flash independent of the current value in flash.
The text was updated successfully, but these errors were encountered: