klein0r / node-red-contrib-artnet-node

Node-RED node to control DMX slaves via ArtNet
https://haus-automatisierung.com
MIT License
5 stars 3 forks source link

No network connection #1

Open NBLYNX opened 2 years ago

NBLYNX commented 2 years ago

Hi

It seems my node-red is not sending any artnet packages to my network. I used the example flow and changed the ip address to my artnet node.

I used DMX-workshop to test my artnet node and it works on unicast and broadcast modes. also the Node-RED node does not show up in the "node list" in DMX-workshop. is there some node-red setting that needs to be tweaked perhaps to use your software?

thxrben commented 2 years ago

I have just discovered that the packets are malformed. The DMX Length in the ArtNet-Header is always set to 512/518, but not all channels are transmitted. This may be your issue too.

daniel-wassenberg commented 2 years ago

The Artnet protocol spec requires the length to be an even number between 2 and 512, but this is mostly ignored in implementations. They way this is implemented, when the length is less than 256 the || 2 causes the upper byte to be 2 giving you a length of 512 plus the actual length.

https://github.com/klein0r/node-red-contrib-artnet-node/blob/27d95ca94aee888cb6c286deeb7268b38385d386/lib/artnet-client.js#L21-L22

I will attempt to test a fix for this soon and submit a patch.

thxrben commented 2 years ago

Thanks for the response! Assuming that some devices will respect that specification, would it be possible to just add a checkbox so it would either work according to spec or just ignore it so the packets arent malformed?

daniel-wassenberg commented 2 years ago

I've made the fix to correct the packet length, tested it, and submitted and pull request. If I have time I'll see about adding a check box or selection box to send packets as is, even length, or full.