spacemanspiff2007 / PyArtNet

"Python wrappers for the Art-Net protocol to send DMX over Ethernet"
GNU General Public License v3.0
67 stars 13 forks source link

No way to turn off all lights if lights are already off (e.g. after restart) #16

Closed wbutter closed 1 year ago

wbutter commented 2 years ago

Issue: If an .add_fade commands zero for all channels, no ArtNet packet is sent over Ethernet

Workaround 1: Create a phantom channel after all other channels and send any non-zero value when zeroing all other channels. Cons - only allows for 511 DMX channels in the universe.

Workaround 2: Using a non-linear output correction and setting at least a single channel to hex value of 1 (which output correction adjusts to a value of zero) will still send the ArtNet packet.

Note, this was only tested on a single universe application.

spacemanspiff2007 commented 2 years ago

Is a channel actually on before you set it to 0? Can you provide a snippet and the corresponding log output?

wbutter commented 2 years ago

After further testing, I believe this bug only exists if the first command sent after starting the code is trying to turn off the lights (this situation may occur if code was restarted after turning lights on or another device turned on the lights).

spacemanspiff2007 commented 2 years ago

So to summarize: if all channels are off and you switch them off again nothing happens. That doesn't sound like a bug to me! :wink:

It will however automatically sync the lights if you have not disabled it with the refresh_every parameter of the ArtNetNode. Something between 2 and 5 seconds is typically a good value.