originallyus / node-red-contrib-alexa-local

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

Use a predetermined port range (config?) #3

Closed spants closed 6 years ago

spants commented 6 years ago

Could it use a fixed range of ports instead of random ports(?) - that way we can use it in Docker images too.

hardillb commented 6 years ago

How do you forward SSDP broadcast packets to a docker container?

torinnguyen commented 6 years ago

In order to make it dead-simple to use, I have decided to make the port selection automatic. Let me think of a way to implement it without compromising on user experience. However, do note that the port number given for a Node will never change even after a NodeRED reboot.

torinnguyen commented 6 years ago

@hardillb I don't have enough knowledge of docker to answer your question. The SSDP service being used here always listen on port 1900. I believe it's UDP traffic.

hardillb commented 6 years ago

That question was more aimed at @spants. The problem will be that while the port may be fixed it is sent to a broadcast address. I've had issues with firewall rules for SSDP for the WeMo nodes in the Node-RED core set so just wanted to make him aware it could still be a problem.

spants commented 6 years ago

@hardillb good question! For the wemo nodes before I just opened a port range and then for any wemo nodes I mapped them into that range.... it worked well

hardillb commented 6 years ago

That doesn't work for when you are doing the discovery (not replying to a discovery request) because the reply come from a unknown IP address on a random port, it needs a iptables helper module to track the outgoing requests.

spants commented 6 years ago

@hardillb weird that it did work for me then, must have been lucky!....... I will close this.

lesterchia1 commented 6 years ago

Hi spants, the node work for the MQTT but it didn't work when i connect the node to rpi-gpio out node pin 11. How do you do it? Appreciate for your advise.

tfatykhov commented 6 years ago

easiest fix for now - is to run docker container with node red attached to host network but that may not suite all especially if you are using linking. another more complicated way is to use piperwork - https://github.com/jpetazzo/pipework

MosquitoD4K commented 6 years ago

Okay, so I run node-red on a windows server and need to define open ports manually in the firewall. This feature would be great to have. It would be nice to be able to configure the port of a node.