Skip to content

Adding DDP over WS, moving duplicate WS-connection to common.js - #4997

Merged
DedeHai merged 8 commits into
wled:mainfrom
DedeHai:DDP_over_WS
Oct 21, 2025
Merged

DedeHai merged 8 commits into
wled:mainfrom
DedeHai:DDP_over_WS

Conversation

@DedeHai

@DedeHai DedeHai commented Oct 10, 2025 •

Copy link
Copy Markdown
Collaborator
  • Enabling DDP over WebSocket: this allows for html pages to stream data to the LEDs much faster than through the JSON API
  • Moved the duplicate function to establish a WS connection from the live-view htm files to common.js

uses only 100bytes of additional flash and is a feature I could make use of in the matrix tool.
Also the new custom palette editor has a "preview" feature that currently uses the JSON API to do a live-preview on the LEDs. Using DDP instead would make it much faster.
I ran some experiments doing video streaming from a ESP-Hosted webpage to the LEDs and this also did work quite well.

Summary by CodeRabbit

  • New Features

    • Live View adds binary WebSocket protocol support and a reusable WebSocket connector for simpler integration.
  • Performance

    • LED data is sent in chunked frames to reduce overhead and improve update latency.
  • Compatibility

    • Unified and more consistent WebSocket initialization and message handling across views.
  • Bug Fixes

    • Stronger packet validation and bounds checks to prevent malformed binary data issues.
  • Refactor

    • Consolidated WebSocket setup into a shared client script for reliability.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants