diff --git a/dashboard/js/onboard.js b/dashboard/js/onboard.js index c92fcad..84e85d2 100644 --- a/dashboard/js/onboard.js +++ b/dashboard/js/onboard.js @@ -660,11 +660,11 @@ '
' + '
' + '' + - '' + + '' + '
' + '
' + '' + - '' + + '' + '
' + '
' + 'Advanced: Mothership Address' + diff --git a/firmware/main/wifi.c b/firmware/main/wifi.c index 3a1625d..42f4361 100644 --- a/firmware/main/wifi.c +++ b/firmware/main/wifi.c @@ -156,11 +156,19 @@ esp_err_t wifi_start_connect(void) { wifi_config_t wifi_config = {0}; strncpy((char *)wifi_config.sta.ssid, ssid, sizeof(wifi_config.sta.ssid) - 1); strncpy((char *)wifi_config.sta.password, password, sizeof(wifi_config.sta.password) - 1); - wifi_config.sta.threshold.authmode = WIFI_AUTH_WPA2_PSK; + + // Accept open networks when no password is set; otherwise allow WPA or WPA2 + // so networks with special characters in the password work regardless of AP mode. + if (strlen(password) == 0) { + wifi_config.sta.threshold.authmode = WIFI_AUTH_OPEN; + } else { + wifi_config.sta.threshold.authmode = WIFI_AUTH_WPA_WPA2_PSK; + } wifi_config.sta.pmf_cfg.capable = true; wifi_config.sta.pmf_cfg.required = false; - ESP_LOGI(TAG, "Connecting to WiFi: %s", ssid); + ESP_LOGI(TAG, "Connecting to WiFi: %s (authmode: %s)", ssid, + strlen(password) == 0 ? "open" : "WPA/WPA2"); ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA)); ESP_ERROR_CHECK(esp_wifi_set_config(WIFI_IF_STA, &wifi_config));