Files
led-driver-8/README.md
Jimmy f7beac2095 Replace MicroPython runtime with Pico C + W5500 firmware.
Ship UDP RGB panel firmware (eight WS2812 strips) and drop the ESP32 Wi-Fi/MicroPython stack.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-01 21:52:52 +12:00

76 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 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**.
## Layout
```text
led-driver-8/
├── firmware/ # Pico SDK C + W5500
├── examples/test_strips.py
├── .env.example
└── README.md
```
## Hardware
| Signal | GPIO |
|--------|------|
| W5500 CS | GP13 |
| SPI1 SCK | GP10 |
| SPI1 MOSI | GP11 |
| SPI1 MISO | GP12 |
| W5500 RST | GP9 |
| Status LED | GP25 |
| WS2812 strip 07 | 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.
## Build / flash
```bash
cd firmware
make deploy PANEL_ID=0
make reset && make monitor
```
Network options live in `.env` (see `.env.example`):
```env
PANEL_ID=0
NETWORK=static
IP=10.1.1.10
NETMASK=255.255.255.0
GATEWAY=10.1.1.1
DNS=10.1.1.1
```
| Panel | IP | MAC last byte |
|-------|-----|---------------|
| 0 | 10.1.1.10 | `00` |
| … | … | … |
| 4 | 10.1.1.14 | `04` |
| 255 (bench) | 10.1.1.19 | `FF` |
## Test
Self-contained (stdlib only):
```bash
python3 examples/test_strips.py
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)
| 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 |