Step1 : setup Pilot Things Microsoft integration
- Click on Pilot Things Integrations menu
- Click on : New Forward target
- Select your target : Azure IoT Hub
Common parameters section
- Enter Name and a short description.
- Click on enabled
See example hereunder:
Specific parameters section
- Fill the connection string field (read how below)
- Select either Telemetry or device twin message type
- Enter a positif number on Max retry for example 3 which corresponds of the number of retry Pilot Things does in case the connexion is broken
To get the connection string, connect on your Azure portal:
- Select your ressources group
- Click on Overview
- Click on IOT Hub virtual machine
- Click on Shared access policies
Click on iothubowner policy and copy the Connection string -- primary key and paste on Pilot Things
See example hereunder:
Message format section
By selecting message,thing or product you modify the message thus the properties send to IoT Hub.
Integration final validation
Click on Test connection and save.
The integration is done.
How to stop sending messages?
When you create an integration, Pilot Things creates automatically a scenario which sents all messages to Azure IoT Hub.
If you want to disable the scenario you can uncheck enable in the scenario menu.
If you want to stop sending messages you must uncheck enable in the scenario menu.
Use case with telemetry messages
This use case explains how to harness the integration with telemetry messages.
You need to create a Azure storage account, a routes data, a endpoint and a container.
You can refer to the document to create the different elements : https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-store-data-in-azure-table-storage
Now we will see how to configure route for telemetry integration :
- You need to enter a name of route
- On data source select a Device Messages
- On Endpoint select your endpoint, in this example the name of endpoint is Twins
- In Query string part, you can put a rule like, a parameter, a logical operation and a value.
You can test your route, in test part.
When you route is ready, you can see your data in the container :
Use case data as Device twins
You need to create a azure storage account, a routes data, a endpoint and a container.
You can refer to the document to create the different elements : https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-store-data-in-azure-table-storage
Now we will see how to configure route for device twins integration :
- You need to enter a name of route
- On data source select a Twin Change Events
- On Endpoint select your endpoint, in this example the name of endpoint is Twins
When you route is ready, you can see your data in the container :
Query request :
We can make a query request with query explorer, in first time you can make this request to understand the structure of message :


Additional information
Device twins and telemetry :
https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-d2c-guidance
Module twins in IOT Hub :
https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-module-twins
Microsoft IoT SDK :
Comments
0 comments
Please sign in to leave a comment.