Difference between revisions of "TRB142 MQTT"

From Teltonika Networks Wiki
(Created page with "==Summary== '''MQTT (MQ Telemetry Transport or Message Queue Telemetry Transport)''' is an ISO standard (ISO/IEC PRF 20922) publish-subscribe-based "lightweight" messaging pr...")
 
(Replaced content with "{{Template: Networking trb manual mqtt | name = TRB142 }}")
Line 1: Line 1:
==Summary==
+
{{Template: Networking trb manual mqtt
 
+
| name                 = TRB142
'''MQTT (MQ Telemetry Transport or Message Queue Telemetry Transport)''' is an ISO standard (ISO/IEC PRF 20922) publish-subscribe-based "lightweight" messaging protocol for use on top of the TCP/IP protocol. It is designed to send short messages from one client ('''publisher''') to another ('''subscriber''') through '''brokers''', which are responsible for message delivery to the end point. TRB routers support this functionality via an open source Mosquitto broker. The messages are sent this way: a client ('''subscriber''') subscribes to a topic(s); a publisher posts a message to that specific topic(s). The '''broker''' then checks who is subscribed to that particular topic(s) and transmits data from the publisher to the subscriber. This chapter is a summary of the MQTT function in TRB routers.
+
}}
 
 
==MQTT Broker==
 
 
 
The '''Broker''' will “listen” for connections on the specified Local port. In order to accept connections from WAN, you also need to check Enable Remote Access.
 
 
 
[[Image:Networking trb manual mqtt broker settings v1.png]]
 
 
 
<table class="nd-mantable">
 
    <tr>
 
        <th>field name</th>
 
      <th>value</th>
 
      <th>description</th>
 
    </tr>
 
    <tr>
 
      <td>Enable</td>
 
      <td>off | on; Default: '''off'''</td>
 
      <td>Toggles MQTT Broker ON or OFF</td>
 
    </tr>
 
    <tr>
 
      <td>Local Port</td>
 
      <td>integer [0..65535]; Default: "<b>1883</b>"</td>
 
      <td>Specifies the local port that the MQTT broker will listen to</td>
 
    </tr>
 
    <tr>
 
    <td>Enable Remote Access</td>
 
        <td>off | on; Default: '''off'''</td>
 
        <td>If enabled, MQTT Broker will be reachable by remote user (from WAN)</td>
 
    </tr>
 
</table>
 
 
 
===Security===
 
----
 
The MQTT '''Security''' tab is used to establish MQTT connection security via TLS/SSL.
 
 
 
[[Image:Networking trb manual mqtt broker security settings v1.png]]
 
 
 
<table class="nd-mantable">
 
    <tr>
 
        <th>field name</th>
 
      <th>value</th>
 
      <th>description</th>
 
    </tr>
 
    <tr>
 
      <td>Use TLS/SSL</td>
 
      <td>off | on; Default: '''off'''
 
</td>
 
      <td>Toggles the use of TLS/SSL certificates ON or OFF</td>
 
    </tr>
 
    <tr>
 
      <td>CA File</td>
 
      <td>.ca file; Default: " "</td>
 
      <td>'''Certificate authority''' is an entity that issues digital certificates. A digital certificate certifies the ownership of a public key by the named subject of the certificate</td>
 
    </tr>
 
    <tr>
 
    <td>CERT File</td>
 
        <td>.crt file; Default: " "</td>
 
        <td>Certificate file is a type of digital certificate that is used by client systems to make authenticated requests to a remote server. Client certificates play a key role in many mutual authentication designs, providing strong assurances of a requester's identity</td>
 
    </tr>
 
    <tr>
 
    <td>Key File</td>
 
        <td>.key file; Default: " "</td>
 
        <td>Specifies the local port that the MQTT broker will listen to</td>
 
    </tr>
 
    <tr>
 
    <td>TLS version</td>
 
        <td>tlsv1 | tlsv1.1 | tlsv1.2 | Support all; Default: '''Support all'''</td>
 
        <td>Authenticates a client to a server and establishes precisely who they are</td>
 
    </tr>
 
</table>
 
 
 
===Bridge===
 
----
 
The MQTT Broker also supports a functionality called '''Bridge'''. An MQTT Bridge is used for the communication between two MQTT Brokers. The window of Bridge parameters is presented below. Some of these are mandatory as they are needed to create a connection: Connection Name, Remote Address and Remote Port. For more information on '''MQTT Bridge''' parameters you can read the official mosquitto.conf manual page.
 
 
 
[[Image:Networking trb manual mqtt broker bridge settings v1.png]]
 
 
 
<table class="nd-mantable">
 
    <tr>
 
        <th>field name</th>
 
      <th>value</th>
 
      <th>description</th>
 
    </tr><tr><td>Enable</td><td>off | on; Default: '''off'''
 
