137
Check if data connection is available
Get system uptime in seconds
Get value of digital input no. 1
Get value of digital input no. 2
Get value of analog input
In order system to work, MQTT broker should be configured in advance. You can use the broker, which is installed inside
the router, or the broker in the other location. The publisher operates according to the scheme presented below. In the
scheme the client tries to subscribe information about router’s uptime. To achieve this multiple commands between
client and publisher are being sent.
In general publisher works in such a way: connects to the broker and subscribes to the topics router/get and
get/<SERIAL>/command, there <SERIAL> denotes serial number of the router which is currently run publisher. The client
then sends message id to the topic router/get. The following message is received by the publisher, since it is subscribed
to that topic. Then the publisher sends response with its serial number to the topic router/id. Now the client knows that
publisher with some serial number exist. It means, that client can send message with parameter name from the list as a
message to the topic get/<SERIAL>/command to the broker. The message will be received only by the subscriber, which
has the same SERIAL number mentioned in the topic. Now the publisher can send back a response with
router/<SERIAL>/parameter_name topic and message with a value of requested parameter. It should be noted, that
according to MQTT protocol, the topic names are case-sensitive, for example topic router is not the same as topic
RoUtEr.
Subscribe router/get
Subscribe
get/01234567/command
Publish router/id
01234567
Publish get/01234567/command
uptime
Publish router/01234567/uptime 15248