From fa28318baed928c0c10ffd2d547c1dd725cd62ca Mon Sep 17 00:00:00 2001 From: Mathew005 <92505643+Mathew005@users.noreply.github.com> Date: Mon, 18 May 2026 03:48:10 +0530 Subject: [PATCH] fix(led): disable onboard WS2812 LED during CSI collection (#273) --- firmware/esp32-csi-node/main/idf_component.yml | 3 +++ firmware/esp32-csi-node/main/main.c | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/firmware/esp32-csi-node/main/idf_component.yml b/firmware/esp32-csi-node/main/idf_component.yml index 7c52a6f4..4ec1d552 100644 --- a/firmware/esp32-csi-node/main/idf_component.yml +++ b/firmware/esp32-csi-node/main/idf_component.yml @@ -8,3 +8,6 @@ dependencies: ## LCD touch abstraction espressif/esp_lcd_touch: "^1.0" + + ## Onboard WS2812 LED Disabling + espressif/led_strip: "^3.0.0" diff --git a/firmware/esp32-csi-node/main/main.c b/firmware/esp32-csi-node/main/main.c index b80b0f83..0f6662f9 100644 --- a/firmware/esp32-csi-node/main/main.c +++ b/firmware/esp32-csi-node/main/main.c @@ -18,6 +18,7 @@ #include "nvs_flash.h" #include "esp_app_desc.h" #include "sdkconfig.h" +#include "led_strip.h" #include "csi_collector.h" #include "stream_sender.h" @@ -149,6 +150,23 @@ void app_main(void) ESP_LOGI(TAG, "ESP32-S3 CSI Node (ADR-018) — v%s — Node ID: %d", app_desc->version, g_nvs_config.node_id); + /* Turn off onboard WS2812 LED on GPIO 38 */ + led_strip_handle_t led_strip; + led_strip_config_t strip_config = { + .strip_gpio_num = 38, + .max_leds = 1, + .led_model = LED_MODEL_WS2812, + .color_component_format = LED_STRIP_COLOR_COMPONENT_FMT_GRB, + .flags.invert_out = false, + }; + led_strip_rmt_config_t rmt_config = { + .resolution_hz = 10 * 1000 * 1000, // 10MHz + .flags.with_dma = false, + }; + if (led_strip_new_rmt_device(&strip_config, &rmt_config, &led_strip) == ESP_OK) { + led_strip_clear(led_strip); + } + /* Initialize WiFi STA (skip entirely under QEMU mock — no RF hardware) */ #ifndef CONFIG_CSI_MOCK_SKIP_WIFI_CONNECT wifi_init_sta();