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