Skip to content

Documentation for WiFi.persistent() is misleading #3641

Closed
@herm

Description

@herm

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:

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions