MQTT | Subscribe LoRa Device

Prerequisites

  1. Have MQTT FX software. If you don't have it, please go to the following link MQTT FX.

  2. Have an active lora device and send data to the ANTARES Platform.

Follow These Steps

  1. Make sure you have activated the lora device and have also sent data to the ANTARES Platform. If not, you can follow the LoRa Tutorial

  2. 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

  3. Copy the access key of the account you want to subscribe to.

  4. Open the MQTT FX software. The user interface is shown in the following figure.

  5. Firstly, you need to configure so that you can connect with our MQTT Broker. The configuration is shown below.

  6. When you successfully connect, a green icon will appear on the top right.

  1. 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.

  2. 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.

Last updated