Line 1: |
Line 1: |
− | Router monitoring via MQTT Linux guide applies to TRB14x gateway and to RUT9xx, RUTX routers. | + | Router monitoring via MQTT Linux guide applies to TRB14x devices and to RUT9xx, RUTX routers. |
| ==Introduction== | | ==Introduction== |
| | | |
| '''MQTT (MQ Telemetry Transport or Message Queue Telemetry Transport)''' is an ISO standard (ISO/IEC PRF 20922) publish-subscribe-based messaging protocol. It works on top of the TCP/IP protocol. It is designed for connections with remote locations where a "small code footprint" is required or the network bandwidth is limited. The publish-subscribe messaging pattern requires a message broker. | | '''MQTT (MQ Telemetry Transport or Message Queue Telemetry Transport)''' is an ISO standard (ISO/IEC PRF 20922) publish-subscribe-based messaging protocol. It works on top of the TCP/IP protocol. It is designed for connections with remote locations where a "small code footprint" is required or the network bandwidth is limited. The publish-subscribe messaging pattern requires a message broker. |
| | | |
− | This article provides a guide on how to configure and use a basic MQTT setup on TRB14x gateway and on RUT9xx, RUTX routers. | + | This article provides a guide on how to configure and use a basic MQTT setup on TRB14x devices and on RUT9xx, RUTX routers. |
| | | |
| ==How MQTT works== | | ==How MQTT works== |
− | In general an MQTT connection takes place between two Clients and a Broker. A TRB14x gateways and RUT routers can be Broker, Client or both. The MQTT Publisher(Client) present in TRB14x and RUT routers subscribes to two topics by default: '''<TYPE>/get''' and '''get/<SERIAL>/command'''. Where '''<TYPE>''' is device type, for RUT routers type is '''router''' and for TRB14x gateways type is '''device'''. Parameter '''<SERIAL>''' is the router's serial number. When a third party client connects to the Broker, it sends the message '''id''' to the the topic '''<TYPE>/get'''. The publisher then sends a response containing its serial number to the topic '''<TYPE>/id'''. Now that the Client knows the router's or gateway's serial number it can ask for values of various parameters by sending requests to the topic '''<TYPE>/<SERIAL>/parameter_name'''. The MQTT Publisher can send responses containing values of these system parameters, if device supports that parameter: | + | In general an MQTT connection takes place between two Clients and a Broker. A TRB14x devices and RUT routers can be Broker, Client or both. The MQTT Publisher(Client) present in TRB14x devices and RUT routers subscribes to two topics by default: '''<TYPE>/get''' and '''get/<SERIAL>/command'''. Where '''<TYPE>''' is device type, for RUT routers type is '''router''' and for TRB14x devices type is '''device'''. Parameter '''<SERIAL>''' is the router's serial number. When a third party client connects to the Broker, it sends the message '''id''' to the the topic '''<TYPE>/get'''. The publisher then sends a response containing its serial number to the topic '''<TYPE>/id'''. Now that the Client knows the router's or device's serial number it can ask for values of various parameters by sending requests to the topic '''<TYPE>/<SERIAL>/parameter_name'''. The MQTT Publisher can send responses containing values of these system parameters, if device supports that parameter: |
| | | |
| {| class="wikitable" | | {| class="wikitable" |
Line 71: |
Line 71: |
| ==Configuring the router== | | ==Configuring the router== |
| | | |
− | This section will provide an explanation on how to configure an MQTT Broker and MQTT Publisher on a TRB14x gateways and on RUT routers. | + | This section will provide an explanation on how to configure an MQTT Broker and MQTT Publisher on a TRB14x devices and on RUT routers. |
| | | |
| ===Broker=== | | ===Broker=== |
Line 80: |
Line 80: |
| | | |
| | | |
− | Configuration for a TRB14x gateways and a RUTX routers looks like this: | + | Configuration for a TRB14x devices and a RUTX routers looks like this: |
| | | |
| [[Image:Configuration_examples_publisher_new_design.png]] | | [[Image:Configuration_examples_publisher_new_design.png]] |