Docs: Update lessons_learned.md with new WLED direct communication strategy

This commit is contained in:
Tobias J. Endres 2025-08-15 21:40:31 +02:00
parent a5e3298bd8
commit edf041a09a

View File

@ -42,3 +42,30 @@ Function _processFrame(input_frame: QVideoFrame):
End Function
```
## New Strategy: Direct WLED Communication
**Goal:** Modify the `Hyperion_Grabber_X11_QT` application to send image data directly to a WLED device, bypassing the Hyperion.ng server.
**Current Understanding:**
* The `HyperionGrabber` successfully captures and processes screen images (scaling, format conversion).
* The `HyperionClient` currently sends these processed images to a Hyperion.ng server using JSON-RPC over TCP.
**Proposed Plan:**
1. **Research WLED API for Image Data:**
* WLED supports several UDP protocols for live image data, including DDP (Distributed Display Protocol) on UDP port 4048 and WLED UDP Realtime (WARLS) on UDP port 21324.
* DDP appears to be a good fit for sending raw RGB pixel data efficiently.
2. **Develop a WLED Client (`WledClient`):**
* Create a new C++ class (`WledClient`) that uses `QUdpSocket` to send data.
* Implement the DDP packet structure for sending raw RGB pixel data.
* Add a `sendImage` method to format `QImage` data into DDP packets and send them.
* The client will be configured with the WLED device's IP address and DDP port (4048).
3. **Integrate WLED Client into HyperionGrabber:**
* Modify `HyperionGrabber` to use `WledClient` instead of `HyperionClient`.
* Update the `_processFrame` method to call `WledClient`'s `sendImage` method.
4. **Remove HyperionClient Dependency:**
* Once `WledClient` is integrated and working, remove the `HyperionClient` class and its related code.