Connect to the TilliT Broker
Last updated
Last updated
MQTT works by using a subscribe/publish model. In this model, a broker acts as the one destination that all clients connect to. This article will describe how you will be able to connect to the TilliT Broker securely.
MQTT communicates on port 8883. Firewalls will generally block this port by default. Contact your IT services and confirm the port is open before attempting a connection.
All TilliT MQTT connections are secured by a X.509 certificate authentication method. You can only recieve these certificates by first contacting TilliT Support. You will be issued a private key file, certificate file and root authority file that acts to authenticate and secure your connection. Place these files in a secure location that is accessible by your MQTT client software.
Once you have the above authentication, use the broker endpoint iot.tillit.cloud
to connect to the MQTT Broker on port 8883. Depending on your client. you may need to define the endpoint as ssl://iot.tillit.cloud:8883
(see Ignition). Once connected, you will be able to do the following two things to confirm.
1. Subscribe to the topic /tenant
(replace tenant with yours)
2. Publish a message to the topic you subscribed to above. You should receive the message
You can get get up and running quickly with the MQTTx GUI client - https://mqttx.app/
Follow the following settings as an example. NOTE: ensure you have MQTT v3.1.1 selected and port 8883 is allowed through the firewall
Copy the following contents into a file called mqtt.js
and install the dependancies with npm install mqtt
. Run with node mqtt.js
.
You should see the following output.
If you want to subscribe to anything in a level, then you can use the character +
like so: