-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Closed
Description
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
if(sta_config_equal(current_conf, conf)) { | |
DEBUGV("sta config unchanged"); | |
} | |
else { | |
ETS_UART_INTR_DISABLE(); | |
if(WiFi._persistent) { | |
// workaround for #1997: make sure the value of ap_number is updated and written to flash | |
// to be removed after SDK update | |
wifi_station_ap_number_set(2); | |
wifi_station_ap_number_set(1); | |
wifi_station_set_config(&conf); | |
} else { | |
wifi_station_set_config_current(&conf); | |
} |
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.