Microsoft Azure IoT Developer Exam: Communication Methods for IoT Infrastructure Tasks

Which Communication Methods to Choose for IoT Infrastructure Tasks?

Question

While operating an IoT infrastructure with a number of field devices, from time to time, you have to ..

… restart a device … set the device send telemetry frequency to 5mins … send a one-way notification to a specific device … get immediate response from the device to Which communication methods should you choose for the above tasks?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Correct Answer: C.

Option A is incorrect because commands like restarting a device can be initiated via invoking direct methods of the device app.

C2D messaging is not suitable for this purpose.

Option B is incorrect because commands like restarting a device can be initiated via invoking direct methods of the device app.

C2D messaging is for sending simple, one-way notifications from back-end services to specific devices.

Option C is CORRECT because in order to launch commands on the device you need to invoke direct commands; target values can be set via properties/desired in device twin; use C2D messaging for one-way notifications for the device; for two-way communication use direct methods.

Option D is incorrect because if you want to set target values for devices, you need to do it via setting the desired properties of the device twin.

References:

The correct answer is A. Use Cloud-to-device messaging; Set a desired property in device twin; Invoke a direct method; Invoke a direct method.

Here's why:

  1. Restarting a device: To restart a device, we need to send a command from the cloud to the device to restart. We can do this using the "direct method" feature of Azure IoT Hub, where we can invoke a method on the device from the cloud. Therefore, we should choose "Invoke a direct method" to restart a device.

  2. Setting device telemetry frequency to 5 mins: To set the device telemetry frequency, we need to set a property in the device twin (a digital representation of the device in the cloud). We can use the "desired properties" feature of device twin to set the property value from the cloud. Therefore, we should choose "Set a desired property in device twin" to set the device telemetry frequency.

  3. Sending a one-way notification to a specific device: To send a one-way notification to a specific device, we can use the "cloud-to-device messaging" feature of Azure IoT Hub. This feature allows the cloud to send a message to the device without the device having to send a request first. Therefore, we should choose "Use Cloud-to-device messaging" to send a one-way notification to a specific device.

  4. Getting an immediate response from the device: To get an immediate response from the device, we can use the "direct method" feature of Azure IoT Hub. This feature allows the cloud to invoke a method on the device and get a response back immediately. Therefore, we should choose "Invoke a direct method" to get an immediate response from the device.

Therefore, the correct answer is A. Use Cloud-to-device messaging; Set a desired property in device twin; Invoke a direct method; Invoke a direct method.