node-lifx icon indicating copy to clipboard operation
node-lifx copied to clipboard

Not working in Windows when running Docker

Open Sawtaytoes opened this issue 6 years ago • 4 comments

For whatever reason, this isn't working for me in Windows. There's no issue or error, I just don't see any clients showing up.

const fs = require('fs')
const LifxClient = require('node-lifx').Client

const client = new LifxClient()

client.on(
  'light-new',
  light => (
    light
    .getLabel(
      (_, label) => (
        console.log(
          light.address,
          '\t',
          label
        )
      )
    )
  )
)

client.init()

I'm LAN-networked, so that might have something to do with it. The LIFX Universal Windows app sees lights and will use that port so I don't think it's something in Windows itself.

Did something change or do I need to enable some setting to get this working properly in Windows?

Sawtaytoes avatar Jun 28 '18 04:06 Sawtaytoes

It's probably firewall blocking the Node process. You'll need certain UDP port range to be open for incoming packages. I don't remember it just now but try disabling the firewall for a moment to verify the cause if it's possible for you to do so.

ristomatti avatar Jun 28 '18 06:06 ristomatti

The UDP port used for the discovery is 56700. See https://github.com/LIFX/lifx-protocol-docs/blob/master/workflows.md

MariusRumpf avatar Jun 28 '18 08:06 MariusRumpf

I noticed this in my console when running with debug: true on init:

DEBUG - 24000034d84a563100000000000000000000000000000000000000000000000002000000 to 255.255.255.255
DEBUG - 240000346ea6b48a00000000000000000000000000000022000000000000000002000000 from 10.1.0.5
DEBUG - 24000034d84a563100000000000000000000000000000000000000000000000002000000 to 255.255.255.255
DEBUG - 240000346ea6b48a00000000000000000000000000000022000000000000000002000000 from 10.1.0.5
DEBUG - 24000034d84a563100000000000000000000000000000000000000000000000002000000 to 255.255.255.255
DEBUG - 240000346ea6b48a00000000000000000000000000000022000000000000000002000000 from 10.1.0.5
DEBUG - 24000034d84a563100000000000000000000000000000000000000000000000002000000 to 255.255.255.255
...

That IP is the Raspberry Pi I have running this library. After shutting it down, those logs are removed, I only get the DEBUG ... to 255.255.255.255 lines afterward.

Looks like it's sending out the packets, but getting no responses right?

Sawtaytoes avatar Jul 28 '18 07:07 Sawtaytoes

I figured it out! It's something to do with Docker.

To fix the issue, I had to uninstall Docker. Something about the Ethernet adapter it installs or something else related to it are causing problems. I wonder if it has an internal subnet it designates to itself that is incompatible with my home subnet and prevents multicasting from node-lifx because of that.

Do you know what might be the issue now since we can narrow it down to Docker?

Sawtaytoes avatar Jul 28 '18 21:07 Sawtaytoes