Line 7: |
Line 7: |
| | | |
| ==How MQTT works== | | ==How MQTT works== |
− | In general an MQTT connection takes place between two Clients and a Broker. A TRB device and RUT/TCR router can be Broker, Client or both. The MQTT Publisher(Client) present in TRB devices and RUT/TCR routers subscribes to two topics by default: '''<TYPE>/get''' and '''get/<SERIAL>/command'''. Where '''<TYPE>''' is device type, for RUT/TCR routers and TRB2 devices type is '''router''' and for TRB1 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: | + | In general an MQTT connection takes place between two Clients and a Broker. A TRB device and RUT/TCR router can be Broker, Client or both. The MQTT Publisher(Client) present in TRB devices and RUT/TCR routers subscribes to two topics by default: '''<TYPE>/get''' and '''get/<SERIAL>/command'''. Where '''<TYPE>''' is device type, for RUT/TCR routers type is '''router''' and for TRB 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 13: |
Line 13: |
| ! style="width: 250px; background: black; color: white;" | Parameter name | | ! style="width: 250px; background: black; color: white;" | Parameter name |
| ! style="width: 400px; background: black; color: white;" | Parameter description | | ! style="width: 400px; background: black; color: white;" | Parameter description |
− | ! style="width: 250px; background: black; color: white;" | Supported devices | + | ! style="width: 300; background: black; color: white;" | Supported devices |
| | | |
| + | |- |
| + | ! style="text-align: left; vertical-align: top;" | id |
| + | | style="text-align: left; vertical-align: top;" | Modem IMEI |
| + | | style="text-align: left; vertical-align: top;" | RUT2, RUT9, RUTX, RUT3, TCR1, TRB2 |
| |- | | |- |
| ! style="text-align: left; vertical-align: top;" | temperature | | ! style="text-align: left; vertical-align: top;" | temperature |
Line 54: |
Line 58: |
| ! style="text-align: left; vertical-align: top;" | digital2 | | ! style="text-align: left; vertical-align: top;" | digital2 |
| | style="text-align: left; vertical-align: top;" | Value of digital input no. 2 | | | style="text-align: left; vertical-align: top;" | Value of digital input no. 2 |
− | | style="text-align: left; vertical-align: top;" | RUT9 | + | | style="text-align: left; vertical-align: top;" | RUT9, TRB1 |
| |- | | |- |
| ! style="text-align: left; vertical-align: top;" | analog | | ! style="text-align: left; vertical-align: top;" | analog |
Line 131: |
Line 135: |
| In image below is presented example of how to get RUT router serial number: | | In image below is presented example of how to get RUT router serial number: |
| | | |
− | [[Image:Configuration examples mqtt router id v7.png|border|class=tlt-border]] | + | [[File:Configuration examples mqtt router id new 1.png|border|class=tlt-border]] |
| | | |
| | | |
Line 155: |
Line 159: |
| In example below you can see how to subscribe and publish to the topics '''signal strength''' and '''uptime''' on RUT/TCR routers: | | In example below you can see how to subscribe and publish to the topics '''signal strength''' and '''uptime''' on RUT/TCR routers: |
| | | |
− | [[File:Configuration examples mqtt subscribe publish v5.png|1150px]] | + | [[File:Configuration examples mqtt subscribe publish new 2.png|1100px|border|class=tlt-border]] |
| + | |
| + | ==External links== |
| + | https://mosquitto.org/ - Eclipse Mosquitto official website |
| + | |
| + | [[Category:Router control and monitoring]] |