• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Accessing a modbus device connected to RTE port from Node-RED
#1
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,


Attached Files Thumbnail(s)
       
  Reply
#2
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/hilsch...ernet-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.
You never fail until you stop trying.“, Albert Einstein (1879 - 1955)

  Reply
#3
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.


Attached Files Thumbnail(s)
       
  Reply
#4
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.
You never fail until you stop trying.“, Albert Einstein (1879 - 1955)

  Reply
#5
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,


Attached Files Thumbnail(s)
           
  Reply
#6
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/hilsch...i-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".
You never fail until you stop trying.“, Albert Einstein (1879 - 1955)

  Reply
#7
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,


Attached Files Thumbnail(s)
                           
  Reply
#8
I will check it myself the next days.
You never fail until you stop trying.“, Albert Einstein (1879 - 1955)

  Reply
#9
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
You never fail until you stop trying.“, Albert Einstein (1879 - 1955)

  Reply
#10
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...osys/nano/

Best regards,


Attached Files Thumbnail(s)
   
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Node Red configuration LucioFiam 3 1,603 November-30th-2022, 05:14 PM
Last Post: Armin@netPI
  443 port issue LucioFiam 5 2,090 November-21st-2022, 05:39 PM
Last Post: LucioFiam
  USB Port Mapping DSongra 5 3,821 March-10th-2022, 09:20 AM
Last Post: Armin@netPI
  secure node-red with a username and password Christian_Rau 3 2,800 December-3rd-2021, 11:06 AM
Last Post: Armin@netPI
  cifx0 and Node-Red fabio1975 5 3,051 November-22nd-2021, 01:13 PM
Last Post: Armin@netPI
  Node red web UI issue DSongra 3 3,118 July-22nd-2021, 02:47 PM
Last Post: Armin@netPI
  Node-RED 'projects' possible on netPI? JG_KIT 2 2,280 July-20th-2021, 01:11 PM
Last Post: JG_KIT
  Docker exposed port don't send data on eth0 COswald 3 3,074 July-15th-2021, 02:10 PM
Last Post: Armin@netPI
  Accessing netPI web UI with REST API Armin@netPI 14 7,591 June-30th-2021, 05:06 AM
Last Post: Armin@netPI
  Node-RED: OpcUa Client node tad 4 4,327 June-9th-2021, 08:51 AM
Last Post: tad

Forum Jump:


Users browsing this thread: 2 Guest(s)