Changes

No change in size ,  12:40, 8 October 2019
no edit summary
Line 132: Line 132:  
'''-t''' specifies the '''topics''' that you subscribe or publish to.
 
'''-t''' specifies the '''topics''' that you subscribe or publish to.
 
   
 
   
Now that we have the using device's serial number we can start publishing messages and receiving responses containing the device's system parameter values. Lets say we want to monitor the device's '''signal strength''' and '''up time''' values. In order to do that we'll need to subscribe to the topics '''<TYPE>/<SERIAL>/signal''' and '''<TYPE>/<SERIAL>/uptime''' using the '''mosquitto_sub''' command. Again, replace the values given in the commands below with the ones in your configuration:
+
Now that we have the using device's serial number we can start publishing messages and receiving responses containing the device's system parameter values. Lets say we want to monitor the device's '''signal strength''' and '''up time''' values. In order to do that we'll need to subscribe to the topics '''router/<SERIAL>/signal''' and '''router/<SERIAL>/uptime''' using the '''mosquitto_sub''' command. Again, replace the values given in the commands below with the ones in your configuration:
    
'''Subscribe:'''
 
'''Subscribe:'''
  $ mosquitto_sub -h 192.168.1.1 -p 1833 -u user -P pass -t <TYPE>/<SERIAL>/signal -t <TYPE>/<SERIAL>/uptime
+
  $ mosquitto_sub -h 192.168.1.1 -p 1833 -u user -P pass -t router/<SERIAL>/signal -t router/<SERIAL>/uptime
    
'''Publish:'''
 
'''Publish:'''
  $ mosquitto_pub -h 192.168.1.1 -p 1833 -u user -P pass -t <TYPE>/get -m signal
+
  $ mosquitto_pub -h 192.168.1.1 -p 1833 -u user -P pass -t router/get -m signal
  $ mosquitto_pub -h 192.168.1.1 -p 1833 -u user -P pass -t <TYPE>/get -m uptime
+
  $ mosquitto_pub -h 192.168.1.1 -p 1833 -u user -P pass -t router/get -m uptime
    
In example below you can see how to subscribe and publish to the topics '''signal strength''' and '''uptime''' on RUT routers:
 
In example below you can see how to subscribe and publish to the topics '''signal strength''' and '''uptime''' on RUT routers:
    
[[File:Configuration examples mqtt subscribe publish v5.png|1150px]]
 
[[File:Configuration examples mqtt subscribe publish v5.png|1150px]]
0

edits

Navigation menu