From 2517cef7db3b9984aac5fe6d9eee60752edfc837 Mon Sep 17 00:00:00 2001 From: clement Date: Sat, 13 Jun 2026 15:04:05 +0200 Subject: [PATCH] fix(box3): SPIFFS mount + canal WiFi configurable pour relais ESP-NOW MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit scenario_server.c : SPIFFS_LABEL valait "storage" alors que la partition s'appelle "spiffs" (partitions.csv) → esp_vfs_spiffs_register échouait en ESP_ERR_NOT_FOUND, la BOX-3 ne pouvait persister aucun scénario reçu (HTTP 500 + relais ESP-NOW sans effet). Corrigé en "spiffs". main.c + Kconfig.projbuild : ajout de CONFIG_ZACUS_WIFI_CHANNEL (défaut 0 = auto) câblé sur wifi_config.sta.channel. Sur réseau multi-AP / mesh (même SSID sur plusieurs canaux), permet de forcer la BOX-3 co-canal avec le master — prérequis ESP-NOW. Validé sur matériel : master (ch6) → POST /game/scenario/relay → la BOX-3 reçoit + réassemble (679 B) via scenario_mesh, monte SPIFFS, hot-load OK, reboot pour appliquer. Co-Authored-By: Claude Opus 4.8 (1M context) --- box3_voice/main/Kconfig.projbuild | 10 ++++++++++ box3_voice/main/main.c | 1 + box3_voice/main/scenario_server.c | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/box3_voice/main/Kconfig.projbuild b/box3_voice/main/Kconfig.projbuild index 2963391..4bd33f3 100644 --- a/box3_voice/main/Kconfig.projbuild +++ b/box3_voice/main/Kconfig.projbuild @@ -12,6 +12,16 @@ menu "Zacus BOX-3 Voice Configuration" help WiFi password. Leave empty for open networks. + config ZACUS_WIFI_CHANNEL + int "WiFi channel hint (0 = auto)" + default 0 + range 0 13 + help + Bias the STA scan to start on this channel (1-13). Set this to the + master's WiFi channel so ESP-NOW peers land co-channel — required + for the scenario relay on multi-AP / mesh networks where the same + SSID is broadcast on several channels. 0 = auto (scan all). + config ZACUS_VOICE_BRIDGE_URL string "Voice Bridge WebSocket URL" default "ws://192.168.0.119:8200/voice/ws" diff --git a/box3_voice/main/main.c b/box3_voice/main/main.c index af63310..c66d713 100644 --- a/box3_voice/main/main.c +++ b/box3_voice/main/main.c @@ -89,6 +89,7 @@ static esp_err_t wifi_init_sta(void) .ssid = CONFIG_ZACUS_WIFI_SSID, .password = CONFIG_ZACUS_WIFI_PASSWORD, .threshold.authmode = WIFI_AUTH_WPA2_PSK, + .channel = CONFIG_ZACUS_WIFI_CHANNEL, /* co-channel master for ESP-NOW relay (0 = auto) */ }, }; diff --git a/box3_voice/main/scenario_server.c b/box3_voice/main/scenario_server.c index 3c5a3b3..f476f81 100644 --- a/box3_voice/main/scenario_server.c +++ b/box3_voice/main/scenario_server.c @@ -25,7 +25,7 @@ #define TAG "scenario_srv" #define MAX_SCENARIO_BYTES (64 * 1024) -#define SPIFFS_LABEL "storage" +#define SPIFFS_LABEL "spiffs" #define SPIFFS_BASE "/spiffs" #define SCENARIO_PATH SPIFFS_BASE "/scenario.json" #define SCENARIO_BAK SPIFFS_BASE "/scenario.bak"