Skip to content

2. LWMQN Channels: Topics and Messages

simen edited this page Aug 25, 2016 · 4 revisions

What is LWMQN Channels

LWMQN is equipped with several channels to implement the LWM2M interfaces based on MQTT pub/sub approach. These channels are simply MQTT topics, and such special topics are named as channels to distinguish from generic topics. The LWMQN Client/Server messaging is based on these channels.


Under the Hood

  1. Special Topics for LWMQN Channels
  2. Message through the Channel
  3. Data Type Summary of Messages


1. Special Topics for LWMQN Channels

Channel Client Pub / Server Sub Client Sub / Server Pub
register register/${clientId} register/response/${clientId}
deregister deregister/${clientId} deregister/response/${clientId}
update update/${clientId} update/response/${clientId}
shcedule shcedule/${clientId} shcedule/response/${clientId}
ping ping/${clientId} ping/response/${clientId}
announce - announce
request - request/${clientId}
response response/${clientId} -
notify notify/${clientId} notify/response/${clientId}

************************************************* ### 2. Message through the Channel
Channel Client Pub Server Pub
register { transId, lifetime, ip, mac, version, objList } { transId, status }
deregister { transId } { transId, status }
update { transId, lifetime, ip, version, objList } { transId, status }
shcedule { transId, sleep, duration } { transId, status }
ping { transId } { transId, status }
announce - Any thing can be serialized which depends on implementation
request - { transId, cmdId, oid, iid, rid, data }
response { transId, cmdId, status, data } -
notify { transId, oid, iid, rid, data } { transId, status }


3. Data Type Summary of Messages

Property Data Type Description
transId Number A numeric id for each transaction, e.g., 102
lifetime Number Lifetime of the device. If no message comes from the device within lifetime seconds, the server will deregister this device from the network, e.g., 6000 (secs)
ip String Device ip address, e.g., '192.168.1.60'
mac String Device mac address, e.g., 'd8:fe:e3:e5:9f:3b'
version String LWMQN version, e.g., '0.0.1'
objList Object IPSO Objects and Object Instances live in the client. Each property in objList is an oid: [ iid, ... ] pair, e.g., { 3301: [ 0 ], 3302: [ 6 ], 3303: [ 0, 1, 18 ] }
sleep Boolean To tell server that this client is going to sleep (true) or waking up from sleep (false)
duration Number When a client is going to sleep, it can tell the server of how many seconds from now that this client will check in again
cmdId Number Command id, can be 0(read), 1(write), 2(discover), 3(writeAttrs), 4(execute), 5(observe), 6(notify), and 7(ping)
status Number Status code
oid Number | String Object Id, a numeric id is preferable for IPSO-deifned Object, e.g., 3303 for a temperature sensor. A string id is also accepted if the Object is not an IPSO-defined one
iid Number | String Object Instance Id, a numeric id is preferable but a string is also accepted
rid Number | String Resource Id, a numeric id is preferable for IPSO-deifned Resource, e.g., 5700 for a sensor value. A string is also accepted if the Resource is not an IPSO-defined one
data Depends Payload per request