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

Unable to control LED dimmer, channel value rises absurdly high by itself #1190

Open
tobiaspc opened this issue Apr 30, 2024 · 3 comments
Open
Labels
bug Something isn't working

Comments

@tobiaspc
Copy link

tobiaspc commented Apr 30, 2024

Describe the bug
LED dimmer can not be controlled after some time, since the dimmer value rises to absurd values. "Smooth transitions for LED" (Flag 18) is enabled.

Firmware:

  • Version 1.17.555
  • Device: Magic Home single channel Wifi LED controller
  • Chip: BL602
  • Device config:
    Default, using MQTT, Flags 10, 12, 18 active

To Reproduce
Steps to reproduce the behavior:

  1. Power on, use / toggle the light normally
  2. After extended power on time (days), LED channel value rises to absurd values (i.e., over 100.00), and keeps rising by itself, see first screenshot.
  3. Cut the power, turn on again
  4. Value rises very fast, exceeding the upper limit of 100 (second screenshot)
  5. Software thinks light is "off" (red button color), despite it being already (physically) on
  6. Press Toggle Light button
  7. Press Toggle Light button again, LED dimmer value decreases, reaching 0 after some time.
  8. From there on, normal operation, i.e., LED values are clamped at 0 and 100.

This bug is not deterministic, sometimes it appears after a few hours, sometimes after days. Manually setting the brightness to 0 or 100 does not work, neither via "normal" web-UI, nor via "Web Application". Only way to workaround is cutting the power and quickly toggling the light twice, as described above.

Screenshots
Bug during operation:
2024-04-30-222154_844x1008_grim

Bug after reboot:
2024-04-30-222332_852x1007_grim

Additional context

@openshwprojects
Copy link
Owner

Hello, can you try to narrow down the issue, what happens if you try the same without smooth led transitions, etc?

@tobiaspc
Copy link
Author

tobiaspc commented May 1, 2024

Thanks for the idea. Just disabled Flag 18, will see how it behaves over the next few days and report back.

Interestingly, the maximum value should be capped in Line 84 src/hal/bl602/hal_pins_bl602.c:

if(value>100)
	value = 100;
duty = value;

@openshwprojects openshwprojects added the bug Something isn't working label May 1, 2024
@tobiaspc
Copy link
Author

tobiaspc commented May 5, 2024

The issue did not occur since I turned off the smooth transition feature, so I guess this is the cause. Any idea on how I could debug this further?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants