I want the node red Modbus client to listen on port . Once my Modbus device is powered up, it should automatically connect to the node red Modbus client using the node red IP address and the port. After the device is connected, the Modbus client will start reading the holding registers.
Colin You are right Server will listen on port. but for us we have application where client has to listen on port. And out Modbus Gateway which Server will connect to that Client based on Client ip and Port no.
So Do we have Modbus Client in node red which can listen on Port ?
Application has some changes in network, due to which we have to follow this method.
We have Node-RED running on a public IP: 23.213.131.13. On this Node-RED instance, we have a Modbus client that needs to read data from a Modbus device.
However, our Modbus device has internet connectivity but does not have a public IP.
Currently, our Modbus client (Node-RED) is unable to connect to the Modbus device because the device lacks a public IP. To solve this problem, we would like to reverse the connection method. Since our client (Node-RED) has a public IP and our Modbus master (device) has internet access, we want to configure the client (Node-RED) to listen on a specific port. The Modbus master (device) will then initiate the connection to the client, allowing Node-RED to pull data from the device.
Well you can't make the modbus client node do that. However you could use one of many methods to tell node red to start the comms.
You could use MQTT, http, ssh, any of a number of techniques. If you don't know how to do that then you should not be doing it as there are many security issues.
Have you considered using something like Tailscale to connect the machines?