I am trying to use Node-red on my CC100 for a scheduled API trigger, but I simply cannot reach the Node-red interface.
- Docker is installed, functional, and running.
- FTP and HTTP are both enabled
- Routing → IP forwarding is enabled
- Ensured correct clock zone and local time settings
- DNS 8.8.8.8 and 8.8.4.4 are added
The static ip address is set to 192.168.0.153 and pointed to our private server.
I used the code
docker run -d --name wago-node-red \
-d --privileged=true --user=root \
-p 1880:1880 \
-v node_red_user_data:/data \
nodered/node-red
to install Node-red, and it seemed to be successful, because I can run ‘docker container ls’ and see the nodered container information
“CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
648c0e8cf4fd nodered/node-red “./entrypoint.sh” 2 hours ago Up 2 hours (healthy) 1880/tcp elastic_sanderson”
But when I go to my browser and enter 192.168.0.153:1880, the connection can’t be established.
Running ifconfig returns that 59 packets are being dropped consistently, and when I run ‘docker run nodered/node-red’, it says “15 Sep 20:22:24 - [info] Server now running at http://127.0.0.1:1880/”
This issue is one a couple other forums online, but I haven’t seen an answer yet.
I’m pretty new to programming, so I understand keystrokes and debugging tools better than top-level concepts.
Hi,
there are probably neater ways to do it, but I’ve added
--network host
to my docker run command
docker run -d --name wago-node-red \
-d --privileged=true --user=root \
-p 1880:1880 \
--network host \
-v node_red_user_data:/data \
nodered/node-red
1 Like
Thank you, Bjorn!
To make this work, I first used the command
docker container prune
to remove all of my open non-running docker containers.
Then I found and copied the container ID by running
‘docker container ls’
, then ran
‘docker start (paste container id here)’
Now, I am able to access the Nodered interface.
In the future, instead of a prune-command you could do
docker stop <nodered>
docker rm -f <nodered>
Run the modified docker run command.
1 Like
Bjorn, thank you for the information, you’ve been a great help.
Further progress updates:
In this application, the project called for the PLC inside of a panel, calling api missions based on a time of day, and able to handle power outages.
For panel application:
We used an Antaira AMS-2111 as a client-bridge, and connected the CC100 to that via ethernet in order to connect to the network.
For time-based calls:
Joe Remisiewicz and Joe Polasek (Wago) were able to point me to the CronPlus module in Node-RED, used as a scheduler for Post requests, which then call missions and adjust PLC registers on a MiR robot.
For power outages:
I discovered the docker script option
‘–restart always’
and added that to the end of first line of the code snip you gave above when creating my Node-RED container.
docker run -d --name wago-node-red --restart always \
Now, when the CC100 loses power, it takes a little bit of time to boot up and then it begins running the Node-RED flow again.
These steps may be old news to most, but it has been a big breakthrough for me!
I plan on spending some more R&D time learning how to integrate the PLC I/O in Node-RED so that I can make API calls based on sensor inputs.