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

blink random color when turning on with relay (using SSR to control AC power to PSU) #3581

Closed
1 task done
doronazl opened this issue Dec 12, 2023 · 10 comments
Closed
1 task done
Labels
discussion documentation documentation should be updated to explain behaviour hardware (Likely) Setup-specific issue, e.g. flickering LEDs stale This issue will be closed soon because of prolonged inactivity usermod usermod related workaround The issue contains a workaround

Comments

@doronazl
Copy link

What happened?

im using a SSR to control my PSU and turn it off when not in use, it works fine but im getting a blink sometimes when turning the led on, been reading about it and found this thread
#812
seems this was solved there but trying to edit the changes proposed i find things are different in the current code so im stuck

how do i get this done , id like to add a 200ms delay

To Reproduce Bug

turning on with a relay

Expected Behavior

described

Install Method

Binary from WLED.me

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 12, 2023
@doronazl
Copy link
Author

doronazl commented Dec 12, 2023

just tried using usermod multirelay, the problem with is is the minimum is 1 second, it cant do ms, i cant set it lower than 1, if i try to put 0.2 for example, it wont save it and go back to 1

@softhack007
Copy link
Collaborator

softhack007 commented Dec 12, 2023

@doronazl could it be you are regularly deleting / changing your questions? I got some questions by e-mail but they are missing here, so hard to help you.

About multi-relay:

  • the delay time is an integer (whole number) for seconds. So you can have 0sec, 1sec, 42sec. But you cannot use fractions like 0.34567 sec. If you want finer control, either modify the source code, or make a feature request.
  • (deleted question 1) if you enter GPIO pins in the usermod, make sure to not use the same pin anywhere else. So in LED settings, you have to configure the relay pin as unused (-1).
  • (deleted question 2) P0...P7 are for the port expander, if you use one. Otherwise don't use P0 ... P7.

@softhack007 softhack007 added discussion usermod usermod related documentation documentation should be updated to explain behaviour labels Dec 12, 2023
@doronazl
Copy link
Author

@doronazl could it be you are regularly deleting / changing your questions? I got some questions by e-mail but they are missing here, so hard to help you.

About multi-relay:

  • the delay time is an integer (whole number) for seconds. So you can have 0sec, 1sec, 42sec. But you cannot use fractions like 0.34567 sec. If you want finer control, either modify the source code, or make a feature request.
  • (deleted question 1) if you enter GPIO pins in the usermod, make sure to not use the same pin anywhere else. So in LED settings, you have to configure the relay pin as unused (-1).
  • (deleted question 2) P0...P7 are for the port expander, if you use one. Otherwise don't use P0 ... P7.

My apologies, some issue i got resolved so i just deleted it.
All i need now is a way to do ms, not seconds.
Wouldnt know where to modify and what 🫤

@softhack007
Copy link
Collaborator

softhack007 commented Dec 12, 2023

All i need now is a way to do ms, not seconds.
Wouldnt know where to modify and what 🫤

Before you modify code, it would be smart to first verify that the MultiRelay usermod does indeed solve your problem, by testing 1sec or 2sec as the delay value.

If that question is answered "yes", you could try to modify this line in the source code:

if (_relay[i].active && _switchTimerStart > 0 && now - _switchTimerStart > (_relay[i].delay*1000)) {

Changing the * 1000 into * 100 modifies the resolution of the input value (from 1sec to 100ms units); so if you now enter "3" in the UI, it actually means 0.3 sec.

@doronazl
Copy link
Author

doronazl commented Dec 12, 2023 via email

@doronazl
Copy link
Author

All i need now is a way to do ms, not seconds.
Wouldnt know where to modify and what 🫤

Before you modify code, it would be smart to first verify that the MultiRelay usermod does indeed solve your problem, by testing 1sec or 2sec as the delay value.

If that question is answered "yes", you could try to modify this line in the source code:

if (_relay[i].active && _switchTimerStart > 0 && now - _switchTimerStart > (_relay[i].delay*1000)) {

Changing the * 1000 into * 100 modifies the resolution of the input value (from 1sec to 100ms units); so if you now enter "3" in the UI, it actually means 0.3 sec.

so basically if i change it to *1 then i can treat my input in there as ms right ?
so inputting 300 would mean 300ms ?

@softhack007 softhack007 changed the title blink random color when turning on with relay blink random color when turning on with relay (using SSR to control AC power to PSU) Dec 17, 2023
@softhack007
Copy link
Collaborator

softhack007 commented Dec 17, 2023

Just curious - what is the magic about exactly 0.2 seconds delay? Would the flicker still happen with 1 second delay, or longer?

@softhack007 softhack007 added workaround The issue contains a workaround hardware (Likely) Setup-specific issue, e.g. flickering LEDs and removed bug labels Dec 17, 2023
@doronazl
Copy link
Author

Just curious - what is the magic about exactly 0.2 seconds delay? Would the flicker still happen with 1 second delay, or longer?

the UI wouldnt let me go lower than 0.2, i read somewhere even 50ms would be fine to avoid the flickering

a 1 second would work as well but its too long duration and its noticable.

@KlausHans
Copy link

KlausHans commented Jan 15, 2024

It would be very nice to add a delay for the data as discussed here #346 . Unfortunately it is closed even though the workaround proposed there is a bad one imho.
To simplify things, wouldn't it easily be possible to add a static, blanket delay of 100 or 200 ms if "Relay GPIO" is set in the config? That would be so nice and would prevent recurring issues like this.

Copy link

Hey! This issue has been open for quite some time without any new comments now. It will be closed automatically in a week if no further activity occurs.
Thank you for using WLED! ✨

@github-actions github-actions bot added the stale This issue will be closed soon because of prolonged inactivity label May 15, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion documentation documentation should be updated to explain behaviour hardware (Likely) Setup-specific issue, e.g. flickering LEDs stale This issue will be closed soon because of prolonged inactivity usermod usermod related workaround The issue contains a workaround
Projects
None yet
Development

No branches or pull requests

3 participants