ThingPark offers multiple options to connect to IoT applications: if you chose MQTT as the application to retrieve the data of your devices, this guide is for you!

In this page, we will see point by point how to connect ThingPark to your MQTT broker and how to handle uplinks and downlinks messages.

Connect ThingPark to your MQTT server

To access the creation form of the MQTT application, you need to go to the “Application” menu in ThingPark Community, click on “Create” button that appeared under and finally on MQTT. To link ThingPark to your MQTT broker, you will need to fill all the fields that end with and asterisk as well as either the Username / Password, the Certificate / Private key or both. Here are the explanations and example for each field:

Identity of your application on your IoT network.
Example: MQTT_Application

Content Type:
Two possibilities: JSON enriched document and JSON legacy document.
We recommend the “JSON enriched” option since it will return what the received message corresponds to (uplink, downlink, downlink acknowledgment…). The JSON legacy document option is only here for the sake of backward compatibility

Downlink Port:
The downlink port is the default port which will be used is you do not add any information in the code. It is an integer between 1 and 224 that is useful to define only if the port is present in the uplink.
The syntax for the downlink will have to be the following: “FPort” : 1

The hostname or IP address of your server followed by the port which are either 1883 or 8883 (1883 is the default port for MQTT and 8883 is the port of MQTT over TLS). It will have to follow the syntax hereafter: or IP:port

Account Prefix:
The account prefix allows you to create a “category” in your message broker containing all the messages published by the devices’ you linked to your application.
Example: If we set the account prefix to “actility”,

  • Uplink messages will be published in actility/things/<Device EUI>/uplink
  • Downlink messages actility/things/<Device EUI>/downlink
  • Subscribing to “actility/#” will get you every message that goes through.

Three options are available to accommodate the configuration of your MQTT broker: SSL, WSS and TCP.
Both SSL and WSS require either the certificate (X.509 file in .crt format) and key (PKCS#8 format) to work OR the login and password (it depends on the broker configuration). The TCP only requires username/password.

Username & password:
Those are the identifiers you will need to connect to your MQTT server depending on the protocol you chose to connect with and the broker you picked.

Certificate & private key:
Those are the identifiers you will need to connect to your MQTT server if you either chose SSL or WSS protocol.

Topics allows segmentation of message storage depending on their LoRaWAN®™ port. This field is optional and not recommended for the most common use-cases.

Example: If you put “Geoloc” as the topic name of port 4, your account prefix is “actility” and your device number is “20635F010800167C” for example, to see the uplinks that go through port 4 will have to subscribe to “actility/things/ 20635F010800167C /uplink/Geoloc”

Additional information:
Any detail you want to add to your application that you want to remember. This field is also optional.

Additional resources

For more parameters to put in your queries, you can check the following document: List of parameters