Docker container open from android

Hello All,

I am starting with Docker containers and I created some instances of Node-RED using port 1880, 1881 and 1882. I can open each instance from any laptop inside the same network writing the IP of PC which contains Docker (eg: 192.168.0.100:1881/ ). However when I try to open this node-RED instance through my android smartphone (connected to the same network via WIFI) the connection is not succesfully.

So, someone knows if docker instances can be open from android? What do I have to change?

My idea is to create multiple instance of Node-RED in the same local server (laptop) and open each dashboard of each instance from tablets to use them in the warehouse.

Thanks!!

Welcome to the forum @castigliano.

Is the phone connected to the local network (via wifi presumably)? If not then you will have to investigate how to access node red across the internet, which has been discussed many times in this forum. It is not something to be undertaken lightly as allowing access to your network from outside can easily leave you open to being hacked.

Thanks Colin,

yes, the phone is connected to the local network via WIFI.

Are you sure? If so then access should be exactly the same as on a laptop. If it works in the browser on a laptop then it should work in a browser on the phone. What are you seeing in the browser on the phone when you enter that ip:port?

Hello Colin,

It shows "this site cannot be accesed".
It surprised me, because when I launch a Node-RED installed in local in PC without Docker, I can open the IP from my phone connected to the same network. However when Node-RED is running through Docker, I cannot access to that IP.

Thank You!!

That makes no sense.

  1. Are you using the same port number for docker and non-docker install?
  2. When you access the docker and non-docker installs successfully from another PC on the network are you entering the same ip:port?

No, I am not using the same port number.
I use the port 1880 for local installation non-docker and the port 1881 for docker instance.

If I access to docker or non-docker from another PC, I can access properly. I just have the problem when I try with my phone. All of them is the same network via WIFI.
Could be some configuration of my router?

Thanks.

Stop the docker version and change the port number of the non-docker version to 1881. See if you can access that from another PC and the phone. That will tell you whether it is docker related or port related. Alternatively stop the non-docker version and change the port in docker to 1880.

It does not work. I tried docker version in port 1880 and it is not possible to access to it from the phone.
Yes, I can access to non-docker version in port 1881 from my phone.

Maybe it can be one solution for me, using several instances in local instead of docker. Do you know how many instances I can create in the pc? and wich ports i can use for that?

Thank you much for your help Colins

If you don't have a good reason to use docker then don't.

