Commit 9edcce5b authored by dnc40085's avatar dnc40085 Committed by Marcel Stör
Browse files

Update wifi.sta.config to save configuration to flash by default (#1998)

parent 2e33abe1
...@@ -830,7 +830,7 @@ static int wifi_station_config( lua_State* L ) ...@@ -830,7 +830,7 @@ static int wifi_station_config( lua_State* L )
} }
else else
{ {
save_to_flash=false; save_to_flash=true;
} }
lua_pop(L, 1); lua_pop(L, 1);
......
...@@ -410,8 +410,8 @@ Sets the WiFi station configuration. ...@@ -410,8 +410,8 @@ Sets the WiFi station configuration.
- "AC-1D-1C-B1-0B-22" - "AC-1D-1C-B1-0B-22"
- "DE AD BE EF 7A C0" - "DE AD BE EF 7A C0"
- `save` Save station configuration to flash. - `save` Save station configuration to flash.
- `true` configuration **will** be retained through power cycle. - `true` configuration **will** be retained through power cycle. (Default).
- `false` configuration **will not** be retained through power cycle. (Default). - `false` configuration **will not** be retained through power cycle.
- Event callbacks will only be available if `WIFI_SDK_EVENT_MONITOR_ENABLE` is uncommented in `user_config.h` - Event callbacks will only be available if `WIFI_SDK_EVENT_MONITOR_ENABLE` is uncommented in `user_config.h`
- 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()`. - 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()`.
- `connected_cb`: Callback to execute when station is connected to an access point. (Optional) - `connected_cb`: Callback to execute when station is connected to an access point. (Optional)
......
...@@ -111,7 +111,7 @@ wifi.eventmon.register(wifi.eventmon.STA_DISCONNECTED, wifi_disconnect_event) ...@@ -111,7 +111,7 @@ wifi.eventmon.register(wifi.eventmon.STA_DISCONNECTED, wifi_disconnect_event)
print("Connecting to WiFi access point...") print("Connecting to WiFi access point...")
wifi.setmode(wifi.STATION) wifi.setmode(wifi.STATION)
wifi.sta.config({ssid=SSID, pwd=PASSWORD, save=true}) wifi.sta.config({ssid=SSID, pwd=PASSWORD})
-- wifi.sta.connect() not necessary because config() uses auto-connect=true by default -- wifi.sta.connect() not necessary because config() uses auto-connect=true by default
``` ```
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment