Subscribing to MQTT Channels
Subscribing to MQTT channels allows you to retrieve data from non-IP subscribers.
Data can be retrieved either for every subscriber associated with your account or on an individual subscriber basis.
This section:
- Explains the channels that are available to subscribe to.
- Explains the requirement to Base64 decode the data received from your subscribers.
- Details the format in which data is received.
MQTT Subscription Channels
Depending on the channels to which you subscribe, data can be retrieved either for every subscriber associated with your account or on an individual subscriber basis.
- To retrieve data from an individual non-IP subscriber, subscribe to:
/lora/<Device EUI>/message
- To retrieve data from all subscribers, subscribe to:
/lora/+/message
Base64 Decoding
Data that is sent and received via the Connectivity Management MQTT broker must be Base64 encoded.
Base64 encoding is used as it minimises the risk of the data causing parsing errors as it traverses the network.
This means that any data you receive from the broker must be Base64 decoded. This can be achieved using an online tool such as Base64Decode.
Sample Data Format
Once you have subscribed to a channel, you will receive data in the following format:
Sample Data |
---|
{ "dev_eui": "7766554433221100", "DevAddr": "aa5757aa", "f_port": 100, "f_cnt_up": 1095, "f_cnt_down": 0, "app_eui": "3031323334353637", "gateway_count": 1, "gateway_info": { "0": { "mac": "575735b2604cbb78", "gw_time": "0001-01-01T00:00:00Z", "gw_timestamp": 2267188052, "frequency": 868.1, "channel": 0, "rf_chain": 1, "crc_status": 1, "modulation": "LORA", "code_rate": "4/5", "rssi": -97, "snr": 9.5, "size": 23, "data_rate": { "LoRa": "SF9BW125", "FSK": 0 } } }, "data": "WW91ciBzdG9tYWNoIHRoaW5rcyBhbGwgcG90YXRvZXMgYXJlIG1hc2hlZC4=" } |
Ground and First Floor
St. Vincent Plaza
319 St. Vincent Street
Glasgow, G2 5LD