Forums for specific products (others supported  here)
Accessing a modbus device connected to RTE port from Node-RED - Printable Version

+- Forums for specific products (others supported here) (https://forum.hilscher.com)
+-- Forum: netPI - Ruggedized Industrial Ethernet Raspberry Pi (https://forum.hilscher.com/forum-1.html)
+--- Forum: Software (https://forum.hilscher.com/forum-5.html)
+--- Thread: Accessing a modbus device connected to RTE port from Node-RED (/thread-646.html)

Pages: 1 2


Accessing a modbus device connected to RTE port from Node-RED - tad - September-29th-2020

Dear Armin,

I need you help, please.

I'd like to separate network segments for IT and fieldbus.
For this, using netPI RTE 3, I created a container of 'hilschernetpi/netpi-netx-ethernet-lan'.
A modbus device is now connected to the fieldbus segment (RTE port).

Then, I want to output data to the modbus device using 'Modbus-Write' node with Node-RED.

But, I think 'Modbus-Write' node recognizes that TCP is the standard IT port.
Because Modbus communication doesn't start at all.

As a test, I confirmed that Modbus communication can be done properly when the modbus device is connected to the standard IT port.

Therefore, my question is:
Is it possible to make 'Modbus-Write' node recognize RTE port?

Thank you very much for your support.
Best regards,


RE: Accessing a modbus device connected to RTE port from Node-RED - Armin@netPI - September-29th-2020

You configured the Ethernet LAN container wrong. Please use it in "HOST" network mode as it is described here in the README here https://registry.hub.docker.com/r/hilschernetpi/netpi-netx-ethernet-lan/.

Then go to netPI web UI  and login to the standard netPI control panel. In the manu "network/LAN" you will now find next to the "eth0" interface also the "cifx0" interface where you can configure it to any ip address setting you want.


RE: Accessing a modbus device connected to RTE port from Node-RED - tad - September-30th-2020

Dear Armin,

Thank you very much for your quick response.

Now, I set up the container of 'hilschernetpi/netpi-netx-ethernet-lan' as host.
From the edge gateway manager (Web GUI), I set the cifx0's IP address to 192.168.50.169/24.
But, 'Modbus-Write' node doesn't communicate with a modbus device connected to RTE port at all.
A status under the node indicates 'initialize'.

By the way, I have 2 containers with host settings.
Because not only 'hilschernetpi/netpi-netx-ethernet-lan' but also 'hilschernetpi/netpi-nodered' require the host setting.
Otherwise, I could not open the Node-RED editor from Chrome.

Ethernet cables are wired as follows.
PC  <===>  netPI std port,   netPI RTE port  <===>  a modbus device.

If you found something wrong from the above comments, would you please give me your feedback?
Thank you very much for your support.


RE: Accessing a modbus device connected to RTE port from Node-RED - Armin@netPI - September-30th-2020

Well you can do 3 simple checks first of all if cifX0 is running.

1. You can ping cifX0 over the RTE ports if you connect a standard PC with correct IP settings like 192.100.50.170 to RTE port. And call ping 192.100.50.169

2. You can ping the modus slave over netX-ethernet-lan container using docker web UI and go into the container console and then call ping 192.100.50.250

3. You can call now complete netPI web UI also now over cifX0 RTE ports. So the same as you do over eth0 port today. So connect a PC to the RTE ports and give it a correct IP address like 192.100.50.170 and then open your browser and call https://192.100.50.169 and now also the netPI web UI will pop up

Report what you have detected afterwards.


RE: Accessing a modbus device connected to RTE port from Node-RED - tad - September-30th-2020

Dear Armin,

The followings are results:

>1. You can ping cifX0 over the RTE ports if you connect a standard PC with correct IP settings like 192.100.50.170 to RTE port. And call ping 192.100.50.169

Destination host unreachable (1_Console_on_mypc.png)

>2. You can ping the modus slave over netX-ethernet-lan container using docker web UI and go into the container console and then call ping 192.100.50.250

Destination host unreachable (2_Console_on_mynetX_container.png)
I don't understand why a response is coming from 163.139.152.1???

>3. You can call now complete netPI web UI also now over cifX0 RTE ports. So the same as you do over eth0 port today. So connect a PC to the RTE ports and give it a correct IP address like 192.100.50.170 and then open your browser and call https://192.100.50.169 and now also the netPI web UI will pop up

Unable to access (3_Browser_from_mypc.png)

I have no idea what the problem is, so far.
Best regards,


RE: Accessing a modbus device connected to RTE port from Node-RED - Armin@netPI - September-30th-2020

There is one more thing ... which Node-RED container are you loading and using?

I am asking because if you use https://registry.hub.docker.com/r/hilschernetpi/netpi-nodered/ container then this container configures cifX0 as Node-RED fieldbus and overwrites settings from netx-ethernet-lan container and configured netX chip as PROFINET device instead of standard TCP/IP device.

To configure Node-RED container not to reconfigure netX chip as PROFINET then you have to set the environment variable FIELD to value "none".


RE: Accessing a modbus device connected to RTE port from Node-RED - tad - October-1st-2020

Dear Armin,

Thank you very much for your advice.
Even though I set FIELD = none in Env parameter area when re-deplyoed the Node-RED container 'hilschernetpi/netpi-nodered'.

So, I did the followings:
- I restored the recovery image to my netPI RTE 3, which means my netPI was initialized as the factory state.
- I enabled Docker.
- I deployed 'hilschernetpi/netpi-netx-ethernet-lan' only, with Network=host setting.
- I tried to set cifx0 IP address to both 192.168.2.169/24 and dhcp.
then,
- From my PC, I pinged 192.168.2.169, but 'Destination host unreachable' when cifx0 IP address=192.168.2.169/24.
- From my PC, I run an IP scanner software, but netPI wasn't detected when cifx0 IP address=dhcp.

Therefore, I think I may have some mistakes when 'hilschernetpi/netpi-netx-ethernet-lan' is deployed.
I attach some screen shots.
I would appreciate it if you would find something wrong.

Thank you very much for your help.
Best regards,


RE: Accessing a modbus device connected to RTE port from Node-RED - Armin@netPI - October-1st-2020

I will check it myself the next days.


RE: Accessing a modbus device connected to RTE port from Node-RED - Armin@netPI - October-1st-2020

Hi tad,

I can confirm that 'hilschernetpi/netpi-netx-ethernet-lan' container on a fresh netPI RTE 3 running in 'host' mode does not work as expected.

What I see right now is that netPI's control panel UI "network/LAN"  does not configure cifX0 IP address when setup.

For a test I used the console function Docker UI for netpi-netx-ethernet-lan container.

In this console I entered the cifX0 IP setup manually using the command

Code:
ip addr add 192.168.50.169/255.255.255.0 broadcast 192.168.50.255 dev cifx0

With this command the cifX0 is assigned your requested IP address properly and everything works then.

So now I need to check with the netPI development team why netPI's control panel UI "network/LAN" is not configuring the cifX0.If they are telling me there is no configuration possible from control panel UI - like you and I have detected - then I need to modify the container start script in that way that the environment variables IP_ADDRESS, SUBNET_MASK, GATEWAY needs to be set in 'host' too like documented in bridged mode already.

Thx
Armin


RE: Accessing a modbus device connected to RTE port from Node-RED - tad - October-2nd-2020

Dear Armin,

Thank you very much for your kind support.
I was able to assign the IP address to the RTE port by setting the IP address as you explained.

I was wondering if you would update this thread when you improve the procedure of setting IP address.

By the way, I can now communicate with a modbus device, which is a distributed I/O system connected to RTE port.
So, I can read/write analog signals and expand digital I/O signals from Node-RED.
https://www.contec.com/products-services/daq-control/iiot-conprosys/nano/

Best regards,