Hi guys,

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 :wink: ).

Thanks for the help :+1:

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: —, Class B: — or
Class C: — 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?


  • Can the node-red ping this HIDDEN IP address?
  • What hardware / OS is crashing node-red running on?

Thanks for the fast reply.

  • 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.

  • It crashes on windows and Debian

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.

1 Like

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).

Have you tried the recommended debugging?

If you get in trouble with TCP connections, then check and test with just modbus-serial first, please!

Also, what version of Node-RED and node.js are you using?

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.


You were right I finally was able to debug it.

So here are the step if you want to have RPI as a modbus SERVER:

  1. Run Node-Red on root ( the command line is : sudo node-red )

  2. install node-red-contrib-modbus

  3. drop the modbus server on the flow

  4. go on the terminal and type ifconfig

  5. 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

  6. 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

  7. 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

This is in general a bad idea. The preferred solution is to permit the user running node-red the permissions necessary.

You issue was likely that you were trying to open port 502 which is restricted by the OS


Why is that a bad idea ? (risk with administrator access?)

And yes it was one of the problem :+1:

Exactly. But then it depends on who will have access to the device or how insulated it is.

But lets just say, with node-red running as SUDO, anyone with access to your node-red could literally do anything they want.


Okay I see, thanks for the info :+1:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.