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
@@ -80,15 +80,15 @@ To simulate a device sending telemetry to your IoT hub, run the Node.js simulate
80
80
81
81
The terminal window displays a success message once it connects to your hub:
82
82
83
-
:::image type="content" source="{media/tutorial-connectivity/sim-1-connected.png}" alt-text="Screenshot that shows the simulated device connecting.":::
83
+
:::image type="content" source="media/tutorial-connectivity/sim-1-connected.png" alt-text="Screenshot that shows the simulated device connecting.":::
84
84
85
85
You've now successfully authenticated from a device using a device key generated by your IoT hub.
86
86
87
87
### Reset keys
88
88
89
89
In this section, you reset the device key and observe the error when the simulated device tries to connect.
90
90
91
-
1. To reset the primary device key for your device, run the following commands:
91
+
1. To reset the primary device key for your device, run the [az iot hub device-identity update](/cli/azure/iot/hub/device-identity#az-iot-hub-device-identity-update) command:
92
92
93
93
```azurecli-interactive
94
94
# Generate a new Base64 encoded key using the current date
@@ -118,7 +118,7 @@ In some scenarios, such as in a cloud protocol gateway or as part of a custom au
118
118
> [!NOTE]
119
119
> The SimulatedDevice-2.js sample includes examples of generating a SAS token both with and without the SDK.
120
120
121
-
1. Run the following command to generate a known-good SAS token using the CLI:
121
+
1. Run the [az iot hub genereate-sas-token](/cli/azure/iot/hub#az-iot-hub-generate-sas-token) command to generate a known-good SAS token using the CLI:
122
122
123
123
```azurecli-interactive
124
124
az iot hub generate-sas-token --device-id {your_device_id} --hub-name {your_iot_hub_name}
@@ -155,15 +155,15 @@ A device can use any of the following protocols to connect to your IoT hub:
155
155
156
156
If the outbound port is blocked by a firewall, the device can't connect:
:::image type="content" source="media/tutorial-connectivity/port-blocked.png" alt-text="Screenshot that shows a connection error when the outbound port is blocked.":::
159
159
160
160
## Check device-to-cloud connectivity
161
161
162
162
After a device connects, it can start sending telemetry to your IoT hub. This section shows you how you can verify that the telemetry sent by the device reaches your hub.
163
163
164
164
### Send device-to-cloud messages
165
165
166
-
1. Since we reset the connection string for your device in the previous section, use the following command to retrieve the updated connection string:
166
+
1. Since we reset the connection string for your device in the previous section, use the [az iot hub device-identity connection-string show](/cli/azure/iot/hub/device-identity/connection-string#az-iot-hub-device-identity-connection-string-show) command to retrieve the updated connection string:
167
167
168
168
```azurecli-interactive
169
169
az iot hub device-identity connection-string show --device-id {your_device_id} --output table --hub-name {your_iot_hub_name}
@@ -206,19 +206,19 @@ This section shows how you can make a test direct method call to a device to che
1. In a separate window, use a CLI command to call a direct method on the device:
209
+
1. In a separate window, use the [az iot hub invoke-device-method](/cli/azure/iot/hub#az-iot-hub-invoke-device-method) command to call a direct method on the device:
The simulated device prints a message to the console when it receives a direct method call:
216
216
217
-

217
+
:::image type="content" source="media/tutorial-connectivity/receive-method-call.png" alt-text="Screenshot that shows the device confirming that the direct method was received.":::
218
218
219
219
When the simulated device successfully receives the direct method call, it sends an acknowledgment back to the hub:
220
220
221
-

221
+
:::image type="content" source="media/tutorial-connectivity/method-acknowledgement.png" alt-text="Screenshot showing that the device returns a direct method acknowledgment.":::
222
222
223
223
## Check twin synchronization
224
224
@@ -232,25 +232,25 @@ The simulated device you use in this section sends reported properties to the hu
1. In a separate window, run the following CLI command to verify that the hub received the reported properties from the device:
235
+
1. In a separate window, run the [az iot hub device-twin show](/cli/azure/iot/hub/device-twin#az-iot-hub-device-twin-show) command to verify that the hub received the reported properties from the device:
236
236
237
-
```azurecli-interactive
238
-
az iot hub device-twin show --device-id {your_device_id} --hub-name {your_iot_hub_name}
239
-
```
237
+
```azurecli-interactive
238
+
az iot hub device-twin show --device-id {your_device_id} --hub-name {your_iot_hub_name}
239
+
```
240
240
241
241
In the output from the command, you can see the **devicelaststarted** property in the reported properties section. This property shows the date and time you last started the simulated device.
:::image type="content" source="(media/tutorial-connectivity/reported-properties.png" alt-text="Screenshot showing the reported properties of a device.":::
244
244
245
-
1. To verify that the hub can send desired property values to the device, use the following CLI command:
245
+
1. To verify that the hub can send desired property values to the device, use the [az iot hub device-twin update](/cli/azure/iot/hub/device-twin#az-iot-hub-device-twin-update) command:
:::image type="content" source="media/tutorial-connectivity/desired-properties.png" alt-text="Screenshot that shows the device confirming that the desired properties update was received.":::
254
254
255
255
In addition to receiving desired property changes as they're made, the simulated device automatically checks for desired properties when it starts up.
0 commit comments