Azure IoT Toolkit supports IoT Hub Module Management (Module Twin, Module Direct Method, Module CRUD)

Jun

September 20th, 2018

Module identity and module twin provides the same capabilities as device identity and device twin but at a finer granularity. This finer granularity enables capable devices, such as operating system based devices or firmware devices managing multiple components, to isolate configuration and conditions for each of those components.

For example, you have a vending machine that has three different sensors. Each sensor is controlled by different departments in your company. You can create a module for each sensor. This way, each department is only able to send jobs or direct methods to the sensor that they control, avoiding conflicts and user errors.

With the v1.4.0 release of Azure IoT Toolkit, it supports module management. You could easily create module, view module twin, update module twin, invoke module direct method and delete module in VS Code.

Create Module

Right-click your device and select Create Module, enter a module ID and the new module will be created in a few seconds.

Edit Module Twin

Right-click your edge module and select Edit Module Twin, edit the module twin, then right-click in the editor and select Update Module Twin to take effect.

Note: Azure IoT Edge system modules are read-only and cannot be modified. Changes can be submitted via deploying a configuration.

Invoke Module Direct Method

Right-click your module and select Invoke Module Direct Method, then enter the method name and payload, results will be shown in OUTPUT > Azure IoT Toolkit view.

Delete Module

Right-click your module and select Delete Module, the selected module will be deleted in a few seconds.

Monitor D2C Message for Module

One more thing! Now you could see the module id when you are monitoring D2C message sent from a module.

If you have any feedback or suggestion, feel free to submit an issue in our GitHub !

Useful Resources: