diff options
| author | Your Name <you@example.com> | 2026-05-16 11:56:43 +0530 |
|---|---|---|
| committer | Your Name <you@example.com> | 2026-05-16 11:56:43 +0530 |
| commit | 38aa9ec3801f5895e09866fe92cb8e44fb987cee (patch) | |
| tree | c702c27cd59fa0e73bc3e8665e1582e6b9509cf6 /main/config.h | |
| parent | ee4e13680f522253f94e8ebdea5df80332afc495 (diff) | |
Unique SSID/IP per board + captive detection fix + mint list in portal
- Derive unique SSID (TollGate-{MAC4}{MAC5}) and AP IP (10.{b5}.{subnet}.1)
from factory MAC — boards no longer conflict
- Board A: TollGate-377C @ 10.55.85.1, Board B: TollGate-5050 @ 10.80.10.1
- Captive portal detection URIs return 200 with portal HTML (matching
esp32-mesh working approach) instead of 302 redirect
- Dynamic AP IP in portal HTML via __AP_IP__ template substitution
- Supported mints section in portal page (shows mint URL, tap to copy)
- Fixed mint URL to testnut.cashu.space (was stale in SPIFFS)
- DoT reject server on port 853 for DNS-over-TLS fallback
- DNS hijack: NXDOMAIN for all non-A queries, no forwarding for unauthed
- Playwright tests updated for 200 response on detection URIs
- Phase 2 test suite: 20/21 pass (test 22 expiry ping route issue)
- Tests 25-27 deferred to Phase 3 (Board B as second client)
Diffstat (limited to 'main/config.h')
| -rw-r--r-- | main/config.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/main/config.h b/main/config.h index d26b7ae..dd3fe05 100644 --- a/main/config.h +++ b/main/config.h | |||
| @@ -3,6 +3,8 @@ | |||
| 3 | 3 | ||
| 4 | #include "esp_err.h" | 4 | #include "esp_err.h" |
| 5 | #include "esp_wifi.h" | 5 | #include "esp_wifi.h" |
| 6 | #include "esp_netif.h" | ||
| 7 | #include <stdbool.h> | ||
| 6 | 8 | ||
| 7 | #define TOLLGATE_MAX_WIFI_NETWORKS 5 | 9 | #define TOLLGATE_MAX_WIFI_NETWORKS 5 |
| 8 | #define TOLLGATE_MAX_MINT_URLS 3 | 10 | #define TOLLGATE_MAX_MINT_URLS 3 |
| @@ -25,12 +27,19 @@ typedef struct { | |||
| 25 | uint8_t ap_channel; | 27 | uint8_t ap_channel; |
| 26 | uint8_t ap_max_conn; | 28 | uint8_t ap_max_conn; |
| 27 | 29 | ||
| 30 | esp_ip4_addr_t ap_ip; | ||
| 31 | char ap_ip_str[16]; | ||
| 32 | |||
| 28 | char mint_url[256]; | 33 | char mint_url[256]; |
| 29 | char lnurl_url[256]; | 34 | char lnurl_url[256]; |
| 30 | int price_per_step; | 35 | int price_per_step; |
| 31 | int step_size_ms; | 36 | int step_size_ms; |
| 37 | |||
| 38 | bool unique_derived; | ||
| 32 | } tollgate_config_t; | 39 | } tollgate_config_t; |
| 33 | 40 | ||
| 41 | void tollgate_config_derive_unique(tollgate_config_t *cfg); | ||
| 42 | |||
| 34 | esp_err_t tollgate_config_init(void); | 43 | esp_err_t tollgate_config_init(void); |
| 35 | const tollgate_config_t *tollgate_config_get(void); | 44 | const tollgate_config_t *tollgate_config_get(void); |
| 36 | esp_err_t tollgate_config_get_wifi(wifi_config_t *wifi_config); | 45 | esp_err_t tollgate_config_get_wifi(wifi_config_t *wifi_config); |