The device management pattern samples support the following device management tutorials, which provide both the device and service side code ready to execute.
To learn more about Azure IoT Hub device management, see Overview of Azure IoT Hub device management.
From the root directory of the repository, run through the following steps to see the device and service interacting to enable the device management patterns:
-
Start the device side first, as it will register the C2D method listener for reboot:
node device\samples\dmpatterns_reboot_device.js <IotHub device connection string>
-
In a new terminal window, start the service side to initate the reboot:
node service\samples\dmpatterns_reboot_service.js <IotHub connection string>
-
Start the device side first, as it will register the C2D method listener for firmware update:
node device\samples\dmpatterns_fwupdate_device.js <IotHub device connection string>
-
In a new terminal window, start the service side to initate the firmware update:
node service\samples\dmpatterns_fwupdate_service.js <IotHub connection string>