MoonModules / WLED

Control WS2812B and many more types of digital RGB LEDs with an ESP8266 or ESP32 over WiFi! MoonModules adds features on top of upstream.
https://mm.kno.wled.ge
GNU General Public License v3.0
190 stars 58 forks source link

Mixed mode 2D / 1D works upstream but not in MM #79

Open scottrbailey opened 9 months ago

scottrbailey commented 9 months ago

What happened?

In AC you can do mixed 2D/1D configurations by adding a new segment beyond the bounds of your 2D matrix. With MM, when you add a new segment and set the start X beyond the last pixel of your matrix, the UI correctly switches to 1D segment. However, once saved, it reverts back to 2D.

To Reproduce Bug

1) set up 100 pixels in LED prefs 2) configure an 8x8 matrix on 2D settings page 3) add an additional segment and set start X to 64 or higher 4) (the UI will revert to a 1D segment view) enter 100 for the stop X and save. 5) After save, segment will be 2D.

Expected Behavior

Segment beyond 2d bounds would remain 1d.

Install Method

From srg74 firmware repository

What version/release of MM WLED?

WLEDMM_0.14.0-b27.31_universal_shield_esp32_4MB_M

Which microcontroller/board are you seeing the problem on?

ESP32

Relevant log/trace output

No response

Anything else?

No response

Code of Conduct

dosipod commented 9 months ago

Yes mixing 2D/1D does not work in MM as you have noticed , i tested that when you reported it a while back and also now on latest MM nightly build . MIXED-2D-1D-MM

softhack007 commented 9 months ago

@ewoudwijma can you take a look? Maybe something in the MM specific code force-resets segments in a 2D setup to 2D mode?

ewoudwijma commented 9 months ago

Yeah, will look to it, in a few days. I never understood the use case for this, why you want a mix of 2D and 1D? Why not 2 esps, one for the matrix and one for the strip ?

scottrbailey commented 9 months ago

Well in my particular use case, the lights are in my kitchen. I've got one window with a strip around it and above it a semi-circular window with a matrix in it. I want to keep out of my wife's way and use as few sockets and as little space as possible. But I could envision a room where you had several windows, each with a matrix in them and a strip running between each window.

On Tue, Oct 10, 2023 at 8:42 AM Ewoud @.***> wrote:

Yeah, will look to it, in a few days. I never understood the use case for this, why you want a mix of 2D and 1D? Why not 2 esps, one for the matrix and one for the strip ?

— Reply to this email directly, view it on GitHub https://github.com/MoonModules/WLED/issues/79#issuecomment-1755715462, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJTCL7RQPNRSYCJAA2KVT5LX6VUETAVCNFSM6AAAAAA5ZK2VE2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONJVG4YTKNBWGI . You are receiving this because you authored the thread.Message ID: @.***>

ewowi commented 9 months ago

I could understand that. My personal feeling is that WLED is becoming like Android, supporting more and more use cases, and I see as developer it is becoming more difficult to maintain. I think we should move to an Apple approach, support the 80% of use cases only. Of course this is a personal opinion and it is debatable what belongs to the 80% 🙂

I am quite busy and I cannot realize my earlier comment to look into it in a few days. But have it on my list , need to find time to setup a matrix and a strip configuration.

if somebody could do a code compare if this part of functionality that would help

dosipod commented 9 months ago

I have never mentioned that before because there is a workaround we used for a long time which is just to setup the strip as another matrix , not optimal but works if the 2nd esp is not an option but scottrbailey has ton of them . One thing that might be others do not realize and is that 2D in MM is a bit different then upstream which might be toward large complex fixtures which not a bad thing . I personally do not have strips in use at all but though unless it would just say it is not supporting then it is on the list

Finndersen commented 7 months ago

I've managed to get 2D Matrix + 1D strip working in MM. After saving the strip config, even though it reverts to 2D mode, if you reboot WLED it should now pick up the config properly. This screenshot is from MM and works fine: Screenshot_20231216-174322

However, the issue I'm having is that I'm unable to change the 1D strip configuration to split it up into multiple segments, which I would like to do. When I try reduce the length of the segment it bugs out to 2D mode, and can't add another 1D segment. Also see my use case of wanting a 2D Matrix and strip controlled together by one ESP32: PXL_20231216_073824936

Finndersen commented 7 months ago

Wouldn't it make sense to have 1D/2D configuration be per-segment not globally?

