From 9edcce5b44374e6647ea809dd99cb42f21a5de19 Mon Sep 17 00:00:00 2001 From: dnc40085 Date: Sat, 8 Jul 2017 13:51:33 -0700 Subject: [PATCH] Update wifi.sta.config to save configuration to flash by default (#1998) --- app/modules/wifi.c | 2 +- docs/en/modules/wifi.md | 4 ++-- docs/en/upload.md | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/modules/wifi.c b/app/modules/wifi.c index cbefe33c..1a1e73d7 100644 --- a/app/modules/wifi.c +++ b/app/modules/wifi.c @@ -830,7 +830,7 @@ static int wifi_station_config( lua_State* L ) } else { - save_to_flash=false; + save_to_flash=true; } lua_pop(L, 1); diff --git a/docs/en/modules/wifi.md b/docs/en/modules/wifi.md index abddf471..0b50506a 100644 --- a/docs/en/modules/wifi.md +++ b/docs/en/modules/wifi.md @@ -410,8 +410,8 @@ Sets the WiFi station configuration. - "AC-1D-1C-B1-0B-22" - "DE AD BE EF 7A C0" - `save` Save station configuration to flash. - - `true` configuration **will** be retained through power cycle. - - `false` configuration **will not** be retained through power cycle. (Default). + - `true` configuration **will** 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` - 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) diff --git a/docs/en/upload.md b/docs/en/upload.md index 441bf3d8..2f56a79b 100644 --- a/docs/en/upload.md +++ b/docs/en/upload.md @@ -111,7 +111,7 @@ wifi.eventmon.register(wifi.eventmon.STA_DISCONNECTED, wifi_disconnect_event) print("Connecting to WiFi access point...") 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 ```