Skip to content

feat: implement modular configurable RGB LED status indicators#275

Open
Mathew005 wants to merge 3 commits into
ruvnet:mainfrom
Mathew005:feature/led-indicators
Open

feat: implement modular configurable RGB LED status indicators#275
Mathew005 wants to merge 3 commits into
ruvnet:mainfrom
Mathew005:feature/led-indicators

Conversation

@Mathew005
Copy link
Copy Markdown
Contributor

Description

This PR implements a comprehensive, configurable RGB LED status indicator system for the ESP32-S3 CSI Node. It provides real-time visual feedback on system states (Booting, WiFi Connecting, Connected, and Error) while remaining fully customizable via Kconfig and NVS.

Features

  • Modular Driver: Dedicated led_indicator.c driver running as a background FreeRTOS task.
  • State Machine:
    • Solid White: System Booting / NVS Initialization.
    • Fast Blinking Blue: WiFi Searching/Connecting.
    • Slow Pulsing Green: WiFi Connected & CSI Streaming.
    • Solid Red: WiFi Connection Failure / Retries Exhausted.
  • Full Configurability:
    • Compile-time: CONFIG_RGB_LED_ENABLED and CONFIG_RGB_LED_GPIO (defaults to pin 38).
    • Run-time: Dynamic toggling via NVS (status_led flag).
    • Provisioning: Support added to provision.py via the --status-led flag.

Bug Fixes Included

  • Linter Fixes: Resolved Pyre type-checking errors in provision.py for MAC address parsing and NVS binary generation.
  • Live Disconnect Hook: Fixed an edge case where the LED stayed green if the WiFi dropped during operation; it now correctly reverts to searching (blue) or error (red).
  • Initialization Reset: Fixed an issue where disabling the LED via NVS would leave it latched at the last color; the driver now explicitly clears the hardware state before stopping.

Testing

  • Hardware: ESP32-S3 board (COM8).
  • Scenarios Verified:
    • --status-led 1: Flawless state transitions from White -> Blue -> Green.
    • Hotspot Drop: Turning off the hotspot immediately triggered the Blinking Blue retry state and eventually Solid Red.
    • --status-led 0: Verified the LED stays completely dark upon boot and throughout operation.
    • MAC Filtering: Verified provision.py still correctly parses and flashes MAC filter binary blobs.

@Mathew005
Copy link
Copy Markdown
Contributor Author

Description

This PR introduces an enhanced, fully configurable RGB LED status indicator system for the ESP32-S3 CSI Node. It expands on the existing design to provide real-time visual feedback across multiple subsystems (Booting, WiFi, mmWave, and Swarm) while remaining flexible through NVS configuration and provisioning.

Features

  • Unified Driver:
    A modular RGB LED driver implemented as a background FreeRTOS task, responsible for managing all system states in a centralized manner.

  • Enhanced State Machine:

    • WiFi:
      • Fast Blinking Blue → Connecting
      • Solid Red → Connection Error / Failure
      • Slow Pulsing Green → Connected & Healthy
    • mmWave Sensor:
      • Slow Blinking Yellow → Sensor detected but failed to initialize
    • Swarm Bridge:
      • Slow Blinking Magenta → Seed unreachable
      • Quick Magenta Flash → Successful data ingest event
  • Smart State Handling:
    Error and diagnostic states (mmWave, Swarm) are conditionally evaluated. If a subsystem is not configured or detected, its error state is skipped—ensuring the LED reflects a valid “healthy” (Green) state for partial but functional setups.

  • Provisioning Support:
    Extended provisioning via provision.py:

    • --status-led 1/0 for runtime enable/disable
    • Additional flags for Swarm configuration and diagnostics

Testing

  • Hardware Integration:
    Verified on ESP32-S3 boards (COM5 and COM8) across both receiver and TDM configurations.

  • Failure Resilience:

    • Disabling the Swarm Seed correctly triggers Magenta diagnostic states
    • Disconnecting the mmWave sensor triggers Yellow error indication
    • WiFi failure paths correctly fall back to Red
  • Build Validation:
    Successfully compiled and tested in a Docker-based ESP-IDF v5.2 environment.

@ruvnet
Copy link
Copy Markdown
Owner

ruvnet commented May 17, 2026

Rebase needed — current main has had multiple firmware/esp32-csi-node changes (Kconfig, CMakeLists, and #273 just merged disabling the onboard WS2812 during CSI collection). Once rebased your modular RGB indicator should sit cleanly on top of the #273 disable logic. Happy to re-review post-rebase.

@Mathew005 Mathew005 force-pushed the feature/led-indicators branch from 9dfd80b to 5eb7f10 Compare May 18, 2026 05:30
Mathew005 added 3 commits May 18, 2026 11:09
- Added LED_STATE_MMWAVE_ERROR, LED_STATE_SWARM_ERROR, and LED_STATE_SWARM_ACTIVE.
- Integrated mmWave initialization health check into LED status.
- Added Swarm Bridge registration, heartbeat, and ingest feedback (Magenta pulse).
- Improved overall system status robustness by skipping errors for unconfigured features.
@Mathew005 Mathew005 force-pushed the feature/led-indicators branch from 5eb7f10 to 3f5ef89 Compare May 18, 2026 05:48
@Mathew005
Copy link
Copy Markdown
Contributor Author

I've rebased the branch onto the latest main.

Here is what was resolved:

Integration with #273: Using conditional compilation (#ifdef CONFIG_RGB_LED_ENABLED), the modular RGB status indicator task claims the LED when enabled. If disabled, it cleanly falls back to the one-shot #273 explicit disable logic to prevent Wi-Fi interference.
Fallbacks: Added a preprocessor fallback for the GPIO pin to guarantee the firmware compiles flawlessly even when the RGB LED subsystem is completely disabled in menuconfig.
Build Validation: Verified that both configurations (LED enabled and disabled) build cleanly in the upgraded ESP-IDF v5.4 environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants