Line 148: |
Line 148: |
| | | |
| To test the configuration, '''deploy''' the nodes again and send the message by clicking on the '''inject''' node. | | To test the configuration, '''deploy''' the nodes again and send the message by clicking on the '''inject''' node. |
| + | |
| + | ==Modbus Data to Server via MQTT protocol== |
| + | |
| + | In this section, we are going to upload Modbus data to server on Node-RED. First of all, we are going to need Modbus data source, in this example we are using the same device as Modbus TCP Slave and Master |
| + | |
| + | To start with, navigate to '''Services -> Modbus -> Modbus TCP slave'''. Press '''enable''' to enable the instance and you can leave everything else as '''default''': |
| + | |
| + | [[File:Networking rutos manual modbus modbus tcp slave v2.png|border|800px|class=tlt-border]] |
| + | |
| + | Next, navigate to '''Services -> Modbus -> Modbus TCP master'''. Adjust settings here accordingly: |
| + | |
| + | *Enabled: on |
| + | *Name: Local_slave (input any preferred name) |
| + | *Slave ID: 1 |
| + | *IP address: 127.0.0.1 (since we are using local TCP slave - input the IP address if you are using external device as Modbus Slave) |
| + | *Port: 502 |
| + | |
| + | Add new request and adjust settings according to your needs. For this example, we are going to pull device name from the registers, so our configuration looks like this: |
| + | |
| + | *Name: test (input any preferred name) |
| + | *Data type: ASCII (to get a string of text) |
| + | *Function: Read holding registers (3) |
| + | *First register number: 72 |
| + | *Register count/values: 3 |
| + | *Brackets: use brackets |
| + | *Press enable to enable the Modbus request |
| + | |
| + | [[File:Tcp master nodered.png|border|1000px|class=tlt-border]] |