MQTT | Subscribe LoRa Device
Last updated
Last updated
Have MQTT FX software. If you don't have it, please go to the following .
Have an active lora device and send data to the ANTARES Platform.
Make sure you have activated the lora device and have also sent data to the ANTARES Platform. If not, you can follow the
The active LoRa device will send data with an uplink type format and is included with the data, as in the example in the picture
Copy the access key of the account you want to subscribe to.
Open the MQTT FX software. The user interface is shown in the following figure.
Firstly, you need to configure so that you can connect with our MQTT Broker. The configuration is shown below.
When you successfully connect, a green icon will appear on the top right.
Click Subscribe, then run subscribe a topic by following this format:
/oneM2M/resp/antares-cse/your-access-key/choose-a-serialization-format
The choose-a-serialisation-format parameter can have 2 values:
xml
for XML format
json
for JSON format
This step means that you will get a message/notification when there is a change in your account. In this tutorial, we use the MQTT FX tool to subscribe, but in real case scenarios, you can use your application to retrieve data from your LoRa device.
After subscribing to the topic with the correct topic format, you just need to wait until your device sends the data. If the data has been sent, it will appear in the column on the right as shown in the image.
All data in "con" corresponds to the data sent from your device. You can create your own data format on your LoRa device. Congratulations! You have just received your first request using the MQTT API.