A series of posts to introduce IoT DevTool:
- For Cloud Developers
- For IoT Hub Device Administrators
- For Device Developers
- For RESTful Developers
Connect to IoT Hub
Before you start you need a device connection string. You can find it from Device Explorer tab in IoT Hub dashboard.
Both connection string with primary key and secondary key are okay.
Then paste the device connection string to IoT DevTool Device, and click connect button.
Send D2C Messages
After connected, you can send D2C messages to cloud in D2C Messages tab.
You can type any text in the box and send the message to cloud. On the cloud, you can run an event hub client to retrieve that message.
Code running on cloud to retrieve D2C messages.
Receive C2D Messages
You can see received C2D messages in C2D Messages tab.
Code running on cloud to send C2D messages.
Listen Direct Methods
Add a direct method listener in Direct Method first, let's say we listen reboot method. When the device receives direct method request, it responds
200 status code.
And when the method is called in cloud, you will see it in the history list. Also, the cloud will get the device response.
Code running on cloud to call direct method.
Get & Update Device Twin
To update reported properties, set the specific property value in JSON format and click send button.
In cloud, you can update desired properties, and the Device tool will update the data in real time.
Code running on cloud to update device twin properties.