Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

USERMOD Multirelay not switching when the strip is very long #3593

Closed
1 task done
doronazl opened this issue Dec 17, 2023 · 9 comments
Closed
1 task done

USERMOD Multirelay not switching when the strip is very long #3593

doronazl opened this issue Dec 17, 2023 · 9 comments
Labels
bug fixed in source This issue is unsolved in the latest release but fixed in master usermod usermod related

Comments

@doronazl
Copy link

What happened?

my setup is WS2815 and esp32, using a SSR to cut power to the psu whenever the lights are off.
did some testing and manged to focus the issue onto the multirelay usermod

what happens is as follows -
id be playing music with Gravimeter effect, lights turn on and work fine by the rythm, then id turn off wled, it turns off, cut power to the psu just fine, issue starts when i turn it back on, if i turn on wled and im on the SR effect, the light will not turn on at all, and looking at the SSR, the led wont turn on so its not engaged, hence no 3.3 signal coming from wled.
i then switch to solid color effect, the lights will turn back on fine, i then switch back to gravimeter, it works fine.

the problem is only happening when i try to turn on wled straight into the SR effect.
i then turned off usermod multirelay and switched the relay into the main setting under led prefrences, it works fine this way, cuts off power to the psu but just not through multirelay mod.

before you ask why im not just using the main setting for relay - i need the time delay option available on usermod

To Reproduce Bug

explained above

Expected Behavior

to work just like the main option

Install Method

Self-Compiled

What version of WLED?

0.14

Which microcontroller/board are you seeing the problem on?

ESP32

Relevant log/trace output

No response

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@doronazl doronazl added the bug label Dec 17, 2023
@softhack007
Copy link
Collaborator

softhack007 commented Dec 17, 2023

Actually it could be the other way around - if mutirelay does not send the switching signal to turn the relay on, then it might be that multirelay "loop" function does not run as expected.

It would happen with 99% of all effects; "solid" is a special case because it only trigger a LEDs update 3 times per second.

Please try to modify this code

if (!enabled || strip.isUpdating()) return;
static unsigned long lastUpdate = 0;
if (millis() - lastUpdate < 100) return; // update only 10 times/s
lastUpdate = millis();

To look like this

 static unsigned long lastUpdate = 0;
 if (!enabled || (strip.isUpdating() && millis() - lastUpdate < 100)) return;

  if (millis() - lastUpdate < 100) return;  // update only 10 times/s
  lastUpdate = millis();

And report back if it works better.

The same problem exists with several usermods - if you have a long LED strip, the strip is always updating, and the usermod cannot run.

@doronazl
Copy link
Author

Actually it could be the other way around - if mutirelay does not send the switching signal to turn the relay on, then it might be that multirelay "loop" function does not run as expected.

It would happen with 99% of all effects; "solid" is a special case because it only trigger a LEDs update 3 times per second.

Please try to modify this code

if (!enabled || strip.isUpdating()) return;
static unsigned long lastUpdate = 0;
if (millis() - lastUpdate < 100) return; // update only 10 times/s
lastUpdate = millis();

To look like this

 static unsigned long lastUpdate = 0;
 if (!enabled || (strip.isUpdating() && millis() - lastUpdate < 100)) return;

  if (millis() - lastUpdate < 100) return;  // update only 10 times/s
  lastUpdate = millis();

And report back if it works better.

The same problem exists with several usermods - if you have a long LED strip, the strip is always updating, and the usermod cannot run.

line 516 starts with 2 spaces whereas the code you sent me starts with 1, will it be ok ? just replace straight up ?

@doronazl
Copy link
Author

doronazl commented Dec 17, 2023

ok i did it, and it fixed the problem, turning on straight to the effect

@doronazl
Copy link
Author

Wonderful, working great now, thank you!
hope others run into this post or the changes will be added to the next releases

@doronazl
Copy link
Author

question, is there a way to make the turning on use the transition time ?
seems that whatever i put in the transition effect doesnt change anything when turning it on after all power was cut.
if i turn it off and the immediately on again, it will dim down and up , but when turning it off, waiting a few seconds and then turning back on , it turns back on in a flash straight to the set brightness , no dimming effect

@softhack007
Copy link
Collaborator

softhack007 commented Dec 17, 2023

ok i did it, and it fixed the problem, turning on straight to the effect

@blazoncek this is the "be nice but not too nice" thing we already added in several places. As multirelay is from you, it's your decision to update the code for the next release, or leave it as is. What's your preference?

@softhack007 softhack007 changed the title USERMOD Multirelay prevents sound reaction effect from turning on USERMOD Multirelay not switching when the strip is very long Dec 17, 2023
@softhack007 softhack007 added the usermod usermod related label Dec 17, 2023
blazoncek added a commit that referenced this issue Dec 17, 2023
@softhack007 softhack007 added the fixed in source This issue is unsolved in the latest release but fixed in master label Dec 17, 2023
blazoncek added a commit that referenced this issue Dec 17, 2023
softhack007 pushed a commit to MoonModules/WLED that referenced this issue Dec 17, 2023
@doronazl
Copy link
Author

checked and this happens both with

ok i did it, and it fixed the problem, turning on straight to the effect

@blazoncek this is the "be nice but not too nice" thing we already added in several places. As multirelay is from you, it's your decision to update the code for the next release, or leave it as is. What's your preference?

do you know what i mean about the initial coming on effect with the relay ?

@softhack007
Copy link
Collaborator

do you know what i mean about the initial coming on effect with the relay ?

Actually no - normally I don't see any transition (crossfade) at power-on. Slow crossfade only happens when changing effects. Maybe @blazoncek has an idea ...

@doronazl
Copy link
Author

do you know what i mean about the initial coming on effect with the relay ?

Actually no - normally I don't see any transition (crossfade) at power-on. Slow crossfade only happens when changing effects. Maybe @blazoncek has an idea ...

here
so this is turning wled off and on pretty quickly
https://streamable.com/3tge0i

and this is waiting a few of seconds in between commands
https://streamable.com/j12k46

this is again a relay related matter, when waiting a few seconds, everything gets cut off due to the relay breaking contact
this does not happen if not using a relay at all, im assuming because if no relay they get constant power even when "off" so they are more "ready".

id like to mention this doesnt happen when using a playlist that includes a black color - 0 brightness - 0.2s lenght preset at the start of the playlist, would be awesome if possible to make that kind of preset added across the board when using a relay, if it were added to every turning on command of wled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fixed in source This issue is unsolved in the latest release but fixed in master usermod usermod related
Projects
None yet
Development

No branches or pull requests

3 participants