Skip to content

Commit 15fc8c8

Browse files
blobulemarcelstoer
authored andcommitted
Add support for open networks to enduser_setup (#3392)
1 parent 2c50f23 commit 15fc8c8

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

app/modules/enduser_setup.c

+10-2
Original file line numberDiff line numberDiff line change
@@ -832,11 +832,19 @@ static int enduser_setup_http_handle_credentials(char *data, unsigned short data
832832
state->success = 0;
833833
state->lastStationStatus = 0;
834834

835+
835836
char *name_str = strstr(data, "wifi_ssid=");
836837
char *pwd_str = strstr(data, "wifi_password=");
837-
if (name_str == NULL || pwd_str == NULL)
838+
839+
// in case we dont get a passwd (for open networks)
840+
if (pwd_str == NULL) {
841+
pwd_str="wifi_password=";
842+
ENDUSER_SETUP_DEBUG("No passord provided. Assuming open network");
843+
}
844+
845+
if (name_str == NULL)
838846
{
839-
ENDUSER_SETUP_DEBUG("Password or SSID string not found");
847+
ENDUSER_SETUP_DEBUG("SSID string not found");
840848
return 1;
841849
}
842850

docs/modules/enduser-setup.md

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ Then the `eus_params.lua` file will contain the following:
5454

5555
```lua
5656
-- those wifi_* are the base parameters that are saved anyway
57+
-- if network is open, then there is no wifi_password
5758
local p = {}
5859
p.wifi_ssid="ssid"
5960
p.wifi_password="password"

0 commit comments

Comments
 (0)