There is effectively no limit, you can use any port you like (except that the low numbered ones need admin privilege so stick to numbers above 1024.

You can start node red and tell it which folder to use as its home folder (instead of .node-red). You can specify the port in the settings file or in the command line. Run
node-red -h to see the command line options.

1 Like

A part from that. I have tried the docker version in another network (in this case in my company's network) and I can run properly the docker version through my phone android. So, probably my home's router is not working as I need.

My last doubt: which option is better (docker version or non-docker version) to run multiple instances of Node-RED in the same server to access to them through different android tablets? Because I tried to run multiple instances in windows in different ports and I would seem ok, however when I open the dashboard with a button and led it does not work well, showing only one item even empty dashboard.
Instance running localhost, port 1881, using that "node-red -p 1881 -u c:/node-red-1881"
image
the result of this flow is wrong in dashboard, it just shows the led:
image
if I delete the led on flow, the dashboard show that:
image

When I try that with docker instances, the dashboard works well and show that:
image

Could be the problem on instance installed as multiple in 1881, 1882 or 1884... Because the version installed normally as global in 1880 works well, but with versions installed after in 1881 and 1882 in another folders directly in C:\node-red-1881 or C:\node-red-1882 do not work properly.

Thank you so much!!!

Either will work if you do it correctly. You should have completely separate directories for each one if you don't use docker. If it isn't working correctly then check the node-red log for the failing one and check it is using the correct folders and files. If you can't see the problem then post the log for the failing one.

Hi Colin,
this is the log:

C:\Users\usuario>node-red -p 1884 -u c:/node-red-1884
8 Oct 11:39:40 - [info]

Welcome to Node-RED
===================

8 Oct 11:39:40 - [info] Node-RED version: v1.2.6
8 Oct 11:39:40 - [info] Node.js  version: v14.15.1
8 Oct 11:39:40 - [info] Windows_NT 10.0.14393 x64 LE
8 Oct 11:39:42 - [info] Loading palette nodes
8 Oct 11:39:45 - [info] Dashboard version 3.0.4 started at /ui
8 Oct 11:39:45 - [info] Settings file  : c:\node-red-1884\settings.js
8 Oct 11:39:45 - [info] Context store  : 'default' [module=memory]
8 Oct 11:39:45 - [info] User directory : c:\node-red-1884
8 Oct 11:39:45 - [warn] Projects disabled : editorTheme.projects.enabled=false
8 Oct 11:39:45 - [info] Flows file     : c:\node-red-1884\flows_PQCETEYMA2.json
8 Oct 11:39:45 - [info] Server now running at http://127.0.0.1:1884/
8 Oct 11:39:45 - [warn]

---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.

If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.

You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------

8 Oct 11:39:45 - [info] Starting flows
TypeError: Cannot read property 'config' of null
    at new LEDNodeConstructor (c:\node-red-1884\node_modules\node-red-contrib-ui-led\dist\nodes\ui_led\ui_led.js:25:44)
    at Object.createNode (C:\Users\usuario\AppData\Roaming\npm\node_modules\node-red\node_modules\@node-red\runtime\lib\flows\util.js:493:31)
    at Flow.start (C:\Users\usuario\AppData\Roaming\npm\node_modules\node-red\node_modules\@node-red\runtime\lib\flows\Flow.js:194:48)
    at start (C:\Users\usuario\AppData\Roaming\npm\node_modules\node-red\node_modules\@node-red\runtime\lib\flows\index.js:345:33)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
8 Oct 11:39:45 - [info] Started flows

I can not see the problem, could you please help me?

As you can see there is a problem with the led node. Probably something to do with the way it was installed when you started the new folder. Remove it and reinstall it and that will probably sort it. Go into the folder c:\node-red-1884 and run

npm remove node-red-contrib-ui-led
npm install node-red-contrib-ui-led

then restart node red and make sure the error is gone.

Hello Colin,
I removed the node-red-contrib-ui-led, however when I tried to install it again, the log shows error:

C:\node-red-1884>npm install node-red-contrib-ui-led
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: node-red-project@0.0.1
npm ERR! Found: node-red-dashboard@3.0.4
npm ERR! node_modules/node-red-dashboard
npm ERR!   node-red-dashboard@"^3.0.4" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer node-red-dashboard@"^2.23.3" from node-red-contrib-ui-led@0.4.10
npm ERR! node_modules/node-red-contrib-ui-led
npm ERR!   node-red-contrib-ui-led@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\usuario\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\usuario\AppData\Local\npm-cache\_logs\2021-10-11T08_07_59_591Z-debug.log

C:\node-red-1884>

I tried deleting node-red-dashboard before install node-red-contrib-ui-led anda later install again the dashaboard, but the dashboard display the same mistake of button and led mentioned in that topic.
Thanks.

I have read some topic that people discuss that node-red-contrib-ui-led 0.4.10 is not working well with dashboard 3.0.4
Instances which are working well has the dashboard version 2.19.4
Could it be possible?

You are hitting this issue which was supposed to be fixed, but isn't. I have added a comment to the issue.

In the meantime you can install it by telling npm to ignore the problem (which isn't really a problem at all) by using this command line
npm install --legacy-peer-deps node-red-contrib-ui-led

Thanks Colin.
I installed it succesfully however the problem on dashboard persists. The dashboard does not shows the button, just the led as mentioned before.
Hope the maintainer can solve that issue.
Thanks again.

Can you export the flow containing just the button and the led please, and paste it here.

Also open the dev tools in the browser (google for how to do that with your browser if you don't know how) and see if it shows any errors if you refresh that page.

Hello,
please see enclosed the flow:

[{"id":"db6cae17.a69c2","type":"ui_led","z":"9816f5b.926ab08","order":1,"group":"bfc7aa48.444c68","width":0,"height":0,"label":"","labelPlacement":"left","labelAlignment":"left","colorForValue":[{"color":"#ff0000","value":"false","valueType":"bool"},{"color":"#008000","value":"true","valueType":"bool"}],"allowColorForValueInMessage":false,"shape":"circle","showGlow":true,"name":"","x":740,"y":200,"wires":[]},{"id":"bfc7aa48.444c68","type":"ui_group","name":"Group 1","tab":"98f1ebfe.40a638","order":1,"disp":true,"width":6},{"id":"98f1ebfe.40a638","type":"ui_tab","name":"Tab 1","icon":"dashboard","order":1}]

And the dev tools in the browser when I refresh the dashaboard is:

DevTools failed to load source map: Could not load content for http://127.0.0.1:1884/ui/js/angular-chart.min.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
app.min.js:530 Rendered http://127.0.0.1:1884/ui/css/app.min.less successfully.
app.min.js:530 CSS for http://127.0.0.1:1884/ui/css/app.min.less generated in 292ms
app.min.js:530 Less has finished. CSS generated in 293ms
app.min.js:150 You are using the ngTouch module. 
AngularJS Material already has mobile click, tap, and swipe support... 
ngTouch is not supported with AngularJS Material!
(anonymous) @ app.min.js:150
e @ app.min.js:470
invoke @ app.min.js:66
(anonymous) @ app.min.js:68
r @ app.min.js:29
fb @ app.min.js:68
c @ app.min.js:43
Wc @ app.min.js:43
Ee @ app.min.js:42
(anonymous) @ app.min.js:372
e @ app.min.js:20
t @ app.min.js:20
setTimeout (async)
(anonymous) @ app.min.js:20
c @ app.min.js:20
fireWith @ app.min.js:20
fire @ app.min.js:20
c @ app.min.js:20
fireWith @ app.min.js:20
ready @ app.min.js:20
B @ app.min.js:20
app.min.js:135 GET http://127.0.0.1:1884/ui/loading.html 404 (Not Found)
(anonymous) @ app.min.js:135
s @ app.min.js:130
(anonymous) @ app.min.js:128
(anonymous) @ app.min.js:162
$digest @ app.min.js:174
$apply @ app.min.js:177
(anonymous) @ app.min.js:43
invoke @ app.min.js:66
c @ app.min.js:43
Wc @ app.min.js:43
Ee @ app.min.js:42
(anonymous) @ app.min.js:372
e @ app.min.js:20
t @ app.min.js:20
setTimeout (async)
(anonymous) @ app.min.js:20
c @ app.min.js:20
fireWith @ app.min.js:20
fire @ app.min.js:20
c @ app.min.js:20
fireWith @ app.min.js:20
ready @ app.min.js:20
B @ app.min.js:20
websocket.js:88 WebSocket connection to 'ws://127.0.0.1:1884/ui/socket.io/?EIO=4&transport=websocket&sid=ZXcAuki4H1vnKxGcAAAC' failed: 
doOpen @ websocket.js:88
open @ transport.js:46
probe @ socket.js:335
onOpen @ socket.js:361
onHandshake @ socket.js:425
onPacket @ socket.js:386
./node_modules/component-emitter/index.js.Emitter.emit @ index.js:145
onPacket @ transport.js:107
callback @ polling.js:98
onData @ polling.js:102
./node_modules/component-emitter/index.js.Emitter.emit @ index.js:145
onData @ polling-xhr.js:232
onLoad @ polling-xhr.js:283
xhr.onreadystatechange @ polling-xhr.js:187

When I refresh the Node-Red flow:

JQMIGRATE: Migrate is installed, version 3.3.0
DevTools failed to load source map: Could not load content for http://127.0.0.1:1884/vendor/purify.min.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
red.min.js:16 Node-RED: 1.2.6
red.min.js:16 Versions
red.min.js:16 Projects disabled
2DevTools failed to load source map: Could not load content for http://127.0.0.1:1884/gridstack.min.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

Thanks for your help