We are here to help

IP Device - MQTT

Introduction

MQTT is a messaging protocol largely used with IoT devices or gateways. More information on MQTT are available here : https://mqtt.org/

MQTT connexion and topics

Pilot Things implements a secured MQTT connexion using SSL/TLS. You will get the connexion informations from Pilot Things.

Pilot Things implements specific topics to communicate :

Topic : sn/ccc/clientID/telemetry

Send device json messages to Pilot Things (MQTT publish)

Topic : sn/ccc/clientID/action

Send Pilot Things to device json messages (MQTT subscribe)

MQTT generic product

You must associate your things with a product for Pilot Things to recognize it.

When using the MQTT generic product model, the JSON received payload is store in a specific measurement named message.

For instance, suppose you publish to /telemetry this JSON value : {"temperature": 10,  "humidity": 10} then you will get a message measure set to {"temperature": 10,  "humidity": 10}.

If you want to convert this message to custom measurements, create a custom model with your measurements name and this code :

function createCustomMeasure(thing, measurements, previousMeasurements, previousCustomMeasurements) {return measurements;}

Example

Step1 : Get your thing's ID in Pilot Things console. You can find the id in the thing's detail page URL.

Id = 7b74389c-8cda-11eb-8dcd-0242ac130003

Step2: Get your certificate and private key from Pilot Things support team

Step3: Send a test message to your thing (replace company with your company name)

MQTT publish to sn/company/7b74389c-8cda-11eb-8dcd-0242ac130003/telemetry

JSON MQTT message : {"temperature": 10,  "humidity": 10}