Using MQTTX to Simulate Device MQTT Connectivity

The initial integration of MQTT with BioT can be a little complex.
To help you work faster use the following guide to simulate device connection.

One tool that can help locating MQTT communication problems is MQTTX.
This is a free and opensource tool that can simulate MQTT communication between a client and an MQTT broker.
You can download it from here.

To simulate device connection with BioT follow these steps:

  1. On the BioT Manufacturer Portal add a new device.
  2. Expand the newly created device and download the certificate locally to your drive.
  1. Extract the zip file.
  2. Rename the files as follows:
    1. The caCertificate file should have a .crt suffix.
    2. The certificate file should have a .crt suffix.
    3. The private key file should have a .pem suffix.
    4. The connectionDetails file can have a .txt suffix.
  3. Open the MQTTX app and create a new connection.
  1. Configure the connection in the following way:
    1. Name - Give your connection a name that makes it easy to identify.
    2. Client ID - Open the downloaded connection details txt file and copy the value of 'Device client ID'.
    3. Host - Select ‘mqtts://' and copy 'IOT endpoint’ from the connection details txt file.
    4. Port - Enter 8883.
    5. Leave the Username and Password blank.
    6. SSL/TLS - Select ‘true’.
    7. Certificate - Select 'Self-signed'.
    8. SSL Secure - Select 'true'.
    9. Certificates:
      1. CA File - Enter the path to the caCertificate file from the certificate folder.
      2. Client Certificate File - Enter the path to the certificate file from the certificate folder.
      3. Client key file - Enter the path to the private key file from the certificate folder.
  2. Under Advanced: make sure the MQTT Version is 3.1.1.
  3. Click ‘Connect’.
  4. You can now subscribe to topics (in red), send messages to topics (in blue), and view previous messages (in green).


Test connection

Once you manage to connect, one of the easiest ways to test the connection is by "asking" BioT for a JWT token.

Follow the few simple steps in this article to check that you can send and receive MQTT messages from BioT.


Subscribing to the wrong topic

When subscribing to a topic make sure that the client ID and topic name are correct.

Trying to send messages or subscribe to a topic that the device is not permitted to will result in the broker disconnecting the device.