Skip to content

feat: implement modular configurable RGB LED status indicators#275

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

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

Conversation

@Mathew005
Copy link

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.

- 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
Copy link
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.

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.

1 participant