feat: DDP frame sync over UDP broadcast, DDP acks, DDP enable setting

- Driver acks each completed DDP frame; the test waits for the acks before broadcasting the sync.
- Sync listener on UDP 4049: a frame is held until the next sync, then shown.
- DDP pixels are shown at full brightness, ignoring the device brightness settings.
- "DDP and sync receive on" setting (NVS, network API, web UI); off ignores DDP and sync packets.
- ddp_test.py: finds devices on the subnet, drives them in lockstep at a fixed rate, runs animations.
- /api/ddp reports sync counters for diagnosis.
- Includes in-progress WebSocket, multi-driver web UI and Wi-Fi work from the same tree.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
jimmyandClaude Haiku 5.5 committed 2026-11-11 14:10:55 +13:00
1 parent 47f4eba0d6
commit 4cd3bc7973
294 files changed
+48954 -301

No files matched your search

+15
View File
@@ -50,6 +50,7 @@ esp_err_t settings_load_hw(hw_cfg_t *c)
c->num_leds = 119;
c->pin = 10;
c->global_brightness = 255;
c->master_brightness = 255;
nvs_handle_t h;
if (nvs_open(NS, NVS_READONLY, &h) != ESP_OK) {
return ESP_OK;
@@ -72,6 +73,9 @@ esp_err_t settings_load_hw(hw_cfg_t *c)
if (nvs_get_u8(h, "global_bright", &mb) == ESP_OK) {
c->global_brightness = mb;
}
if (nvs_get_u8(h, "master_bright", &mb) == ESP_OK) {
c->master_brightness = mb;
}
nvs_close(h);
return ESP_OK;
}
@@ -88,6 +92,7 @@ esp_err_t settings_save_hw(const hw_cfg_t *c)
if (err == ESP_OK) err = nvs_set_i32(h, "num_leds", c->num_leds);
if (err == ESP_OK) err = nvs_set_i32(h, "pin", c->pin);
if (err == ESP_OK) err = nvs_set_u8(h, "global_bright", c->global_brightness);
if (err == ESP_OK) err = nvs_set_u8(h, "master_bright", c->master_brightness);
if (err == ESP_OK) err = nvs_commit(h);
nvs_close(h);
return err;
@@ -106,6 +111,8 @@ static void get_str(nvs_handle_t h, const char *key, char *buf, size_t len, cons
esp_err_t settings_load_net(net_cfg_t *c)
{
memset(c, 0, sizeof(*c));
c->ap_enabled = true;
c->ddp_enabled = true;
nvs_handle_t h;
esp_err_t err = nvs_open(NS, NVS_READONLY, &h);
if (err == ESP_ERR_NVS_NOT_FOUND) {
@@ -124,6 +131,12 @@ esp_err_t settings_load_net(net_cfg_t *c)
get_str(h, "netmask", c->netmask, sizeof(c->netmask), "");
get_str(h, "gateway", c->gateway, sizeof(c->gateway), "");
get_str(h, "dns", c->dns, sizeof(c->dns), "");
char ap[8];
get_str(h, "ap", ap, sizeof(ap), "on");
c->ap_enabled = strcmp(ap, "off") != 0;
char ddp[8];
get_str(h, "ddp", ddp, sizeof(ddp), "on");
c->ddp_enabled = strcmp(ddp, "off") != 0;
nvs_close(h);
return ESP_OK;
}
@@ -141,6 +154,8 @@ esp_err_t settings_save_net(const net_cfg_t *c)
if (err == ESP_OK) err = nvs_set_str(h, "netmask", c->netmask);
if (err == ESP_OK) err = nvs_set_str(h, "gateway", c->gateway);
if (err == ESP_OK) err = nvs_set_str(h, "dns", c->dns);
if (err == ESP_OK) err = nvs_set_str(h, "ap", c->ap_enabled ? "on" : "off");
if (err == ESP_OK) err = nvs_set_str(h, "ddp", c->ddp_enabled ? "on" : "off");
if (err == ESP_OK) err = nvs_commit(h);
nvs_close(h);
return err;