Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 28, 2025

Plan to Remove MAX_LEDS_PER_BUS Limitation for Virtual Buses

Based on the issue description and reference commit, virtual buses (like DDP, ArtNet, E131) are incorrectly limited to MAX_LEDS_PER_BUS (2048 on ESP32) when they should support up to MAX_LEDS (16384 on ESP32).

Changes Required:

  • Frontend (wled00/data/settings_leds.htm):

    • Removed the line that sets d.Sf["LC"+n].max = maxPB for all bus types
    • Added logic in the if (nm=="LC") section to set max value based on bus type:
      • Analog buses: max = 1
      • Digital buses: max = maxPB (2048)
      • Virtual buses: max = 16384
    • Moved maxLC calculation to only apply for digital buses
    • Added HUB75 handling to set min/max to undefined
  • Backend (wled00/bus_manager.h):

    • Modified BusConfig::adjustBounds() to only apply MAX_LEDS_PER_BUS limit to non-virtual buses
    • Virtual buses are now limited by MAX_LEDS instead
  • Testing:

    • Built web UI to regenerate html_*.h files - SUCCESS
    • Ran npm tests to validate build system - ALL PASS (16/16 tests)
    • Built firmware for ESP32 target to verify compilation - SUCCESS (completed in 2:04)
    • Code review completed - 1 minor nitpick (pre-existing comment)
    • Security scan completed - No issues found
  • Address feedback:

    • Reverted unnecessary .gitignore change (AI artifact)

Summary:

All changes are complete and validated. Virtual buses can now be configured with up to 16384 LEDs instead of being limited to 2048 LEDs. The implementation follows the reference commit and maintains backward compatibility for physical buses while removing the artificial limitation for virtual/network buses.

Original prompt

This section details on the original issue you should resolve

<issue_title>Virtual bus size is limited to MAX_LEDS_PER_BUS</issue_title>
<issue_description>### What happened?

in the UI when adding a virtual bus like DDP the maximum length is also limited to MAX_LEDS_PER_BUS. If there is no technical reason for this limit, it should not apply.

To Reproduce Bug

Add a DDP output, set size larger than 2048 (ESP32)

Expected Behavior

It should be limited to the technical limit of a virtual bus.

Install Method

Self-Compiled

What version of WLED?

nightly as well as 0.15

Which microcontroller/board are you seeing the problem on?

ESP32

Relevant log/trace output

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct</issue_description>

<agent_instructions>use this commit as a reference: blazoncek@f31f9e4</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@netmindz > That is a design choice (performance and complexity).

I'm sure we all appreciate that the more pixels you push, potentially the slower the frame rate etc, so "performance" doesn't seem like a reason for this restriction

Please provide a longer explanation. What complexity does it add?

I would however agree that virtual buses are still a bus, so not entirely surprising that the bus length is limited by this value</comment_new>
<comment_new>@DedeHai

That is a design choice (performance and complexity).

I opened this issue because when I did ask, you said there was no such limit, so I assumed it was unintentional and therefore a bug.
If it is ententional, this can be closed.</comment_new>
<comment_new>@DedeHai
don't fix if it ain't broke ;)</comment_new>
<comment_new>@netmindz
For physical buses, while in theory the length could be infinite (subject to memory), you should really be splitting out over multiple pins for better frame rate, the same is not true for virtual, so I would be in favor of excluding virtual from this limit if the reason for the limit was to encourage parallel output for high physical pixel counts </comment_new>


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 28, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI and others added 3 commits December 28, 2025 10:37
- Frontend: Updated settings_leds.htm to allow virtual buses up to 16384 LEDs
- Backend: Modified BusConfig::adjustBounds() to skip MAX_LEDS_PER_BUS check for virtual buses
- Tests: All npm tests pass successfully

Co-authored-by: DedeHai <6280424+DedeHai@users.noreply.github.com>
Co-authored-by: DedeHai <6280424+DedeHai@users.noreply.github.com>
Co-authored-by: DedeHai <6280424+DedeHai@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove restriction on virtual bus size exceeding MAX_LEDS_PER_BUS Remove MAX_LEDS_PER_BUS limitation for virtual buses Dec 28, 2025
Copilot AI requested a review from DedeHai December 28, 2025 10:43
@DedeHai DedeHai marked this pull request as ready for review December 28, 2025 11:46
.gitignore Outdated
/wled00/Release
/wled00/wled00.ino.cpp
/wled00/html_*.h
_codeql_detected_source_root
Copy link
Member

Choose a reason for hiding this comment

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

What does this do? Is it related to the rest of the PR?

Copy link
Collaborator

Choose a reason for hiding this comment

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

AI artefact.

Copy link
Collaborator

Choose a reason for hiding this comment

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

AI artefact.

@DedeHai
Copy link
Collaborator

DedeHai commented Dec 29, 2025

@copilot please revert unnecessary change to .gitignore

Co-authored-by: DedeHai <6280424+DedeHai@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 29, 2025

@copilot please revert unnecessary change to .gitignore

Reverted the .gitignore change in commit fd0fe3e. The CodeQL symlink entry has been removed.

Copilot AI requested a review from DedeHai December 29, 2025 13:58
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.

Virtual bus size is limited to MAX_LEDS_PER_BUS

4 participants