softhack007 commented 7 months ago

In principle, your right.

Upstream has this whacky "mixed mode" that basicially treats LEDs "after" the matrix as a strip. Well that's also more a workaround than a solution.

The original idea was that "1D" is included into 2D, as a matrix Nx1 is 1D. You can set any segment to mapping mode "pixels", which treats them like 1D (not exactly, because serpentine is still applied).

softhack007 commented 7 months ago

Actually there is one technical problem with a mixed "matrix plus strip" in MM, for example you create a "72 x 1" next to a " 20x16".

Due to a very unfortunate design decision (upstream) called "gap maps", wled creates a huge virtual fixture (buffer) from the combined layout, which is "92 x 16" pixels big. This makes internal handling very slow.

My own workaround is to define an arbitrary matrix from the strip, say 9x8 = 72. Then use this "pseudo matrix" in mapping mode "pixels". The total buffer needed is only 29x16 pixels, instead of 96x16. So it's faster and uses less RAM. With the bonus that you can also run 2D effects on the pseudo matrix, which sometimes looks very cool (like a flat GEQ where all bands are next to each other in a line, or a "flat octopus").

dosipod commented 7 months ago

@Finndersen What exact build of MM you are using to test because when i tested latest nightly MM-S from https://wled-install.github.io/ still mixed 2d-1d mode is not working , might be take a short video /gif showing steps and end result . @scottrbailey Might be you could also retest again

Finndersen commented 7 months ago

Screenshot_20231217-103739

Finndersen commented 7 months ago

@softhack007 so it does that even when the extra strip is properly recognised as 1D?

Also I couldn't get your method to work. I've got a 13x7 matrix, and tried configuring an extra 9x2 pseudo-matrix after it. This is screenshot of the config before I pressed save, you can see it's put it below the original one: Screenshot_20231217-114209

However if I press save/tick, or do anything else, it automatically resets to this: Screenshot_20231217-114249

So the new matrix becomes inside/overlayed on the original one. I can't get it to be configured "after" the first matrix, nothing I do makes the LEDs in the strip after the matrix come on at all. Everything here seems really unstable and buggy, like if you set any config values they just automatically get reset or changed when saving or doing anything else

Finndersen commented 4 months ago

@softhack007 @dosipod any ideas/updates on this issue? :(

dosipod commented 3 months ago

@Finndersen Might be it will be fixed in the feature as this would also mess-up with using the esp onboard led for status led if you are using 2D setup . Does not seem to be a priority though so I personally no longer use mixed setup on MM

Finndersen commented 3 months ago

What does it do with the status led? I've got mixed setup working, but only with 1 strip after the 2D, can't make it with with more

dosipod commented 3 months ago

As pics are not clear , once you able to do a video like the one here https://github.com/MoonModules/WLED/issues/79#issuecomment-1754208832 we can compare , otherwise i am not really clear on how to test that as it is still does not work for me on latest nightly build , might be visit discord and report that , status led would also be mixing 2d and 1d but that is something i could overcome in code

Finndersen commented 3 months ago

@dosipod do what you did in your video, then reboot WLED, as per my comment:

After saving the strip config, even though it reverts to 2D mode, if you reboot WLED it should now pick up the config properly.

spiro-c commented 3 months ago

@Finndersen you need to define the matrix in 2d settings first than you can make more segments from the 1d strip and i general more 1d strips after or before 2d matrix .. how much i can se from your case you have one strip of 144 and and matrix of 13x7 so this is how it work or how @softhack007 explained

This are led settings image

Then i define two matrixes first for the strip then for the 13x7 in 2D settings image

and at the end you make the segments image

at the end if you need more segments from the strip you can make more 2d segments but they need to be power of 12 in this case because that is how i define the first panel in 2d settings ... image image

Finndersen commented 3 months ago

@spiro-c thanks I will try that, I think previously I didn't do the LED panel layout config, just tried to make segments and that didn't work. Can the LED panel layout config vary between presets? As in, is it included in the preset config data?

spiro-c commented 3 months ago

@spiro-c thanks I will try that, I think previously I didn't do the LED panel layout config, just tried to make segments and that didn't work. Can the LED panel layout config vary between presets? As in, is it included in the preset config data?

No but you can define multiple panels from one strip with correct offset but try to make the matrix maximum dimensions as small is possible if you like better performance For example this is at moment overall dimension 13x19=247 but if i put panels next to each other it will be 25x12=300pixels