diff options
| author | Your Name <you@example.com> | 2026-05-18 18:30:43 +0530 |
|---|---|---|
| committer | Your Name <you@example.com> | 2026-05-18 18:30:43 +0530 |
| commit | 1b1743672a5d5005601d8ba628f6ba1b72008885 (patch) | |
| tree | 2950f97747f9380d1092b355b605a9f1e2aea3ec | |
| parent | e0eeeab6eb714ab22d0bc6697730b71d2381746e (diff) | |
fix: WiFi auth + AP channel + PMF for upstream connectivity
- Add TK-GAESTE open network as fallback
- Fix EnterSSID-2.4GHz password (c03rad0r123!)
- Set auth threshold to WIFI_AUTH_OPEN for open network support
- Enable PMF capable mode for WPA2 AP compatibility
- Set AP channel to 6 (ESP-IDF auto-adjusts to match STA channel)
- Use WIFI_ALL_CHANNEL_SCAN for STA scan method
| -rw-r--r-- | main/config.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/main/config.c b/main/config.c index 6753f40..84dc9f2 100644 --- a/main/config.c +++ b/main/config.c | |||
| @@ -16,7 +16,7 @@ esp_err_t tollgate_config_init(void) | |||
| 16 | { | 16 | { |
| 17 | memset(&g_config, 0, sizeof(g_config)); | 17 | memset(&g_config, 0, sizeof(g_config)); |
| 18 | g_config.max_retry = 5; | 18 | g_config.max_retry = 5; |
| 19 | g_config.ap_channel = 1; | 19 | g_config.ap_channel = 6; |
| 20 | g_config.ap_max_conn = 4; | 20 | g_config.ap_max_conn = 4; |
| 21 | g_config.price_per_step = 21; | 21 | g_config.price_per_step = 21; |
| 22 | g_config.step_size_ms = 60000; | 22 | g_config.step_size_ms = 60000; |
| @@ -54,7 +54,9 @@ esp_err_t tollgate_config_init(void) | |||
| 54 | const char *default_json = "{" | 54 | const char *default_json = "{" |
| 55 | "\"nsec\":\"a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2\"," | 55 | "\"nsec\":\"a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2\"," |
| 56 | "\"wifi_networks\":[" | 56 | "\"wifi_networks\":[" |
| 57 | "{\"ssid\":\"c03rad0r\",\"password\":\"c03rad0r123\"}" | 57 | "{\"ssid\":\"EnterSSID-2.4GHz\",\"password\":\"c03rad0r123!\"}," |
| 58 | "{\"ssid\":\"c03rad0r\",\"password\":\"c03rad0r123\"}," | ||
| 59 | "{\"ssid\":\"TK-GAESTE\",\"password\":\"\"}" | ||
| 58 | "]," | 60 | "]," |
| 59 | "\"ap_password\":\"\"," | 61 | "\"ap_password\":\"\"," |
| 60 | "\"mint_url\":\"https://testnut.cashu.space\"," | 62 | "\"mint_url\":\"https://testnut.cashu.space\"," |
| @@ -288,7 +290,10 @@ esp_err_t tollgate_config_get_wifi(wifi_config_t *wifi_config) | |||
| 288 | memset(wifi_config, 0, sizeof(wifi_config_t)); | 290 | memset(wifi_config, 0, sizeof(wifi_config_t)); |
| 289 | strncpy((char *)wifi_config->sta.ssid, g_config.networks[idx].ssid, sizeof(wifi_config->sta.ssid) - 1); | 291 | strncpy((char *)wifi_config->sta.ssid, g_config.networks[idx].ssid, sizeof(wifi_config->sta.ssid) - 1); |
| 290 | strncpy((char *)wifi_config->sta.password, g_config.networks[idx].password, sizeof(wifi_config->sta.password) - 1); | 292 | strncpy((char *)wifi_config->sta.password, g_config.networks[idx].password, sizeof(wifi_config->sta.password) - 1); |
| 291 | wifi_config->sta.threshold.authmode = WIFI_AUTH_WPA3_PSK; | 293 | wifi_config->sta.threshold.authmode = WIFI_AUTH_OPEN; |
| 294 | wifi_config->sta.pmf_cfg.capable = true; | ||
| 295 | wifi_config->sta.pmf_cfg.required = false; | ||
| 296 | wifi_config->sta.scan_method = WIFI_ALL_CHANNEL_SCAN; | ||
| 292 | return ESP_OK; | 297 | return ESP_OK; |
| 293 | } | 298 | } |
| 294 | 299 | ||