originallyus / node-red-contrib-alexa-local

An easy-to-use NodeRED node for adding Alexa capability to NodeRED. NO Alexa Skills required.
106 stars 25 forks source link

Discovery not working due to port defined as IPV6 by default in node-red #93

Open chipgoon opened 5 years ago

chipgoon commented 5 years ago

Node-red seems to be opening ports as IPV6 by default. I only use IPV4 in my local network, and thus alexa cannot find the Alexa-local instance.

Running 'netstat -tulpn | grep node-red' on the host: tcp 0 0 127.0.0.1:46836 0.0.0.0: LISTEN 3648/node-red
tcp6 0 0 :::29000 :::
LISTEN 3648/node-red
tcp6 0 0 :::37429 ::: LISTEN 3648/node-red
udp 0 0 192.168.6.62:50538 0.0.0.0:
3648/node-red
udp 0 0 0.0.0.0:1900 0.0.0.0: 3648/node-red
udp 0 0 0.0.0.0:1900 0.0.0.0:
3648/node-red
udp 0 0 0.0.0.0:1900 0.0.0.0: 3648/node-red
udp 0 0 0.0.0.0:1900 0.0.0.0:
3648/node-red
udp 0 0 172.17.0.1:50081 0.0.0.0: 3648/node-red
udp 0 0 172.30.32.1:50116 0.0.0.0:
3648/node-red

Port 37429 is used for alexa discovery in my case (displayed on the GUI), but it is created as IPV6 instead of IPV4.

Background: node-red plugin v3.0.3 for home assistant (node-red v 0.25.0), home assistant v0.92.0 under debian 9.9 stretch host. Have full ipv4 local access to node-red network, open and non-firewalled. Alexa devices are on the same network. Alexa does not discover any new devices, as I have IPv6 networking disabled in my router.

Found some references online about node.js changed behavior to use ipv6 by default. Such as: https://stackoverflow.com/questions/47797322/node-js-server-only-listening-on-ipv6

chipgoon commented 5 years ago

Running node-red-contrib-alexa-local v 0.3.24

chipgoon commented 5 years ago

Well, even though it's strange that the ports are on IPV6 by default, they are getting forwarded to IPV4 in my config (net_ipv6.conf.all.forwarding=1 in /etc/sysctl.conf), that seems to work fine.

After a few hours of investigation and packet monitoring I solved my problem, had to do with SSDP on my wifi network. In my wifi (Unifi) settings, I found an option to 'enable multicast enhancement' (IGMPv3). Once I turned that on, alexa discovered my nodes.

The issue can be closed.

nalinda6963 commented 4 years ago

Well, even though it's strange that the ports are on IPV6 by default, they are getting forwarded to IPV4 in my config (net_ipv6.conf.all.forwarding=1 in /etc/sysctl.conf), that seems to work fine.

After a few hours of investigation and packet monitoring I solved my problem, had to do with SSDP on my wifi network. In my wifi (Unifi) settings, I found an option to 'enable multicast enhancement' (IGMPv3). Once I turned that on, alexa discovered my nodes.

The issue can be closed.

Does this still work for you? I tried net_ipv6 forwarding and multicast but had no luck