| name | platformio |
| description | Builds and deploys ESP32 firmware with PlatformIO for the VanDaemon LED dimmer hardware.
Use when: Building, uploading, or debugging ESP32 firmware in hw/LEDDimmer/
|
| allowed-tools | Read, Edit, Write, Glob, Grep, Bash |
PlatformIO Skill
PlatformIO manages the ESP32 firmware for VanDaemon's 8-channel PWM LED dimmer. The firmware handles MQTT communication, WiFi provisioning via captive portal, and NVS state persistence. All firmware lives in hw/LEDDimmer/firmware/.
Quick Start
Build and Upload
cd hw/LEDDimmer/firmware
pio run -e 8ch
pio run -e 8ch -t upload
pio run -e 4ch -t upload
Monitor Serial Output
pio device monitor -e 8ch
pio device monitor -e 8ch --filter time
Key Concepts
| Concept | Usage | Example |
|---|
| Environment | Build target variant | -e 8ch, -e 4ch, -e 8ch-ota |
| Upload | Flash firmware to device | pio run -e 8ch -t upload |
| Monitor | Serial debugging | pio device monitor |
| Clean | Remove build artifacts | pio run -t clean |
| OTA | Over-the-air updates | -e 8ch-ota environment |
Common Patterns
Full Development Cycle
When: Making firmware changes
pio run -e 8ch -t clean && pio run -e 8ch -t upload && pio device monitor -e 8ch
OTA Update
When: Device deployed and accessible via WiFi
pio run -e 8ch-ota -t upload
Upload Filesystem
When: Updating SPIFFS/LittleFS data
pio run -e 8ch -t uploadfs
Pin Configuration
GPIO 25, 26, 27, 14, 4, 5, 18, 19
GPIO 16
GPIO 32 (Button 1), GPIO 33 (Button 2)
MQTT Integration
The firmware publishes to topics under vandaemon/leddimmer/{deviceId}/:
status - online/offline
config - device configuration JSON
channel/{N}/state - current brightness (0-255)
Subscribes to channel/{N}/set for brightness commands.
See the mqttnet skill for backend MQTT handling.
See Also
- patterns - Build configurations and debugging
- workflows - Development and deployment workflows
Related Skills
- kicad - PCB design for the LED dimmer hardware
- mqttnet - Backend MQTT communication with the dimmer
- docker - Running MQTT broker for testing