Changes

1,248 bytes added ,  09:22, 1 December 2017
Line 79: Line 79:  
  $ sudo apt-get install mosquitto mosquitto-clients
 
  $ sudo apt-get install mosquitto mosquitto-clients
   −
Now you can use set up Brokers and Clients on your PC. Continuing from the example above, lets say we want to monitor the router's signal strength value
+
Now you can use set up Brokers and Clients on your PC. Continuing from the example above, lets say we want to monitor the router'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. Open a second Terminal window and enter this command:
 +
 
 +
$ mosquitto_sub -h 192.168.1.1 -p 1833 -u user -P pass -t router/<SERIAL>/signal -t router/<SERIAL>/uptime
 +
 
 +
'''-h''' indicates the host (the Broker's IP address) which, continuing from the example above, is '''192.168.1.1'''. Replace this value with your router's LAN IP address or, if you're using MQTT remotely, your WAN IP address.
 +
 
 +
'''-p''' indicates the port used for connection to the Broker. Replace it with the port number that you specified in the Broker configuration.
 +
 
 +
'''-u''' and '''-P''' specify the username and password. If the Broker doesn't require authentication, these values aren't mandatory. Else replace them with the log in information of your Broker.
 +
 
 +
Lastly, '''-t''' specifies the '''topics''' that you want to subscribe to, in this case it router/<SERIAL>/signal router/<SERIAL>/uptime. Replace '''<SERIAL>''' with your router's serial number. You can find your router's serial number in the '''Status → Device''' section of the router's WebUI. Or you can first subscribe to

Navigation menu