</td><td>Toggles MQTT Bridge ON or OFF</td></tr><tr>
 
      <td>Connection Name</td>
 
      <td>string; Default: " "</td>
 
      <td>Name of the Bridge connection. Although this is used for easier management purposes, this field is mandatory</td>
 
    </tr>
 
    <tr>
 
    <td>Remote Address</td>
 
        <td>ip; Default: " "</td>
 
        <td>Remote Broker’s address</td>
 
    </tr>
 
    <tr>
 
    <td>Remote Port</td>
 
        <td>integer [0..65535]; Default: '''1883'''</td>
 
        <td>Specifies which port the remote broker uses to listen for connections</td>
 
    </tr>
 
    <tr>
 
      <td>Use Remote TLS/SSL</td>
 
      <td>off | on; Default: '''off'''</td>
 
      <td>Enables the use of TSL/SSL certificates of the remote broker. If this is checked, you will be prompted to upload TLS/SSL certificates. More information can be found in the [[#Security|Security]] section of this chapter</td>
 
    </tr>
 
    <tr>
 
      <td>Use Remote Bridge Login</td>
 
      <td>off | on; Default: '''off'''</td>
 
      <td>Enables the use of Remote login data. If this is checked, you will be prompted to enter a remote client ID, username and password</td>
 
    </tr>
 
    <tr>
 
    <td>Try Private</td>
 
        <td>off | on; Default: '''off'''</td>
 
        <td>Check if the remote Broker is another instance of a daemon</td>
 
    </tr>
 
    <tr>
 
    <td>Clean Session</td>
 
        <td>off | on; Default: '''off'''</td>
 
        <td>Check to discard session state after connecting or disconnecting</td>
 
    </tr><tr>
 
    <td>Topic</td>
 
        <td>string; Default: " "</td>
 
        <td>Specifies the names of the Topics that your Broker will subscribe to</td>
 
    </tr><tr><td>Direction</td><td>OUT | IN| BOTH; Default: '''OUT'''
 
</td><td>The direction that the messages will be shared in
 
</td></tr><tr><td>QoS Level</td><td>At most once (0) |At least once (1) | Exactly once (2); Default: '''At most once (0)'''</td><td>The publish/subscribe QoS level used for this topic
 
</td></tr></table><br />
 
===Miscellaneous===
 
----
 
The last section of MQTT Broker parameters is called '''Miscellaneous'''. It contains parameters that are related to neither Security nor Bridge.
 
 
 
[[Image:Networking trb manual mqtt broker miscellaneous settings v1.png]]
 
 
 
<table class="nd-mantable">
 
    <tr>
 
        <th>field name</th>
 
      <th>value</th>
 
      <th>description</th>
 
    </tr>
 
    <tr>
 
      <td>ACL File</td>
 
      <td>ACL file; Default: " "</td>
 
      <td>The contents of this file are used to control client access to topics of the broker</td>
 
    </tr>
 
    <tr>
 
      <td>Password File</td>
 
      <td>password file; Default: " "</td>
 
      <td>The Password file stores user names and corresponding passwords, used for authentication</td>
 
    </tr>
 
    <tr>
 
    <td>Persistence</td>
 
        <td>off | on; Default: '''off'''</td>
 
        <td>If enabled, connection, subscription and message data will be written to the disk. Otherwise, the data is stored in the router’s memory only</td>
 
    </tr>
 
    <tr>
 
    <td>Allow Anonymous</td>
 
        <td>off | on; Default: '''off'''</td>
 
        <td>If enabled, the Broker allows anonymous access</td>
 
    </tr>
 
</table>
 
 
 
==MQTT Publisher==
 
 
 
An '''MQTT Publisher''' is a client that sends messages to the Broker, who then forwards these messages to the Subscriber.
 
 
 
[[Image:Networking trb manual mqtt publisher settings v1.png]]
 
 
 
<table class="nd-mantable">
 
    <tr>
 
        <th>field name</th>
 
      <th>value</th>
 
      <th>description</th>
 
    </tr>
 
    <tr>
 
      <td>Enable</td>
 
      <td>off | on; Default: '''off'''</td>
 
      <td>Toggles the MQTT Publisher ON or OFF</td>
 
    </tr>
 
    <tr>
 
      <td>Hostname</td>
 
      <td>host | ip; Default: " "</td>
 
      <td>Broker’s IP address or hostname</td>
 
    </tr>
 
    <tr>
 
    <td>Port</td>
 
        <td>integer [0..65535]; Default: '''1883'''</td>
 
        <td>Specifies the port used for connecting to the Broker</td>
 
    </tr>
 
    <tr>
 
    <td>Username</td>
 
        <td>string; Default: " "</td>
 
        <td>User name used for authentication when connecting to the Broker</td>
 
    </tr>
 
    <tr>
 
    <td>Password</td>
 
        <td>string; Default: " "</td>
 
        <td>Password used for authentication when connecting to the Broker</td>
 
    </tr>
 
</table>
 
 
 
[[Category:TRB142 WebUI]]
 

Revision as of 15:21, 25 November 2019

Main Page > TRB Gateways > TRB142 > TRB142 Manual > TRB142 WebUI > TRB142 Services section > TRB142 MQTT