Skip to main content

CREATING AN MQTT BROKER CONNECTION

Creating an Access to MQTT Broker

To interact with the location API, you first need to obtain a bearer token. Follow these steps to acquire the required credentials and connect to your MQTT broker.


Obtain a Bearer Token

  1. Click on the following link: ThingPark Swagger UI.
  2. Click on "Try it out", enter your ThingPark login credentials and execute the request.
  3. In the response body, locate and copy the value of the access_token attribute.

Bearer Token Response


Retrieve Your API Token for the MQTT Broker

Available Platforms:

Note: The platform link you select depends on the environment where you obtained your initial token. For example, if you retrieved a token using PROD EU credentials, you should select the PROD EU link.

Location API

Steps to Follow:

  1. Open the appropriate Swagger UI link based on your platform.
  2. Click the Authorize button to open the authorization window.

Authorize

  1. Paste your bearer token into the value input field and click Authorize.
  2. If the login is successful, you will see a confirmation message similar to the image below:

Login Successful

  1. Navigate to the API Key section, specifically the POST /apiKeys request.

API Key Requests

  1. Click Try it Out and execute the request to generate an API Key.
  2. The response will contain your apiKey, which you can use to authenticate with your MQTT broker. Make sure to note which platform you used (e.g., PROD US) since the broker access will depend on it.

Connect to Your MQTT Broker

Below are the broker URLs and ports for each platform:

EnvironmentBroker URLPort
BROKER ECOmqtt-eco.thingpark.com8883
BROKER PROD EUmqtt-eu.thingpark.com8883
BROKER PROD AUmqtt-au.thingpark.com8883
BROKER PROD USmqtt-us.thingpark.com8883

Authentication Details:

  • Username: You can use any value, but the convention is to use unused_username.
  • Password: Use your apiKey generated in the previous step.

With these details, you should be able to successfully connect to the MQTT broker for your respective platform.

How to Test the MQTT Connection

To ensure your MQTT setup is properly configured, follow these steps carefully:

Download an MQTT Client

Start by downloading and installing an MQTT client. Here are two recommended options:

Retrieve Your Subscription ID

  1. Go on TPE.
  2. Click on your profile icon located in the top-right corner of the interface. profile
  3. Navigate to the Subscription section.
  4. Copy the ID which is the subscribtion ID.

Configure and Test the MQTT Connection

Create a New Connection

  1. Launch your MQTT client.
  2. Create a new connection.
  3. Enter the authentication details provided here.
  4. Enable Encryption in the connection settings.
  5. Use your apiKey that you get before as the password.

Add Connection

warning

Before saving and connecting, you must configure the topic settings.

Configure the Topic Settings

  1. Open the configuration for the connection you just created.
  2. Navigate to the Advanced settings.
  3. Delete all existing topics.
  4. Add a new topic using the following pattern:
    actility-tpe-ope|<SubscriptionId>/mqtt/#
    Replace <SubscriptionId> with your actual Subscription ID.

topic
5. Save the changes by clicking Back.

Finalize the Connection

  1. Save and connect to the broker using the updated configuration.
  2. Test the connection by publishing or subscribing to the topic.
Note

Whenever you publish or subscribe to your topic, always include the following prefix:

actility-tpe-ope|<SubscriptionId>/mqtt/

Limitations

There are currently no known limitations to the MQTT broker.

Troubleshooting

As for now, there are no detected bugs.