PennazSoftware / homebridge-dmxlight-plugin

Homebridge plugin for controlling lights via DMX
Apache License 2.0
5 stars 2 forks source link

Two sACN devices on one universe #2

Closed AlexWHughes closed 1 year ago

AlexWHughes commented 2 years ago

Describe The Bug:

To Reproduce: Adding two DMX fixtures using the same universe seems to cause issues when you control only one of them. Add in two "elements" to reproduce

Expected behavior: When I control the first light the second one shouldn't turn off. It seems like when I am controlling one it sends zero values to the other light.

Logs:

Show the Homebridge logs here, remove any sensitive information.

Plugin Config:

{ "name": "lights", "ipAddress": "xxx.xxx.xxx.xxx", "platform": "DMXLightHomebridgePlugin", "accessories": [ { "name": "RGB-1", "id": "lx-1", "driverName": "sacn", "dmxStartChannel": 1, "dmxChannelCount": 192, "dmxUniverse": 1, "colorOrder": "rgb" }, "name": "RGB-2", "id": "lx-2", "driverName": "sacn", "dmxStartChannel": 193, "dmxChannelCount": 4, "dmxUniverse": 1, "colorOrder": "rgb" { ] }

PennazSoftware commented 2 years ago

Thanks for letting me know about this. I will attempt a repro this week and see what is involved in a fix.

-Dan

On Oct 11, 2021, at 4:34 PM, AlexWHughes @.***> wrote:



Describe The Bug:

To Reproduce: Adding two DMX fixtures using the same universe seems to cause issues when you control only one of them. Add in two "elements" to reproduce

Expected behavior: When I control the first light the second one shouldn't turn off. It seems like when I am controlling one it sends zero values to the other light.

Logs:

Show the Homebridge logs here, remove any sensitive information.

Plugin Config:

{ "name": "lights", "ipAddress": "xxx.xxx.xxx.xxx", "platform": "DMXLightHomebridgePlugin", "accessories": [ { "name": "RGB-1", "id": "lx-1", "driverName": "sacn", "dmxStartChannel": 1, "dmxChannelCount": 192, "dmxUniverse": 1, "colorOrder": "rgb" }, "name": "RGB-2", "id": "lx-2", "driverName": "sacn", "dmxStartChannel": 193, "dmxChannelCount": 4, "dmxUniverse": 1, "colorOrder": "rgb" { ] }

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/PennazSoftware/homebridge-dmxlight-plugin/issues/2, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALGYIL2FVLGE32FSL3GCJADUGNX6ZANCNFSM5FZIJE3A.

AlexWHughes commented 2 years ago

No problem. It's a minor thing but would be great if there is an easy fix. I suspect its sending a full universe of data every time rather than just the affected channels.

Would also be great if it worked with RGBW.

AlexWHughes commented 2 years ago

Any luck? Is it a complex fix?

AlexWHughes commented 2 years ago

Hello, Did you ever work out a solve for this?

PennazSoftware commented 2 years ago

I haven’t. All of my DMX lights are at my house in Seattle and I’ve been living at my Palm Springs place since December and haven’t had a chance to test a fix. The good thing is that I’ll be home in two weeks and will look into it. Sorry it’s taken so long.

-Dan

On May 1, 2022, at 10:43 PM, AlexWHughes @.***> wrote:



Hello, Did you ever work out a solve for this?

— Reply to this email directly, view it on GitHubhttps://github.com/PennazSoftware/homebridge-dmxlight-plugin/issues/2#issuecomment-1114516426, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALGYIL6F5WA6HVDQSCVKI63VH5TP7ANCNFSM5FZIJE3A. You are receiving this because you commented.Message ID: @.***>

AlexWHughes commented 2 years ago

No problem. Thanks!

AlexWHughes commented 2 years ago

Any luck? Let me know if there is anything I can do to help?

AlexWHughes commented 1 year ago

Hello,

Is there update to this issue?

AlexWHughes commented 1 year ago

I'm happy to put some $$$ behind this one if that helps.

PennazSoftware commented 1 year ago

I’ll have another look at getting it to work but my previous attempt pointed to a limitation with a dmx plugin I have a dependency on and I wasn’t able to figure out a workaround.

I’m out of town right now but will have a look when I return on the 26th.

-Dan

On Dec 18, 2022, at 2:32 AM, AlexWHughes @.***> wrote:



I'm happy to put some $$$ behind this one if that helps.

— Reply to this email directly, view it on GitHubhttps://github.com/PennazSoftware/homebridge-dmxlight-plugin/issues/2#issuecomment-1356768543, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALGYIL52GIXQ6T4X6ANG7KDWN3R2PANCNFSM5FZIJE3A. You are receiving this because you commented.Message ID: @.***>

AlexWHughes commented 1 year ago

As we discussed nearly a year ago (sorry about the harassment) I believe the issue is the module is sending a full universe of data so when you try to control one light it sends data to both. If there isn't an easy fix then we can close this out and move on as its current state should be fine for most people.

alvarezb commented 1 year ago

I ran into the same issue, and did some digging. The sACN protocol as defined in this spec document only seems to support sending an array of DMX values that start at address 1, and the e131 library this project is using will fill in 0 values for any channels before the ones we are trying to update.

This means that turning on your "RGB-2" light and then turning on your "RGB-1" should work, but if you do it in the reverse order, the 0 "padding" values on addresses 1-192 sent by controlling RGB-2 will turn off all the channels used for RGB-1.

Given this is an issue for me as well, I'll investigate whether I can cache the state of the whole universe to send the "last used" values for each channel every time an update is sent, instead of sending mostly 0s that turn off other lights at lower addresses.

PennazSoftware commented 1 year ago

I moved the code outside of HomeBridge and wrote a simple test application. I have a E131 controller (Holiday Coro Alphapix 4) configured with 2 universes (300 lights on each). The application issues the following commands with a 1-second delay between them:

  1. Universe 1 Off
  2. Universe 2 Off
  3. Universe 1 White
  4. Universe 2 White
  5. Universe 1 Red
  6. Universe 2 Green
  7. Universe 1 Blue
  8. Universe 2 Purple
  9. Universe 2 Off

The application controls the lights correctly...issuing a command on one universe does not impact the other universe. I also tried instantiating a new instance of my dmx library midway through the procedure and it still ran correctly.

I suspect at this point the problem stems from running within HomeBridge and am going to conduct some testing in that environment.

PennazSoftware commented 1 year ago

Update: I've made good progress. I now have a clear repro outside of HomeBridge. This is in fact the problem that alvarezb described and has to do with me resetting the buffer each time a new call is made. I am starting to work on a solution that maintains the state of the buffer between calls and only updates that portion of the buffer that needs to be.

Stay tuned!

AlexWHughes commented 1 year ago

Amazing! thank you so much

PennazSoftware commented 1 year ago

@AlexWHughes , I have published a new version (1.1.16) which should address the problem you are having. I will leave this issue open until I hear back from you. Please let me know if you see any problems with this fix.

AlexWHughes commented 1 year ago

Looks like this solved it. Thank you so much!