Node-Red on Omega2+: Unable to make it listen on other IP then 192.168.3.1
Got node red running OK now on an Omega2+
The Omega is connected to my wifi network on IP 10.1.0.79. I've tried to set this IP every single config file that defines the
uihostvariable. When starting Node red with the verbose option it prints the uiHost value, and the output below shows it's set correctly. The server however can not be reached on that IP. Further down in the output (
Server now running at) it still shows 192.168.3.1.
The variable used there is
__listenpath__, but I have not been able to find assignments to that variable anywere.
Any suggestion on how to get Node Red to listen on the wifi client IP?
[Node red Output]
The host is: 10.1.0.79 28 Jan 18:55:05 - [info] Welcome to Node-RED 28 Jan 18:55:05 - [info] Node-RED version: v0.16.1 28 Jan 18:55:05 - [info] Node.js version: v4.3.1 28 Jan 18:55:05 - [info] Linux 4.4.42 mipsel LE 28 Jan 18:55:13 - [info] Loading palette nodes 28 Jan 18:56:03 - [warn] ------------------------------------------------------ 28 Jan 18:56:03 - [warn] [rpi-gpio] Info : Ignoring Raspberry Pi specific node 28 Jan 18:56:03 - [warn] ------------------------------------------------------ 28 Jan 18:56:06 - [info] Settings file : /root/.node-red/settings.js 28 Jan 18:56:06 - [info] User directory : /root/.node-red 28 Jan 18:56:06 - [info] Flows file : /root/.node-red/flows_Omega-6F23.json 28 Jan 18:56:06 - [info] Server now running at http://192.168.3.1:1880/ 28 Jan 18:56:07 - [info] Starting flows 28 Jan 18:56:07 - [info] Started flows
#ifconfig apcli0 Link encap:Ethernet HWaddr 42:A3:6B:00:6F:23 inet addr:10.1.0.79 Bcast:10.1.0.255 Mask:255.255.255.0 inet6 addr: fe80::40a3:6bff:fe00:6f23/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:329054 errors:0 dropped:0 overruns:0 frame:0 TX packets:229210 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:120967899 (115.3 MiB) TX bytes:20626972 (19.6 MiB) br-wlan Link encap:Ethernet HWaddr 40:A3:6B:C0:6F:25 inet addr:192.168.3.1 Bcast:192.168.3.255 Mask:255.255.255.0 inet6 addr: fe80::42a3:6bff:fec0:6f25/64 Scope:Link inet6 addr: fd1d:48c4:7633::1/60 Scope:Global UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:121465 errors:0 dropped:0 overruns:0 frame:0 TX packets:104575 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:14048006 (13.3 MiB) TX bytes:79266284 (75.5 MiB)
No idea on Node Red, but generally unless you want to specifically exclude something you would solve this by listening on INADDR_ANY, ie, 0.0.0.0 which would match the address of any interface on the device.
However it's not clear that the message actually shows what interface it is listening on, vs. just being an advisory suggestion for where to point your browser.
If you want to see what it is actually listening on, you could see if
nestat -n -lor something like that works.
@Chris-Stratton That is what the Node Red documentation says as well. The default settings file has 0.0.0.0 in there, but that didn't work.
I forgot to mention that I had confirmed it is only listening on 192.168.3.1. Full netstat output:
Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:53 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN tcp 0 0 192.168.3.1:1880 0.0.0.0:* LISTEN tcp 0 0 :::80 :::* LISTEN tcp 0 0 :::53 :::* LISTEN tcp 0 0 :::22 :::* LISTEN udp 0 0 0.0.0.0:53 0.0.0.0:* udp 0 0 0.0.0.0:67 0.0.0.0:* udp 0 0 0.0.0.0:5353 0.0.0.0:* udp 0 0 :::547 :::* udp 0 0 :::53 :::* udp 0 0 :::5353 :::* raw 0 0 ::%1:58 ::%4440316:* 58 raw 0 0 ::%1:58 ::%4440316:* 58
I was expecting the
__listenpath__variable to be a default node.js one that is inherited by red.js. But Google shows very little for that variable name. I'll see if I can add some code to force an assignment of uiHost to listenpath. But I would be mostly guessing on what the overall impact of that would be.
This post is deleted!
@Bas-Rijniersce I think settings.uiHost is the only place you can set the listen path. This may be an issue of your configuration file not being loaded with the same permissions as node-red is run as?
I good way to check is to see if changing the uiPort in the the settings file will be respected as well. Have you tried setting the listening port via the command line and then via the settings file? What command are you using to start node-red?
@Theodore-Borromeo Good point about permissions. Since everything is under root I did not check that. Will do when I get home. Starting it with
cd /usr/bin/onion-node-red/node_modules/node-red/ node red.js
I have the same problem. Has anyone found a fix for it?