You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Create a device app that implements a direct method called **LockDoor**, which can be called by the back-end app.
39
39
40
40
* Create a back-end app that creates a job to call the **LockDoor** direct method on multiple devices. Another job sends desired property updates to multiple devices.
41
41
42
-
At the end of this tutorial, you have two .NET (C#) console apps:
42
+
At the end of this article, you have two .NET (C#) console apps:
43
43
44
44
***SimulateDeviceMethods**. This app connects to your IoT hub and implements the **LockDoor** direct method.
45
45
@@ -49,17 +49,13 @@ At the end of this tutorial, you have two .NET (C#) console apps:
49
49
50
50
* Visual Studio.
51
51
52
-
* An active Azure account. If you don't have an account, you can create a [free account](https://azure.microsoft.com/pricing/free-trial/) in just a couple of minutes.
53
-
54
-
* Make sure that port 8883 is open in your firewall. The device sample in this article uses MQTT protocol, which 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-hub-mqtt-support.md#connecting-to-iot-hub).
52
+
* An IoT Hub. Create one with the [CLI](iot-hub-create-using-cli.md) or the [Azure portal](iot-hub-create-through-portal.md).
55
53
56
-
## Create an IoT hub
54
+
* A registered device. Register one in the [Azure portal](iot-hub-create-through-portal.md#register-a-new-device-in-the-iot-hub).
* An active Azure account. If you don't have an account, you can create a [free account](https://azure.microsoft.com/pricing/free-trial/) in just a couple of minutes.
* Make sure that port 8883 is open in your firewall. The device sample in this article uses MQTT protocol, which 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-hub-mqtt-support.md#connecting-to-iot-hub).
63
59
64
60
## Create a simulated device app
65
61
@@ -151,7 +147,7 @@ In this section, you create a .NET console app that responds to a direct method
* Create a device app that implements a direct method called **lockDoor**. The device app also receives desired property changes from the back-end app.
38
38
39
39
* Create a back-end app that creates a job to call the **lockDoor** direct method on multiple devices. Another job sends desired property updates to multiple devices.
40
40
41
-
At the end of this tutorial, you have a Java console device app and a Java console back-end app:
41
+
At the end of this article, you have a Java console device app and a Java console back-end app:
42
42
43
43
**simulated-device** that connects to your IoT hub, implements the **lockDoor** direct method, and handles desired property changes.
44
44
@@ -49,6 +49,10 @@ At the end of this tutorial, you have a Java console device app and a Java conso
49
49
50
50
## Prerequisites
51
51
52
+
* An IoT Hub. Create one with the [CLI](iot-hub-create-using-cli.md) or the [Azure portal](iot-hub-create-through-portal.md).
53
+
54
+
* A registered device. Register one in the [Azure portal](iot-hub-create-through-portal.md#register-a-new-device-in-the-iot-hub).
55
+
52
56
*[Java SE Development Kit 8](/java/azure/jdk/). Make sure you select **Java 8** under **Long-term support** to get to downloads for JDK 8.
53
57
54
58
*[Maven 3](https://maven.apache.org/download.cgi)
@@ -57,16 +61,6 @@ At the end of this tutorial, you have a Java console device app and a Java conso
57
61
58
62
* Make sure that port 8883 is open in your firewall. The device sample in this article uses MQTT protocol, which 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-hub-mqtt-support.md#connecting-to-iot-hub).
@@ -365,7 +359,7 @@ In this section, you create a Java console app that handles the desired properti
365
359
import java.util.Scanner;
366
360
```
367
361
368
-
9. Add the following class-level variables to the **App** class. Replace `{yourdeviceconnectionstring}` with the device connection string you copied previously in the [Register a new device in the IoT hub](#register-a-new-device-in-the-iot-hub) section:
362
+
9. Add the following class-level variables to the **App** class. Replace `{yourdeviceconnectionstring}` with the device connection string you saw when you registered a device in your IoT Hub:
@@ -511,10 +505,10 @@ You are now ready to run the console apps.
511
505
512
506
## Next steps
513
507
514
-
In this tutorial, you used a job to schedule a direct method to a device and the update of the device twin's properties.
508
+
In this article, you used a job to schedule a direct method to a device and the update of the device twin's properties.
515
509
516
510
Use the following resources to learn how to:
517
511
518
-
* Send telemetry from devices with the [Get started with IoT Hub](../iot-develop/quickstart-send-telemetry-iot-hub.md?pivots=programming-language-java)tutorial.
512
+
* Send telemetry from devices with the [Get started with IoT Hub](../iot-develop/quickstart-send-telemetry-iot-hub.md?pivots=programming-language-java)article.
519
513
520
514
* Control devices interactively (such as turning on a fan from a user-controlled app) with the [Use direct methods](./quickstart-control-device.md?pivots=programming-language-java) quickstart.
* Create a Node.js simulated device app that has a direct method, which enables **lockDoor**, which can be called by the solution back end.
38
38
39
39
* Create a Node.js console app that calls the **lockDoor** direct method in the simulated device app using a job and updates the desired properties using a device job.
40
40
41
-
At the end of this tutorial, you have two Node.js apps:
41
+
At the end of this article, you have two Node.js apps:
42
42
43
43
***simDevice.js**, which connects to your IoT hub with the device identity and receives a **lockDoor** direct method.
44
44
45
45
***scheduleJobService.js**, which calls a direct method in the simulated device app and updates the device twin's desired properties using a job.
46
46
47
47
## Prerequisites
48
48
49
-
*Node.js version 10.0.x or later. [Prepare your development environment](https://github.com/Azure/azure-iot-sdk-node/tree/main/doc/node-devbox-setup.md)describes how to install Node.js for this tutorial on either Windows or Linux.
49
+
*An IoT Hub. Create one with the [CLI](iot-hub-create-using-cli.md)or the [Azure portal](iot-hub-create-through-portal.md).
50
50
51
-
* An active Azure account. (If you don't have an account, you can create a [free account](https://azure.microsoft.com/pricing/free-trial/) in just a couple of minutes.)
52
-
53
-
* Make sure that port 8883 is open in your firewall. The device sample in this article uses MQTT protocol, which 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-hub-mqtt-support.md#connecting-to-iot-hub).
51
+
* A registered device. Register one in the [Azure portal](iot-hub-create-through-portal.md#register-a-new-device-in-the-iot-hub).
54
52
55
-
## Create an IoT hub
53
+
* Node.js version 10.0.x or later. [Prepare your development environment](https://github.com/Azure/azure-iot-sdk-node/tree/main/doc/node-devbox-setup.md) describes how to install Node.js for this article on either Windows or Linux.
* An active Azure account. (If you don't have an account, you can create a [free account](https://azure.microsoft.com/pricing/free-trial/) in just a couple of minutes.)
* Make sure that port 8883 is open in your firewall. The device sample in this article uses MQTT protocol, which 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-hub-mqtt-support.md#connecting-to-iot-hub).
62
58
63
59
## Create a simulated device app
64
60
@@ -128,7 +124,7 @@ In this section, you create a Node.js console app that responds to a direct meth
128
124
8. Save and close the **simDevice.js** file.
129
125
130
126
> [!NOTE]
131
-
> To keep things simple, thistutorial does not implement any retry policy. In production code, you should implement retry policies (such as an exponential backoff), as suggested in the article, [Transient Fault Handling](/azure/architecture/best-practices/transient-faults).
127
+
> To keep things simple, thisarticle does not implement any retry policy. In production code, you should implement retry policies (such as an exponential backoff), as suggested in the article, [Transient Fault Handling](/azure/architecture/best-practices/transient-faults).
132
128
>
133
129
134
130
## Get the IoT hub connection string
@@ -291,7 +287,7 @@ You are now ready to run the applications.
291
287
292
288
## Next steps
293
289
294
-
In thistutorial, you used a job to schedule a direct method to a device and the update of the device twin's properties.
290
+
In thisarticle, you used a job to schedule a direct method to a device and the update of the device twin's properties.
295
291
296
292
To continue getting started with IoT Hub and device management patterns such as end-to-end image-based update in [Device Update for Azure IoT Hub tutorial using the Raspberry Pi 3 B+ Reference Image](../iot-hub-device-update/device-update-raspberry-pi.md).
* Create a Python simulated device app that has a direct method, which enables **lockDoor**, which can be called by the solution back end.
37
37
38
38
* Create a Python console app that calls the **lockDoor** direct method in the simulated device app using a job and updates the desired properties using a device job.
39
39
40
-
At the end of this tutorial, you have two Python apps:
40
+
At the end of this article, you have two Python apps:
41
41
42
42
**simDevice.py**, which connects to your IoT hub with the device identity and receives a **lockDoor** direct method.
43
43
@@ -47,15 +47,11 @@ At the end of this tutorial, you have two Python apps:
@@ -143,7 +139,7 @@ In this section, you create a Python console app that responds to a direct metho
143
139
6. Save and close the **simDevice.py** file.
144
140
145
141
> [!NOTE]
146
-
> To keep things simple, this tutorial does not implement any retry policy. In production code, you should implement retry policies (such as an exponential backoff), as suggested in the article, [Transient Fault Handling](/azure/architecture/best-practices/transient-faults).
142
+
> To keep things simple, this article does not implement any retry policy. In production code, you should implement retry policies (such as an exponential backoff), as suggested in the article, [Transient Fault Handling](/azure/architecture/best-practices/transient-faults).
147
143
>
148
144
149
145
## Get the IoT hub connection string
@@ -182,7 +178,7 @@ In this section, you create a Python console app that initiates a remote **lockD
182
178
183
179
2. Using a text editor, create a new **scheduleJobService.py** file in your working directory.
184
180
185
-
3. Add the following `import` statements and variables at the start of the **scheduleJobService.py** file. Replace the `{IoTHubConnectionString}` placeholder with the IoT hub connection string you copied previously in [Get the IoT hub connection string](#get-the-iot-hub-connection-string). Replace the `{deviceId}` placeholder with the device ID you registered in [Register a new device in the IoT hub](#register-a-new-device-in-the-iot-hub):
181
+
3. Add the following `import` statements and variables at the start of the **scheduleJobService.py** file. Replace the `{IoTHubConnectionString}` placeholder with the IoT hub connection string you copied previously in [Get the IoT hub connection string](#get-the-iot-hub-connection-string). Replace the `{deviceId}` placeholder with the device ID (the name) from your registered device:
186
182
187
183
```python
188
184
import os
@@ -318,6 +314,6 @@ You are now ready to run the applications.
318
314
319
315
## Next steps
320
316
321
-
In this tutorial, you used a job to schedule a direct method to a device and the update of the device twin's properties.
317
+
In this article, you used a job to schedule a direct method to a device and the update of the device twin's properties.
322
318
323
319
To continue getting started with IoT Hub and device management patterns such as end-to-end image-based update in [Device Update for Azure IoT Hub tutorial using the Raspberry Pi 3 B+ Reference Image](../iot-hub-device-update/device-update-raspberry-pi.md).
0 commit comments