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

Strobe flash is not as fast as the official app #4

Open
penandlim opened this issue May 4, 2019 · 8 comments
Open

Strobe flash is not as fast as the official app #4

penandlim opened this issue May 4, 2019 · 8 comments
Assignees

Comments

@penandlim
Copy link

Describe the bug
Maximum speed for strobe flash function is a lot slower than what the official app allows you to set.

To Reproduce
Steps to reproduce the behavior:

  1. Use the official app ("S panel" or "Magic Home" or "Magic Hue") to connect to the controller.
  2. Go to functions tab and click on any strobe flash functions with speed set to 100%
    ( flashes about 5 - 10 times per second)
  3. Compare the speed with
    device.set_function(FunctionId.RED_STROBE_FLASH, 255)

Expected behavior
device.set_function(FunctionId.RED_STROBE_FLASH, 255) should be as fast as what the official app (5-10 flashes per second). But instead I get about 1 flash per 3 seconds ish.

@welcome
Copy link

welcome bot commented May 4, 2019

Thanks for opening your first issue here! 🎉

@markusressel
Copy link
Owner

Thx for the report.
I will try to have a look asap.

@markusressel markusressel self-assigned this May 4, 2019
@markusressel
Copy link
Owner

I just checked with my controller and it works just like your expected behaviour.
The following code

device = Controller(api, "192.168.2.37")
device.turn_on()
device.set_rgbww(255, 255, 255, 0, 0)
device.set_function(FunctionId.RED_STROBE_FLASH, 255)

results in a strobe that flashes multiple times per second (I would guess around 5 fps).
Which hardware do you use?

@penandlim
Copy link
Author

penandlim commented May 4, 2019

My hardware is from https://www.amazon.com/gp/product/B075X8TJCD/. Bought it about a week ago.
I'm also using the controller with one 5050 rgb strip and one 2835 warm white strip (cool white channel is unused.)

I tested other functions (RED_GRADUAL_CHANGE, etc) and timed how long one cycle takes. At speed = 255, it takes about 15 seconds inbetween fading into red which similar to setting speed to 50% on S panel.

These are some of the packets captured and compared.

device.set_function(FunctionId.RED_STROBE_FLASH , 0)
Data: 6131ff0fa0

device.set_function(FunctionId.RED_STROBE_FLASH , 255)
Data: 6131000fa1

Using android app:

Set Red strobe flash to speed: 0% on S panel
Data: 61311f0fc0

Set Red strobe flash to speed: 18% on S panel
Data: 6131190fba

Set Red strobe flash to speed: 38% on S panel
Data: 6131130fb4

Set Red strobe flash to speed: 54% on S panel
Data: 61310e0faf

Set Red strobe flash to speed: 73% on S panel
Data: 6131090faa

Set Red strobe flash to speed: 87% on S panel
Data: 6131040fa5

Set Red strobe flash to speed: 100% on S panel
Data: 6131010fa2

@penandlim
Copy link
Author

Setting speed to 254 results in same packets as 100% on S panel. Seems like 254 is max speed for me and 255 actually slows down the functions for some reason.

@markusressel
Copy link
Owner

Looking at your package captures it looks like a value of 1F (so 255 - 31 = 224) seems to equal 0% and 01 (255 - 1 = 254) equals 100% speed. It might be that I got this wrong but since it does work on my controller I guess there are different firmwares in the wild.

@markusressel
Copy link
Owner

markusressel commented May 5, 2019

Looking at the lib my work is based on it seems I really got it wrong:
https://github.com/sidoh/ledenet_api/blob/b6f0c5cba03c535cdc877ac2f9787e88763d16be/lib/ledenet/function_speed.rb#L6
I will do some additional testing and release a fix when I find the time to do so.
This would also explain why I thought the speed curve is exponential.

GitHub
An API for the LEDENET Magic UFO LED WiFi Controller - sidoh/ledenet_api

@markusressel
Copy link
Owner

markusressel commented May 8, 2019

@penandlim I tested the 255/254 values and it indeed seems like it does not make a difference. However values lower than 224 do increase the latency so 1F does not seem to be the real limit. Could you test that on your device? If so I would like to keep those values even though they might not be very useful to most users.

@markusressel markusressel changed the title Strobe flash is not as fast as the official app. Strobe flash is not as fast as the official app Aug 24, 2019
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

No branches or pull requests

2 participants