Closed danielHHHH closed 6 years ago
Thank you so much for your feedback.
As you know, the node-lifx-lan does not work well if more than 2 network interfaces are found in the host for now. But I think that supporting multiple network interfaces is essential.
I'm planning to update the node-lifx-lan to work well even if multiple network interfaces are found. Give me some time.
@futomi You might get some ideas on how to fix this from checking how this is implemented on node-lifx. I'm in a bit of a hurry so I just quickly compared the implementations but it seemed node-lifx-lan has quite a complex logic for getting the interface address. node-lifx client seems to just bind to 0.0.0.0 by default.
@ristomatti, Thank you so much for your advice. I have not came up with any idea yet. Your advice is really helpful. I'll try that.
I updated the node-lifx-lan. Now it supports multihomed host. Try the latest version (v.0.2.0).
Thanks, working here!
On the host I'm using node-lifx-lan with, I have two network interfaces.
LifxLanAddress.get
returns the address for the unwanted network (the network without LIFX devices). This is due toLifxLanAddress.get
defaulting to the network interface with the higher netmask/mask_bit_num
. In my case, /24 for the unwanted interface and /16 for the wanted interface.Could logic be added to perform discovery on all found network interfaces? Maybe add an option to restrict to a specific interface?
I added some debugging to the code to illustrate. The 172.25.1.0 network is the unwanted interface, the 10.10.0.0 is the wanted interface.