Hello i am running node-red under docker and the UDP netvar receiver variable works fine on the port 1202, the netvar sender port is configured for the port 1400. When i run "docker ps " command on a ssh terminal the output is below:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d8372f9ae59a nodered/node-red:2.2.2 “npm --no-update-not…” 3 days ago Up 54 minutes (healthy) 0.0.0.0:1202->1202/udp, 0.0.0.0:1400->1400/udp, 0.0.0.0:1880->1880/tcp mynodered5
and my ecockpit does not have any conflict regardin the udp port or the network variable list index. I ran a wireshark and noticed that there is no UDP transactions on the port 1400. My end goal is to receive values from ignition and send it to PFC via the netvar-sender node. Can anyone help me with the problem or recommend me an approach to deal with this?
I am not aware that ignition supports Network Variables. In my experience, this is a Codesys protocol meant for PLC to PLC communications.
Perhaps it would be easier to use OPC-UA to communicate between Ignition and PLC?
The node-red Netvar-receiver works fine on ignition however (indicating network variables should be fine with ignition), the netvar-sender is the only issue. I ran a wireshark capture and it only showed data transmitting from ignition to node-red (on Port 1202) but there was no transaction regarding the netvar-sender (which sends data UDP on port 1100). I believe this can be a networking problem on the docker end as i am not sure how docker really works in terms of UDP tx/rx and port handling.
If network variables are supported in Ignition then it can communicate directly to the PLC e!RUNTIME, are you using NodeRED just for troubleshooting?
Check your docker command for NR that it includes --network=host parameter, otherwise, it will block external traffic if only -p 1880:1880 is used.
my purpose to use node-red is to communicate to WAGO-PFC to ignition or vice versa via MQTT sparkplug-B , OPC-UA is alternative i agree but it is lot of data to manage, i think in my docker command i specified -p 1202:1202/udp and port -1100:1100/udp, the 1202 works fine somehow but not the 1100.
am not sure about the network host parameter command, can you be more little detailed on that? the way i have set up my container is using this command below:
it still does not work as i believe docker container and network host share same stack however when i run docker inspect “container ID” only 1880/tcp is only exposed port as it is a default for the node-red. after running on the network-host, it still does not send values of network variable from node-red to the ecockpit yet. i am not sure how can we do a UDP send in a node-red if we don’t have a port mapped in our docker run command?
my end goal is to get values from node-red to ecockpit. Please help.
–network=host supercedes the -p option, it does not block any ports.
Can you post your udp out node configuration, netvar Sender config in NR and the settings page of the NetVar receiver in C3.5 please? Did you go online with the C3.5 to determine the ID number for the reciever that was assigned to it? This must be entered in the sender node below the index.
One of the strange thing i found is when i get online without deploying node-red my DwID is 2970419 but as soon as i deploy it, it changes back to 861089024 and vice versa as if i put 861089024 in my netvar sender and then deploy it, in the Ecockpit DwID changes back to 2970419, i just found out now. Is it normal or that shouldn’t be happening?
i am new to the docker and this UDP nodes as well, please take a look at this and let me know if there is something wrong on my node-red end or it could be the docker?
Actually i fixed the problem, so instead of using ip address 192.168.0.2, i used localhost and instead of port 1100 i used port 1800 (As running on the host mode on container) it fixed the problem and now even the numbers are also match, somehow i don’t understand why it was mismatching number before/ or did not work. i am still wondering, how actually the network architecture is , in relation to outside softwares (ecockpit for ex.) to the docker & its containers.
Great, nice job. NetVar can behave strangely sometimes. Keep in mind that Network Variables is a proprietary protocol with no documentation. I built the NetVar using trial and error to figure out the protocol by looking at the packets (and referring to a Java library I found)
It helps to reboot the controller after changing things because the ports do not seem to refresh or release until a reboot. I know this caused me some grief, but once the program is written and running its fine after that.
can you provide a good resource how the docker connects to ecockpit or how the docker architecture is in terms of communicating to WAGO PFC200 from the docker0 daemon server? i just want to know the networking aspect of how the docker as a host mode communicates with ecockpit? thank you
Docker doesn’t really connect to e!COCKPIT, this is what the NetVar is meant to address. The speed of the docker service is determined by the CPU/Memory constraints of your application. The performance of the Gen 2 PFC is approx 40% greater than the Gen 1 you are testing.
I am actually facing same issue again on a different ecockpit program, however one thing that i notice is my ID number in the receiver list in the ecockpit just swaps after i hit the deploy. for example when i am seeing the ID number in receiver list is 2970419, and i put that number on my netvar-sender and then hit deploy, suddenly the ID number in the program becomes 861089024.
Can you help me with this? i am not sure why it is happening, it worked okay with 2970419 on previous project.
The ID number is included in the message that the sender transmits to the receiver. You only have to configure the senders (one in NR the other in Codesys)
Hello Thanks for the help. I just had one question, if the PLC is in run mode, are the network variables also running in the background? i am just afraid that network variable might not connect/work with node-red until i connect to ecockpit and perform deploy on node-red. Please help me with this question.
e!COCKPIT is not necessary for NetVar to work once the program is running on the controller. e!COCKPIT is only used to write the program and download the boot project to the PFC200.