Bannsaenger / node-red-contrib-artnet-controller

Node-RED nodes that controls lights via artnet. This is a complete solution for sending and receiving dmx-data via Art-Net without the need of additional hardware
MIT License
3 stars 0 forks source link

node-red crash if artnet interface not reachable #3

Open marcobrianza opened 1 year ago

marcobrianza commented 1 year ago

hello, thank you for this software. I'm switching to it from the one from Gunnebo. I have noticed that if the destination address of the arnet controller is unreachable all node red exits. is there a way to void this?

thank you

29 Mar 08:56:17 - [info] Starting flows 29 Mar 08:56:17 - [info] [Art-Net Sender:22a1323d1845e5ce] [ArtNetSender] Creating sender on controller: parameters: IP: 192.168.8.20:6454, SubNetUni: 0:0:0, refresh interval: 1000 ms, sender clock: 25 ms 29 Mar 08:56:17 - [info] [Art-Net Sender:22a1323d1845e5ce] [ArtNetSender] initial transmit starting mainWorker with senderClock 25 ms, spontaneous sending = on 29 Mar 08:56:17 - [info] [Art-Net Out:odemk2] [ArtNetOutNode] senderObject: Art-Net Sender:22a1323d1845e5ce, controllerObj: Art-Net Controller:54f4778a3cd0e680 29 Mar 08:56:17 - [info] Started flows 29 Mar 08:56:22 - [red] Uncaught Exception: 29 Mar 08:56:22 - [error] Error: send EHOSTUNREACH 192.168.8.20:6454 at doSend (node:dgram:716:16) at defaultTriggerAsyncIdScope (node:internal/async_hooks:464:18) at afterDns (node:dgram:662:5) at processTicksAndRejections (node:internal/process/task_queues:83:21) at runNextTicks (node:internal/process/task_queues:64:3) at processImmediate (node:internal/timers:447:9)

Bannsaenger commented 1 year ago

Hi, this behavior is caused by the dmxnet library where all udp sending is done. If an error occurs on sending the error is thrown. In node-red this crashes the whole node-red process. I think we should do a better error handling in the dmxnet library in one of the next versions. Generally i think this controller should be used with some type of broadcast addresses. If you do so, there will be no problem with sending udp data to the network. I hope this helps.

marcobrianza commented 1 year ago

Hi, thank you for looking into this. I have never programmed in node, but I think that trapping the error and passing on should fix. Sending to broadcast mitigates the problem but still makes node-red crash if the network with that particular subnet is down. So for example if you change network you cannot even restart node-red to remove the problematic subnet :-O

Bannsaenger commented 1 year ago

Ok, please try the the version 0.1.4. I added a user defined error handling. Please wait till the next dmxlib version > 0.9.0 is available. With version 0.9.0 the behaviour is like before.

marcobrianza commented 1 year ago

great, thank you. I will try it as soon as it is updated