GW-UNI-01
User Manual
© 2016 IQ HOME Kft.
www.iqhome.org
10 / 21
2.2.1
MQTT Client Interface configuration
The MQTT client by default uses the
/etc/unid/subscribe.conf
configuration file to describe the
interface communication. The file path can be modified as the
subconf
parameter in the
unid.conf
configuration file. The MQTT parameters also can be modified in the
unid.conf
file described in
section 3.2.
{
"topics":
[
{
// subscribed topic name, %c, %u used for automatic replacement
// of clientId or username
"subscribe": "iqrf/gateway/%c/network/request",
// value 0, 1 or 2, the requested Quality of Service
// for this subscription
"sub_qos": 0
"target": "network",
// default
"message" : "raw",
// default
// set response true if the subscribed topic needs a response
"response": true,
// the response message topic name to publish,
// %c, %u used for automatic replace clientId username
"publish": "iqrf/gateway/%c/network/response",
// value 0, 1 or 2 indicating the Quality of Service
// to be used for the message
"pub_qos": 0,
// if true the broker will keep the message even after
// sending it to all current subscribers
"retain": false
}
]
}
The topic names can handle some automatic replacement. In the unid.conf file the MQTT username
and client ID can be configured (3.2). The client ID can be configured as an automatically filled value
like MID of the IQRF or the MAC address or the NetBIOS name of the gateway. With
%u
the username
and with the
%c
the client ID can be automatically replaced.
For example by default the client ID source set automatic and specified to hwid (MID of the IQRF) the
topics will be as follows:
iqrf/gateway/
%c
/network/request -> iqrf/gateway/
81001122
/network/request
iqrf/gateway/
%c
/network/response -> iqrf/gateway/
81001122
/network/response
Example:
# Request
topic: iqrf/gateway/
81001122
/network/request
message: 00000000FFFF
# Response
topic: iqrf/gateway/
81001122
/network/response
message: 00000080120300000215