Switch panel firmware to DDP and match portal W5500 pinout.

Replace custom UDP RGB with DDP on 4048, fix picotool -f ordering for v1.1.2, and chunk test frames under MTU so the W5500 receives them.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
jimmyandCursor committed 2026-10-06 16:58:47 +13:00
1 parent f7beac2095
commit 881e0ecaeb
5 files changed
+188 -196

No files matched your search

+23 -13
View File
@@ -1,7 +1,7 @@
# Portal panel firmware (Pico + W5500 + WS2812)
UDP RGB panel adapter for the [portal](https://git.technical.kiwi/technicalkiwi/portal.git) project.
Host renders patterns; this firmware only receives frames on **UDP 50007**.
DDP RGB panel adapter for the [portal](https://git.technical.kiwi/technicalkiwi/portal.git) project.
Host renders patterns; this firmware receives frames on **UDP 4048** (DDP).
## Layout
@@ -17,15 +17,15 @@ led-driver-8/
| Signal | GPIO |
|--------|------|
| W5500 CS | GP13 |
| W5500 CS | GP9 |
| SPI1 SCK | GP10 |
| SPI1 MOSI | GP11 |
| SPI1 MISO | GP12 |
| W5500 RST | GP9 |
| W5500 RST | GP13 |
| Status LED | GP25 |
| WS2812 strip 0–7 | GP18, 19, 20, 21, 22, 26, 27, 28 |
Eight strips (one PIO SM each). Pixel output uses **DMA → PIO**. Pixel count comes from each UDP frame. `MAX_LEDS` (512) is capacity only.
Eight strips (one PIO SM each). Pixel output uses **DMA → PIO**. One DDP packet carries all strips (equal LED count each). `MAX_LEDS` (512) is per-strip capacity only.
## Build / flash
@@ -64,12 +64,22 @@ python3 examples/test_strips.py --host 10.1.1.10 --leds 64
Lights each strip alone with a unique colour, then flashes all strips R/G/B/white.
## UDP protocol (port 50007)
## DDP protocol (port 4048)
| Payload | Action |
|---------|--------|
| N×3 bytes | Raw RGB → strip 0 |
| 1 + N×3 bytes | `strip_id` + RGB (`0`–`7`, or `255` = all) |
| 5 bytes `PIN\0` + gpio | Bind strip 0 |
| 8 bytes `PIN\0` + strip + gpio + len_lo + len_hi | Bind strip |
| 4 bytes `SHOW` | Reserved |
[Distributed Display Protocol](http://www.3waylabs.com/ddp/) — WLED-compatible.
| Field | Value |
|-------|--------|
| Port | UDP **4048** |
| Destination ID | **1** (or 255) |
| Header | 10 bytes (14 if timecode flag set) |
| Data type | RGB888 (`0x0B`) |
| PUSH | split frame onto strips and show |
**Payload layout** (one packet for the whole panel):
```text
strip0 RGB | strip1 RGB | … | strip7 RGB
```
LED count per strip is `total_pixels / 8` (must divide evenly). `offset` / `length` address that linear buffer if a frame is split across packets.