From e19102d5848364fc683d513879d78d69f82609cd Mon Sep 17 00:00:00 2001 From: Sebastien Roy Date: Sun, 31 Jan 2021 11:03:15 -0500 Subject: [PATCH 1/2] solved open network issue3374 --- app/modules/enduser_setup.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/modules/enduser_setup.c b/app/modules/enduser_setup.c index a829773815..810ce20be1 100644 --- a/app/modules/enduser_setup.c +++ b/app/modules/enduser_setup.c @@ -832,9 +832,14 @@ static int enduser_setup_http_handle_credentials(char *data, unsigned short data state->success = 0; state->lastStationStatus = 0; + char *name_str = strstr(data, "wifi_ssid="); char *pwd_str = strstr(data, "wifi_password="); - if (name_str == NULL || pwd_str == NULL) + + // in case we dont get a passwd (for open networks) + if (pwd_str == NULL) { pwd_str="wifi_password="; } + + if (name_str == NULL) { ENDUSER_SETUP_DEBUG("Password or SSID string not found"); return 1; From d7fa22b1beb6b4e915d80b79359f64e3196bc86e Mon Sep 17 00:00:00 2001 From: Sebastien Roy Date: Mon, 1 Feb 2021 23:17:10 -0500 Subject: [PATCH 2/2] added adequate messages amd update docs --- app/modules/enduser_setup.c | 7 +++++-- docs/modules/enduser-setup.md | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/modules/enduser_setup.c b/app/modules/enduser_setup.c index 810ce20be1..8badb49ddf 100644 --- a/app/modules/enduser_setup.c +++ b/app/modules/enduser_setup.c @@ -837,11 +837,14 @@ static int enduser_setup_http_handle_credentials(char *data, unsigned short data char *pwd_str = strstr(data, "wifi_password="); // in case we dont get a passwd (for open networks) - if (pwd_str == NULL) { pwd_str="wifi_password="; } + if (pwd_str == NULL) { + pwd_str="wifi_password="; + ENDUSER_SETUP_DEBUG("No passord provided. Assuming open network"); + } if (name_str == NULL) { - ENDUSER_SETUP_DEBUG("Password or SSID string not found"); + ENDUSER_SETUP_DEBUG("SSID string not found"); return 1; } diff --git a/docs/modules/enduser-setup.md b/docs/modules/enduser-setup.md index 279d915f2b..bd6c6fd972 100644 --- a/docs/modules/enduser-setup.md +++ b/docs/modules/enduser-setup.md @@ -54,6 +54,7 @@ Then the `eus_params.lua` file will contain the following: ```lua -- those wifi_* are the base parameters that are saved anyway +-- if network is open, then there is no wifi_password local p = {} p.wifi_ssid="ssid" p.wifi_password="password"