Skip to content

Commit 9edcce5

Browse files
dnc40085marcelstoer
authored andcommitted
Update wifi.sta.config to save configuration to flash by default (#1998)
1 parent 2e33abe commit 9edcce5

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

app/modules/wifi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,7 @@ static int wifi_station_config( lua_State* L )
830830
}
831831
else
832832
{
833-
save_to_flash=false;
833+
save_to_flash=true;
834834
}
835835
lua_pop(L, 1);
836836

docs/en/modules/wifi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,8 +410,8 @@ Sets the WiFi station configuration.
410410
- "AC-1D-1C-B1-0B-22"
411411
- "DE AD BE EF 7A C0"
412412
- `save` Save station configuration to flash.
413-
- `true` configuration **will** be retained through power cycle.
414-
- `false` configuration **will not** be retained through power cycle. (Default).
413+
- `true` configuration **will** be retained through power cycle. (Default).
414+
- `false` configuration **will not** be retained through power cycle.
415415
- Event callbacks will only be available if `WIFI_SDK_EVENT_MONITOR_ENABLE` is uncommented in `user_config.h`
416416
- Please note: To ensure all station events are handled at boot time, all relevant callbacks must be registered as early as possible in `init.lua` with either `wifi.sta.config()` or `wifi.eventmon.register()`.
417417
- `connected_cb`: Callback to execute when station is connected to an access point. (Optional)

docs/en/upload.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ wifi.eventmon.register(wifi.eventmon.STA_DISCONNECTED, wifi_disconnect_event)
111111

112112
print("Connecting to WiFi access point...")
113113
wifi.setmode(wifi.STATION)
114-
wifi.sta.config({ssid=SSID, pwd=PASSWORD, save=true})
114+
wifi.sta.config({ssid=SSID, pwd=PASSWORD})
115115
-- wifi.sta.connect() not necessary because config() uses auto-connect=true by default
116116

117117
```

0 commit comments

Comments
 (0)