How jjannix/esp8266-ws2811-leds works
Main Components
• Firmware (ESP8266)
• Firmware source files (in firmware/src) including the WS2811 DMA implementation, I²S registers and related components.
• UDP listener: The firmware receives LED animation commands over UDP on port 2711 with the custom MXP (matrix) protocol.
• Additional control for toggling the LED power supply via UDP commands on port 2777.
• Firmware leverages hardware-level DMA/I²S output, meaning it directly drives the LED strip while using the RX pin.
• Node.js Client Server
• Located in the client folder, where server.js is the entry point.
• Contains the animation files (in the client/animations subfolder) which process or generate timing data for the LED effects.
• The client/server handles live control and animation queue management, forwarding controls via UDP to the ESP8266.
• Configuration file (client/config.json) for setting up LED strip parameters.
• Web UI / Site
• Hosted under client/site with HTML, CSS, and JavaScript files.
• Provides the live preview for the LED strip (livecontrol.html/js/css) and an additional page for managing the animation queue (queue.html/js/css).
• Hardware
• KiCad design files contained in the hardware directory detail the custom PCB design integrating the ESP8266 (ESP-03 module) with a Voltek SPEC7188B power supply.
• These designs illustrate how the ESP8266 is interfaced with the LED strip and the power circuitry that enables/disable LED power.
Relationships and Data/Control Flow
• That the Node.js client server sends UDP packets (over WiFi) to the ESP8266 running custom firmware.
• Flow of commands:
• From the web UI (user input via live control or queue management) to the client server.
• From the client server to the ESP8266 firmware (via UDP on port 2711 for animation data and on port 2777 for power control commands).
• That the ESP8266 firmware processes these UDP commands to drive the LED strip via DMA/I²S.
• Optionally, indicate feedback loops if there is any status or monitoring (even if it’s just LED indications).
Architectural Patterns / Design Principles
• Layered approach: a backend/firmware layer (embedded control) communicating with a front-end control layer (Node.js server + web interface).
• Use of a custom protocol (MXP over UDP) for communication and the real-time nature of LED control.
• Underline the separation of concerns: firmware handles low-level LED signal generation while the client server handles interactions and animations.
Technologies, Frameworks, and Libraries
• ESP8266 SDK / esp-open-sdk (for firmware build and flash as described in the README).
• Node.js and npm (client/server implementation).
• Bower (for managing client-side web dependencies).
• KiCad (for hardware/PCB design).
• UDP-based communication as the primary mechanism for control commands.
Final Touches
• Avoid oversimplification; include as many discrete components as is practical given the project’s structure (for example, splitting out the animation subsystem as a distinct element if needed).