Monitoring via MQTT: Difference between revisions
Appearance
No edit summary |
No edit summary |
||
| Line 96: | Line 96: | ||
[[Image:Configuration examples mqtt publisher_new_design.png.png]] | [[Image:Configuration examples mqtt publisher_new_design.png.png]] | ||
<b>NOTE</b>: If you | <b>NOTE</b>: If you configuring a TRB14x devices, it's default hostname is 192.168.2.1. | ||
| Line 109: | Line 109: | ||
==Subscribing and Publishing== | ==Subscribing and Publishing== | ||
Now you can use set up Brokers and Clients on your PC. In order to Publish commands and Subscribe to topics on a RUT | Now you can use set up Brokers and Clients on your PC. In order to Publish commands and Subscribe to topics on a TRB14x devices and RUT routers, you'll need to know the device's '''Serial Number''' and '''TYPE'''. For TRB14x device's you'll need to use '''device''' type and for RUT router's you'll need to use '''router''' type. Router's serial number you can find in the '''Status → Device''' section of the router's WebUI. For TRB14x devices serial number you can find in the '''Status → System''' section of the device WebUI. Or you can subscribe to the topic '''<TYPE>/id''' and publish the message '''id''' to the topic '''<TYPE>/get'''. To do so, enter these commands in separate Terminal windows: | ||
'''Subscribe:''' | '''Subscribe:''' | ||
$ mosquitto_sub -h 192.168.1.1 -p 1833 -u user -P pass -t | $ mosquitto_sub -h 192.168.1.1 -p 1833 -u user -P pass -t <TYPE>/id | ||
'''Publish:''' | '''Publish:''' | ||
$ mosquitto_pub -h 192.168.1.1 -p 1833 -u user -P pass -t | $ mosquitto_pub -h 192.168.1.1 -p 1833 -u user -P pass -t <TYPE>/get -m id | ||
In image below is presented example of how to get RUT router serial number by subscribing and publishing parameter '''id''': | |||
[[Image:Configuration examples mqtt router id v7.png]] | [[Image:Configuration examples mqtt router id v7.png]] | ||