Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for open networks to enduser_setup #3392

Merged
merged 3 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions app/modules/enduser_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -832,11 +832,19 @@ 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=";
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;
}

Expand Down
1 change: 1 addition & 0 deletions docs/modules/enduser-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down