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

Jun Han

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.

clip_image002

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.

edit module twin

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.

invoke

Delete Module

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

delete device

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.

delete device

 

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

Useful Resources:

0 comments

Discussion is closed.

Feedback usabilla icon