Changes

3,611 bytes added ,  15:15, 2 August 2023
no edit summary
Line 1: Line 1:  +
[[File:Networking_rutos_configuration_examples_openremote_logo.png|right]]
 
=Introduction=
 
=Introduction=
In this article you will find instructions on how to setup OpenRemote Manager as a MQTT Broker and how to setup a RUT router as a MQTT Publisher and send data over to this OpenRemote Broker.
     −
With that, you will be able to configure any other device as a MQTT Subscriber, and listen to any published info by the router or other devices on this same broker.
+
OpenRemote an intuitive user-friendly 100% open source IoT platform. You can build a complete IoT device management solution including: device management and auto provisioning, customisation of asset types, automation via when-then, flow, javascript and groovy rules, data analytics, connectivity via several protocol agents and manager APIs (e.g. MQTT broker, HTTP/REST, WS), Multi-tenancy (realms), Users and roles management, Edge gateway, Front-end UI web components and consoles, and an Insights dashboard builder.
 +
 
 +
In this article you will find instructions on how to setup OpenRemote Manager as a MQTT Broker and how to send telemetry data using Teltonika device to the OpenRemote platform.
    
=Prerequisites=
 
=Prerequisites=
Line 73: Line 75:  
If you need any help on setting up each functionality, the Teltonika Wiki has topics for each one of them: [[RUTX11 Bluetooth|Bluetooth]], [[RUTX11 Wireless|WiFi Scanner]], [[RUTX11 Modbus|MODBUS]]
 
If you need any help on setting up each functionality, the Teltonika Wiki has topics for each one of them: [[RUTX11 Bluetooth|Bluetooth]], [[RUTX11 Wireless|WiFi Scanner]], [[RUTX11 Modbus|MODBUS]]
   −
===Example: Publishing RUT MODBUS to OpenRemote manager using MQTT===
+
===First example: Publishing RUT MODBUS to OpenRemote manager using MQTT===
 +
[[File:Networking_rutos_configuration_examples_openremote_020_v2.png|border|center|class=tlt-border]]
 +
 
 
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.
 
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.
   Line 141: Line 145:  
'''"Password"''' : The secret generated for the MQTT service user (you can find it on the <code>mqtt_user</code> Users page)
 
'''"Password"''' : The secret generated for the MQTT service user (you can find it on the <code>mqtt_user</code> Users page)
   −
===Checking if it works===
+
====Checking if it works====
 
Then, you can open the "OpenRemote" system to check if your setup works, if everything was setup correctly, you should see the values update in attributes section. In the example we could see that the data "Slave name - %N and registry data (JSON object) - %a" is being updated.
 
Then, you can open the "OpenRemote" system to check if your setup works, if everything was setup correctly, you should see the values update in attributes section. In the example we could see that the data "Slave name - %N and registry data (JSON object) - %a" is being updated.
    
[[File:Networking_rutos_configuration_examples_openremote_014.png|border|class=tlt-border]]
 
[[File:Networking_rutos_configuration_examples_openremote_014.png|border|class=tlt-border]]
 +
 +
===Second example: Publishing Bluetooth data (from Eye Sensor) to OpenRemote manager using MQTT===
 +
[[File:Networking_rutos_configuration_examples_openremote_019_v1.png|border|center|class=tlt-border]]
 +
 +
In this example the RUT device will collect [[RUTX11 Bluetooth|Bluetooth]] data from [https://teltonika-gps.com/products/accessories/sensors-beacons/eye EYE Sensor]. The received data will be sent over MQTT to OpenRemote manager.
 +
 +
====Enabling Bluetooth service====
 +
Enabling the [[RUTX11 Bluetooth|Bluetooth]] service on the router allows it to pair Bluetooth device and collect data from it. To do that, go to the router configuration page→Services→Bluetooth. Then click the "Enable" slider and click on the "Scan" button:
 +
 +
[[File:Networking_rutos_configuration_examples_openremote_015.png|border|class=tlt-border]]
 +
 +
Select device and pair it:
 +
 +
[[File:Networking_rutos_configuration_examples_openremote_016.png|border|class=tlt-border]]
 +
 +
====Configuring Data to Server====
 +
Go to the router configuration page→Services→[https://wiki.teltonika-networks.com/view/Data_to_Server 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 "Bluetooth data" and format the data as you wish. You should have something similar to this.
 +
 +
[[File:Networking_rutos_configuration_examples_openremote_017.png|border|class=tlt-border]]
 +
 +
'''"Name"''' : Any name
 +
 +
'''"Data source"''' : Bluetooth data
 +
 +
'''"Protocol"''' : MQTT
 +
 +
'''"JSON format"''' : In this case was used - %b
 +
 +
'''"Segment count"''' : 1
 +
 +
'''"Send as object"''' : Enable
 +
 +
'''"URL / Host / Connection string"''' : Host IP of your OpenRemote system
 +
 +
'''"Topic"''' : Define the correct topic. For directly writing an attribute value: {realm}/{clientID}/writeattributevalue/{attributeName}/{assetID}. So in our case this will be <code>master/client123/writeattributevalue/writeAttribute/79hl5XRczN4mjIaQWIMazv</code>
 +
 +
'''"Client ID"''' : Use the client ID that is used in the Topic field
 +
 +
'''"Period"''' : Data sending frequency (in seconds)
 +
 +
'''"Use credentials"''' : Enable
 +
 +
'''"Username"''' : <code>master:mqtt_user</code>  ({realm}:{user})
 +
 +
'''"Password"''' : The secret generated for the MQTT service user (you can find it on the <code>mqtt_user</code> Users page)
 +
 +
====Checking if it works====
 +
Then, you can open the "OpenRemote" system to check if your setup works, if everything was setup correctly, you should see the values update in attributes section. In the example we could see that the data from bluetooth device [https://teltonika-gps.com/products/accessories/sensors-beacons/eye EYE Sensor] "Device data (JSON object) - %b" is being updated.
 +
 +
[[File:Networking_rutos_configuration_examples_openremote_018.png|border|class=tlt-border]]
 +
 +
=References to OpenRemote=
 +
# https://openremote.io/
 +
# https://github.com/openremote/openremote#readme
 +
# https://github.com/openremote/openremote/wiki
 +
# Forum https://forum.openremote.io/
 +
[[Category:Third party services]]