Line 63: |
Line 63: |
| Once done, navigate to '''Services -> Modbus -> MQTT Gateway'''. Follow these steps for the configuration: | | Once done, navigate to '''Services -> Modbus -> MQTT Gateway'''. Follow these steps for the configuration: |
| *Enable the instance | | *Enable the instance |
− | *Host: since we are using a local broker on the router – input 127.0.0.1 | + | *'''Host''': since we are using a local broker on the router – input 127.0.0.1 |
| *Leave everything else as default, or adjust according to your needs | | *Leave everything else as default, or adjust according to your needs |
| | | |
Line 80: |
Line 80: |
| In the next screen configure settings accordingly: | | In the next screen configure settings accordingly: |
| | | |
− | *Name: RUT_broker for this example | + | *'''Name''': RUT_broker for this example |
− | *Server: 192.168.10.1 (Router's LAN IP address) | + | *'''Server''': 192.168.10.1 (Router's LAN IP address) |
− | *Port: Default port 1883 | + | *'''Port''': Default port 1883 |
| *Leave everything else as default or adjust to your needs | | *Leave everything else as default or adjust to your needs |
| | | |
Line 88: |
Line 88: |
| ---- | | ---- |
| Now we are going to go back to MQTT-out node configuration and adjust settings as shown below: | | Now we are going to go back to MQTT-out node configuration and adjust settings as shown below: |
− | *Server: RUT_broker | + | *'''Server''': RUT_broker |
− | *Topic: request | + | *'''Topic''': request |
| | | |
| [[File:Mqtt out request node red.png|border|500px|class=tlt-border]] | | [[File:Mqtt out request node red.png|border|500px|class=tlt-border]] |
Line 97: |
Line 97: |
| *'''MQTT-in node''' - configure settings as shown below: | | *'''MQTT-in node''' - configure settings as shown below: |
| | | |
− | *Server: RUT_broker | + | *'''Server''': RUT_broker |
− | *Action: Subscribe to single topic | + | *'''Action''': Subscribe to single topic |
− | *Topic: response | + | *'''Topic''': response |
− | *QoS: 0 | + | *'''QoS''': 0 |
− | *Output: auto-detect | + | *'''Output''': auto-detect |
| | | |
| [[File:Mqtt in response node red.png|border|500px|class=tlt-border]] | | [[File:Mqtt in response node red.png|border|500px|class=tlt-border]] |
Line 161: |
Line 161: |
| Next, navigate to '''Services -> Modbus -> Modbus TCP master'''. Adjust settings here accordingly: | | Next, navigate to '''Services -> Modbus -> Modbus TCP master'''. Adjust settings here accordingly: |
| | | |
− | *Enabled: on | + | *'''Enabled''': on |
− | *Name: Local_slave (input any preferred name) | + | *'''Name''': Local_slave (input any preferred name) |
− | *Slave ID: 1 | + | *'''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) | + | *'''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 | + | *'''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: | | 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) | + | *'''Name''': test (input any preferred name) |
− | *Data type: ASCII (to get a string of text) | + | *'''Data type''': ASCII (to get a string of text) |
− | *Function: Read holding registers (3) | + | *'''Function''': Read holding registers (3) |
− | *First register number: 72 | + | *'''First register number''': 72 |
− | *Register count/values: 3 | + | *'''Register count/values''': 3 |
− | *Brackets: use brackets | + | *'''Brackets''': use brackets |
| *Press enable to enable the Modbus request | | *Press enable to enable the Modbus request |
| | | |
Line 183: |
Line 183: |
| To finish up the device configuration, navigate to '''Services -> Data to server.''' Add new data sender and configure settings accordingly: | | To finish up the device configuration, navigate to '''Services -> Data to server.''' Add new data sender and configure settings accordingly: |
| | | |
− | *Enable: on | + | *'''Enable''': on |
− | *Name: Data_to_node (input any preferred name) | + | *'''Name''': Data_to_node (input any preferred name) |
− | *Data source: MODBUS data | + | *'''Data source''': MODBUS data |
− | *Protocol: MQTT | + | *'''Protocol''': MQTT |
− | *JSON format: {"Router name": %a} - adjust this according to your needs | + | *'''JSON format''': {"Router name": %a} - adjust this according to your needs |
− | *Segment count: All | + | *'''Segment count''': All |
− | *URL/Host/Connection string: 192.168.10.139 (virtual machine address) | + | *'''URL/Host/Connection string''': 192.168.10.139 (virtual machine address) |
− | *Port: 1883 | + | *'''Port''': 1883 |
− | *Keepalive:60 | + | *'''Keepalive''': 60 |
− | *Topic: rutx (input any preffered topic, make sure to subscribe on the same topic) | + | *'''Topic''': rutx (input any preffered topic, make sure to subscribe on the same topic) |
| | | |
| [[File:Data sender settings to node red with node red broker.png|border|1000px|class=tlt-border]] | | [[File:Data sender settings to node red with node red broker.png|border|1000px|class=tlt-border]] |