Changes

no edit summary
Line 107: Line 107:  
[[File:Image4752.png|border|class=tlt-border|961x961px]]  
 
[[File:Image4752.png|border|class=tlt-border|961x961px]]  
   −
=Example: Publishing RUT MODBUS data over MQTT=
+
=Example: Publishing RUT MODBUS to AWS IoT using MQTT=
In this example the RUT device will act as MODBUS TCP Master and MODBUS TCP Slave, so the device will make requests (Master) and answer to himself (Slave). The received reply, will be sent over MQTT.
+
In this example the RUT device will act as MODBUS TCP Master and MODBUS TCP Slave, so the device will make requests (Master) and answer to himself (Slave). The received reply, will be sent over MQTT.  You can also send data from another MODBUS Slave devices connected to the router.
   −
*Bluetooth
+
=== Enabling MODBUS TCP Slave ===
 +
Enabling the MODBUS Slave option on the router allows it to answer any requests coming from a MODBUS Master. To do that, go to the router configuration page->Services->MODBUS-> MODBUS TCP Slave. Then clock the "Enable" slider and save.
 +
 
 +
[[File:Imagehowknows.png]]
 +
 
 +
=== Enabling MODBUS TCP Master ===
 +
Enabling the MODBUS Master option on the router allows it to make specific requests to any slave in the MODBUS network. To do that, go to the router configuration page->Services->MODBUS-> MODBUS TCP Master. Click on the "Add" button, and do the following configuration on the page:
 +
 
 +
[[File:Imagedsadadssa.png]]
 +
 
 +
'''"Name"''' : Any name
 +
 
 +
'''"Slave ID"''' : The slave ID you've set on the slave configuration, by default its 1
 +
 
 +
'''"IP address"''' : The LAN IP address of the router, by default its 192.168.1.1
 +
 
 +
'''"Port"''' : 502
 +
 
 +
'''"Period"''' : 10
 +
 
 +
'''"Timeout"''' : 5
 +
 
 +
Then scroll down the page a bit, on the "Add new request" section, give any name to your request and click on the "Add" button. Then do the following configuration
 +
 
 +
[[File:Imagegpdddd.png]]
 +
 
 +
'''"Data type"''' : Data type of the data you are going to receive, in this case, the router reports its device name using ASCII
 +
 
 +
'''"Function"''' : MODBUS Protocol function, in this case, we are going to Read holding registers
 +
 
 +
'''"First register number"''' : Depends on your MODBUS device, in this case, its 8
 +
 
 +
'''"Register count / Values"''' : Depends on your MODBUS device, in this case, its 10
 +
 
 +
Save and apply settings.
 +
 
 +
=== Configuring Data to Server ===
 +
Go to the router configuration page->Services->Data to server. Click on the "Add" button, and the configuration is basically the same as described on the "Publishing Bluetooth/Wifi scanner/Modbus data" section of this article, just change the data source to "MODBUS data" and format the data as you wish. You should have something similar to this.
 +
 
 +
[[File:Imagedasda.png]]
 +
 
 +
Then, you can use the AWS MQTT test client to check if your setup works, if everything was setup correctly, you should see something like this.
 +
 
 +
[[File:Imagefdsfdsfsd.png]]

Navigation menu