BiancoRoyal / node-red-contrib-bacnet

maintained by PLUS for Node-RED - https://plus4nodered.com
https://www.npmjs.com/package/node-red-contrib-bacnet
MIT License
25 stars 16 forks source link

client.js ignores Client>IPAddress setting in node-red and uses ALL_INTERFACES='0.0.0.0' resulting in bind EACCES error. #22

Closed aniston closed 2 years ago

aniston commented 3 years ago

Problem

  1. First set the interface with 2 IP addresses atleast and then assign the first one to another Program like YABE or backstack from skarg, the second free IP use that for the node-red-contrib-bacnet.

  2. Make a simple Read Prop Request to a BACnet Device and instantaly after the ADPU times out we get the "Error: ERR_TIMEOUT" message, this is the correct failure as we are not bound to any interface.

  3. I'm noticing that the lib tries to bind to 0.0.0.0 as seen in the file .node-red\node_modules\node-bacnet\lib\client.js line 18 where the const ALL_INTERFACES = '0.0.0.0'; is set , also needed is line 20 where the const BROADCAST_ADDRESS = '255.255.255.255';

  4. Inside node-red setting the Inteface>Client>IP_address seems to have no effect as it alwalys tries to bind to ALL_INTERFACES IP 0.0.0.0 , which can also result in a Error: bind EACCES as the interface IP is already in use by another client (as seen in the console if node-red is restarted after IP address change and Deployed.

  5. Dirty workaround is to set line 18 with const ALL_INTERFACES = '192.168.252.235'; as in my case and line 20 to const BROADCAST_ADDRESS = '192.168.255.255'; since i have a /22 subnet

Your Environment

Please tell us about your environment:

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 60 days with no activity. It will be closed in 30 days, but can be saved by removing the stale label or commenting.