I'm trying to run a modbus server with an IP address that is not used by Node-Red but it keeps crashing and putting me this error. And this is valid for a large number of IP address. The problem is that I need to use this specific IP (that I can't share with you for security reasons ).
PS: I want to use this server on my RPI400 so that an other automate can connect to this modbus server. Do you know if there's any configuration to do or I just drop the modbus server on the flow
Is it a public/external IP address? - modbus has no notion of security so anyone finding it on the internet can read/write its data.
If it is not public (eg Class A: 10.0.0.0 — 10.255.255.255, Class B: 172.16.0.0 — 172.31.255.255 or
Class C: 192.168.0.0 — 192.168.255.255) there is no reason to hide it.
If you really really cannot reveal what is HIDDEN, please chose one of the following...
the hidden IP is the IP of a physical port on this node-red server?
the hidden IP is the IP of an external device?
the hidden IP is a loopback address?
PS: your edit hides another important detail - what PORT number is modbus server trying to bind to? 502?
Questions...
Can the node-red ping this HIDDEN IP address?
What hardware / OS is crashing node-red running on?
It's a Class A(my company don't want me to share it) and the IP of a physical port (I guess because I want later on that the automate recognise this IP)
The port is 6000 but even with 502 or other it crashes.
Firstly, a node should never crash node-red - so regardless of what you are doing to make it happen, you should raise this as an issue on the repository (in fact it may already be a raised issue)
For the short term, I would check that the IP is visible from within the node-red (for example, if you are running in docker, then it probably wont be or will be a different IP). Basically, as you are creating a modbus server, the IP and PORT it binds to must be available to the OS (be that a docker guest or a OS on the metal) where node-red is executing. That includes firewalls.
It has been reported multiple times before but it haven't been changed.
I don't think I really understood honestly. If I don't create the server, I won't be able to ping the IP address in nodered (I tried and it didn't work).
A modbus server serves (responds) to a client. For it to do that, it must bind to an existing IP - therefore this IP must be set and accessible from where node-red runs. You cannot simply invent an IP address - the OS where node-red is running needs to "LISTEN" on a specified port number on an actual/virtual Ethernet port
Question - why are you even creating a Modbus server? Do you have master/client devices out in the field that need to initiate a connection to your node-red server instance?
If you are simply trying to connect to modbus devices in the field, they are likely servers/slaves themselves and you simply need to setup a master/client to read from the devices.
In short, a master/client gives orders, the slave/server acts and responds
My project is about creating a modbus server on a RPI 400 to host a modbus table. This modbus table will be accessibleto an automate that will read some part of the table and write on some other part.
This is why I'm creating a modbus server on node-red. The RPI 400 will be the server and the other automate the client.
So here are the step if you want to have RPI as a modbus SERVER:
Run Node-Red on root ( the command line is : sudo node-red )
install node-red-contrib-modbus
drop the modbus server on the flow
go on the terminal and type ifconfig
you will see the ip address of the RPI on the eth0 ( inet XXX.XXX.XXX.XXX ) and the port where it listens to ( mtu X ) note that down and keep it
go back to node-red and put in the modbus server, the IP address and the port you wrote down on step 5 and deploy the flow
Node-Red shouldn't crash and you will be able to access this modbus server from another RPI or other modbus client
PS: The IP address in the modbus server needs to be the same as the one of the RPI, other wise the clients won't be able to access it. So if you want to change the IP address of the modbus server in Node-red, you must first change the ip address of the RPI