Skip to content

Add effect view capability to web UI#724

Merged
rbergen merged 39 commits into
PlummersSoftwareLLC:mainfrom
rbergen:colordata-ws-binary
Jun 18, 2025
Merged

Add effect view capability to web UI#724
rbergen merged 39 commits into
PlummersSoftwareLLC:mainfrom
rbergen:colordata-ws-binary

Conversation

@rbergen

@rbergen rbergen commented Jun 9, 2025

Copy link
Copy Markdown
Collaborator

Description

This PR adds a feature to the web UI with which one can see what the device is showing on the LEDs it is driving. In terms of practical applications, it's mainly suitable for setups where the LEDs are in some sort of matrix configuration (MATRIX_WIDTH and MATRIX_HEIGHT are both >1 in a meaningful way).

The following applies:

  • The "regular" Color Data Server must be enabled (COLORDATA_SERVER_ENABLED set to 1)
  • There is a delay of some seconds between what's shown on the LEDs and what the web UI shows. This is due to to the processing required to push the color data through a WebSocket and the buffering involved.
  • The in-browser framerate can vary from a few frames per second to something that approaches the framerate of the "regular" Color Data Server. There seems to be a correlation between the statistics panel in the web UI being open and a lower framerate in the effect viewer, but we would love your feedback on this as well.

Most of the work on this feature, which has been on our wish list for close to two years, has been done by @KeiranHines.

This closes #356.

This PR also bumps the minimum version of FastLED to 3.9.20, in relation to the thread starting with this discussion comment. Many thanks to @zackees for his quick follow-up to the issue reported there.

Contributing requirements

  • I read the contribution guidelines in CONTRIBUTING.md.
  • I understand the BlinkenPerBit metric, and maximized it in this PR.
  • I selected main as the target branch.
  • All code herein is subjected to the license terms in COPYING.txt.

KeiranHines and others added 30 commits December 3, 2023 10:31
Check if we can write to all before raising effect events

@robertlipe robertlipe left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The c++ and Platformio parts lgtm.

Thanx, guys.

Comment thread src/network.cpp
#endif

if (socket >= 0 || wsListenersPresent)
delay(10);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should probably be vTaskDelay() so it blocks only this thread, not all of them.

Yes, we have many occurrences of thks.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually looked it up. This is the function definition for delay() in framework-arduinoespressif32 (here, to be exact):

void delay(uint32_t ms)
{
    vTaskDelay(ms / portTICK_PERIOD_MS);
}

So, I think we're good.

@robertlipe

robertlipe commented Jun 10, 2025 via email

Copy link
Copy Markdown
Collaborator

@rbergen

rbergen commented Jun 11, 2025

Copy link
Copy Markdown
Collaborator Author

Interesting. Thanks. That's another discrepancy in the Arduino docs (or at least folklore ) then. Delay doesn't block other threads.. TIL.

Well, maybe. This code is part of the arduinoespressif32 framework as provided by PlatformIO, and the HAL in that context. I genuinely don't know how this compares to the actual Arduino code/behavior. For one, this is one level below what I usually concern myself with, for another the only two real Arduino sketches I ever worked on were for another YouTube content creator (Adrian Black) and single-threaded as far as my code was concerned.

This may be a case where the Arduino-like interface that PlatformIO provides behaves a little different from what Arduino does. And if that's the case then I'm glad with the difference.

@rbergen

rbergen commented Jun 11, 2025

Copy link
Copy Markdown
Collaborator Author

And thank you for your review!

@davepl davepl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@rbergen
rbergen merged commit 9c9dbfe into PlummersSoftwareLLC:main Jun 18, 2025
43 checks passed
@rbergen
rbergen deleted the colordata-ws-binary branch September 7, 2025 08:11
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.

Web UI: Websocket implementation of ColorDataServer

4 participants