Skip to content

Commit ce85fcc

Browse files
committed
Integrated in review feedback
1 parent 6d7dbcf commit ce85fcc

5 files changed

+28
-24
lines changed

articles/iot-hub/how-to-device-management.md

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ The device is responsible for:
2424

2525
* Initiating the corresponding device-specific action on the device.
2626

27-
* Providing status updates through *reported properties* to IoT Hub.
27+
* Providing status updates through reported properties to IoT Hub.
2828

2929
The back-end app can run device twin queries to report on the progress of the device management actions.
3030

31-
This article shows you how a back-end app and a device app can work together to initiate and monitor a remote device reboot using IoT Hub:
31+
This article shows you how a back-end app and a device app can work together to initiate and monitor a remote device action using direct methods and device twins. For this article, we use a device reboot as an example:
3232

3333
* A service app calls a direct method to reboot in a device app through an IoT hub. The service app then displays the response and updated reported properties.
3434
* A device app handles a direct method to reboot a device and updates the last reboot time.
@@ -47,23 +47,7 @@ This article shows you how a back-end app and a device app can work together to
4747
* If your application uses the MQTT protocol, make sure that **port 8883** is open in your firewall. The MQTT protocol communicates over port 8883. This port may be blocked in some corporate and educational network environments. For more information and ways to work around this issue, see [Connecting to IoT Hub (MQTT)](../iot/iot-mqtt-connect-to-iot-hub.md#connecting-to-iot-hub).
4848

4949
* Language SDK requirements:
50-
* **.NET SDK** - Requires Visual Studio.
51-
* **Python SDK** - [Python version 3.7 or later](https://www.python.org/downloads/) is recommended. Make sure to use the 32-bit or 64-bit installation as required by your setup. When prompted during the installation, make sure to add Python to your platform-specific environment variable.
5250

53-
* Device applications require the **azure-iot-device** package. You can install the package using this command:
54-
55-
```cmd/sh
56-
pip install azure-iot-device
57-
```
58-
59-
* Service applications require the **azure-iot-hub** package. You can install the package using this command:
60-
61-
```cmd/sh
62-
pip install azure-iot-hub
63-
```
64-
65-
* **Java** - Requires [Java SE Development Kit 8](/azure/developer/java/fundamentals/). Make sure you select **Java 8** under **Long-term support** to navigate to downloads for JDK 8.
66-
* **Node.js** - Requires Node.js version 10.0.x or later.
6751

6852
:::zone pivot="programming-language-csharp"
6953

includes/iot-hub-howto-device-management-dotnet.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ ms.date: 10/09/2024
1111
ms.custom: mqtt, devx-track-csharp, devx-track-dotnet
1212
---
1313

14+
* **.NET SDK** - Requires Visual Studio.
15+
1416
## Overview
1517

1618
This article describes how to use the [Azure IoT SDK for .NET](https://github.com/Azure/azure-iot-sdk-csharp) to create device and backend service application code for device direct messages.
@@ -85,7 +87,7 @@ catch (Exception ex)
8587
}
8688
```
8789

88-
In this example, the `onReboot` callback method implements the direct method on the device. This code updates reported properties related to a simulated device reboot. The reported properties can be read and verified by an IoT Hub or backend application, as demonstrated in the **Create a backend application** section of this article.
90+
In this example, the `onReboot` callback method implements the direct method on the device. This code updates reported properties related to a device reboot. The reported properties can be read and verified by a IoT Hub or backend application, as demonstrated in the [Create a backend application](#create-a-backend-application) section of this article.
8991

9092
```csharp
9193
static Task<MethodResponse> onReboot(MethodRequest methodRequest, object userContext)
@@ -124,7 +126,7 @@ static Task<MethodResponse> onReboot(MethodRequest methodRequest, object userCon
124126
125127
### SDK device samples
126128

127-
The Azure IoT SDK for .NET provides working samples of device apps that handle device message tasks. For more information, see:
129+
The Azure IoT SDK for .NET provides working samples of device apps that handle direct method tasks. For more information, see:
128130

129131
* [Method Sample](https://github.com/Azure/azure-iot-sdk-csharp/tree/main/iothub/device/samples/getting%20started/MethodSample)
130132
* [Simulated Device with Command](https://github.com/Azure/azure-iot-sdk-csharp/tree/main/iothub/device/samples/getting%20started/SimulatedDeviceWithCommand)
@@ -133,9 +135,9 @@ The Azure IoT SDK for .NET provides working samples of device apps that handle d
133135

134136
## Create a backend application
135137

136-
This section describes how to initiate a remote reboot on a device using a direct method. The app uses device twin queries to discover the last reboot time for that device.
138+
This section describes how to trigger a direct method on a device and then use device twin queries to monitor the status of that device.
137139

138-
The [ServiceClient](/dotnet/api/microsoft.azure.devices.serviceclient) class exposes all methods required to create a backend application to send messages to devices.
140+
The [ServiceClient](/dotnet/api/microsoft.azure.devices.serviceclient) class exposes all methods required to create a backend application to send direct method calls to devices.
139141

140142
### Required service NuGet package
141143

@@ -152,7 +154,7 @@ Add the following `using` statements.
152154

153155
### Connect to IoT hub
154156

155-
Connect a backend application to a device using [CreateFromConnectionString](/dotnet/api/microsoft.azure.devices.serviceclient.createfromconnectionstring?#microsoft-azure-devices-serviceclient-createfromconnectionstring(system-string-microsoft-azure-devices-serviceclientoptions)).
157+
Connect a backend application using [CreateFromConnectionString](/dotnet/api/microsoft.azure.devices.serviceclient.createfromconnectionstring?#microsoft-azure-devices-serviceclient-createfromconnectionstring(system-string-microsoft-azure-devices-serviceclientoptions)).
156158

157159
To invoke a direct method on a device through IoT Hub, your service needs the **service connect** permission. By default, every IoT Hub is created with a shared access policy named **service** that grants this permission.
158160

@@ -174,7 +176,7 @@ To invoke a method on a device:
174176
1. Create a [CloudToDeviceMethod](/dotnet/api/microsoft.azure.devices.cloudtodevicemethod) object. Pass the device direct method name as a parameter.
175177
1. Call [InvokeDeviceMethodAsync](/dotnet/api/microsoft.azure.devices.serviceclient.invokedevicemethodasync?#microsoft-azure-devices-serviceclient-invokedevicemethodasync(system-string-microsoft-azure-devices-cloudtodevicemethod-system-threading-cancellationtoken)) to invoke the method on the device.
176178

177-
This example calls the "reboot" method to initiate a reboot on the device. The "reboot" method is mapped to a listener on the device as described in the **Create a direct method callback** section of this article.
179+
This example calls the "reboot" method to initiate a reboot on the device. The "reboot" method is mapped to a listener on the device as described in the [Create a direct method callback](#create-a-direct-method-callback) section of this article.
178180

179181
```csharp
180182
CloudToDeviceMethod method = new CloudToDeviceMethod("reboot");

includes/iot-hub-howto-device-management-java.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ ms.date: 10/09/2024
1111
ms.custom: amqp, mqtt, devx-track-java, devx-track-extended-java
1212
---
1313

14+
* **Java** - Requires [Java SE Development Kit 8](/azure/developer/java/fundamentals/). Make sure you select **Java 8** under **Long-term support** to navigate to downloads for JDK 8.
15+
1416
## Overview
1517

1618
This article describes how to use the [Azure IoT SDK for Java](https://github.com/Azure/azure-iot-sdk-java) to create device and backend service application code for device direct methods.

includes/iot-hub-howto-device-management-node.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ ms.date: 10/09/2024
1111
ms.custom: mqtt, devx-track-js
1212
---
1313

14+
* **Node.js** - Requires Node.js version 10.0.x or later.
15+
1416
## Overview
1517

1618
This article describes how to use the [Azure IoT SDK for Node.js](https://github.com/Azure/azure-iot-sdk-node) to create device and backend service application code for device direct methods.

includes/iot-hub-howto-device-management-python.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,20 @@ ms.date: 10/09/2024
1111
ms.custom: mqtt, devx-track-python, py-fresh-zinc
1212
---
1313

14+
* **Python SDK** - [Python version 3.7 or later](https://www.python.org/downloads/) is recommended. Make sure to use the 32-bit or 64-bit installation as required by your setup. When prompted during the installation, make sure to add Python to your platform-specific environment variable.
15+
16+
* Device applications require the **azure-iot-device** package. You can install the package using this command:
17+
18+
```cmd/sh
19+
pip install azure-iot-device
20+
```
21+
22+
* Service applications require the **azure-iot-hub** package. You can install the package using this command:
23+
24+
```cmd/sh
25+
pip install azure-iot-hub
26+
```
27+
1428
## Overview
1529
1630
This article describes how to use the [Azure IoT SDK for Python](https://github.com/Azure/azure-iot-sdk-python) to create device and backend service application code for device direct methods.

0 commit comments

Comments
 (0)