Skip to content

Commit d942f2e

Browse files
committed
added screenshots
1 parent 60a9b47 commit d942f2e

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

articles/iot-hub/iot-hub-python-python-c2d.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ At the end of this tutorial, you run two Python console apps:
3030

3131
* **SimulatedDevice.py**, a modified version of the app created in [Send telemetry from a device to an IoT hub](quickstart-send-telemetry-python.md), which connects to your IoT hub and receives cloud-to-device messages.
3232

33-
* **SendCloudToDeviceMessage.py**, which sends a cloud-to-device message to the simulated device app through IoT Hub, and then receives its delivery acknowledgment.
33+
* **SendCloudToDeviceMessage.py**, which sends cloud-to-device messages to the simulated device app through IoT Hub.
3434

3535
[!INCLUDE [iot-hub-include-python-sdk-note](../../includes/iot-hub-include-python-sdk-note.md)]
3636

@@ -54,8 +54,9 @@ In this section, you create a Python console app to simulate the device and rece
5454
5555
1. Add the following `import` statements and variables at the start of the **SimulatedDevice.py** file:
5656
57-
```python
57+
```python
5858
import threading
59+
import time
5960
from azure.iot.device import IoTHubDeviceClient
6061
6162
RECEIVED_MESSAGES = 0
@@ -117,13 +118,13 @@ In this section, you create a Python console app to simulate the device and rece
117118
118119
## Get the IoT hub connection string
119120
120-
In this article you create a backend service to send cloud-to-device messages through the IoT hub you created in [Send telemetry from a device to an IoT hub](quickstart-send-telemetry-python.md). To send cloud-to-device messages, 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.
121+
In this article, you create a backend service to send cloud-to-device messages through the IoT hub you created in [Send telemetry from a device to an IoT hub](quickstart-send-telemetry-python.md). To send cloud-to-device messages, 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.
121122
122123
[!INCLUDE [iot-hub-include-find-service-connection-string](../../includes/iot-hub-include-find-service-connection-string.md)]
123124
124125
## Send a cloud-to-device message
125126
126-
In this section, you create a Python console app that sends cloud-to-device messages to the simulated device app. You need the device ID of the device you added in the [Send telemetry from a device to an IoT hub](quickstart-send-telemetry-python.md) quickstart. You also need the the IoT hub connection string you copied previously in [Get the IoT hub connection string](#get-the-iot-hub-connection-string).
127+
In this section, you create a Python console app that sends cloud-to-device messages to the simulated device app. You need the device ID of the device you added in the [Send telemetry from a device to an IoT hub](quickstart-send-telemetry-python.md) quickstart. You also need the IoT hub connection string you copied previously in [Get the IoT hub connection string](#get-the-iot-hub-connection-string).
127128
128129
1. In your working directory, open a command prompt and install the **Azure IoT Hub Service SDK for Python**.
129130
@@ -212,19 +213,19 @@ You are now ready to run the applications.
212213
python SimulatedDevice.py
213214
```
214215

215-
![Run the simulated device app](./media/iot-hub-python-python-c2d/simulated-device.png)
216+
![Run the simulated device app](./media/iot-hub-python-python-c2d/device-1.png)
216217

217218
1. Open a new command prompt in your working directory and run the following command to send cloud-to-device messages:
218219

219220
```shell
220221
python SendCloudToDeviceMessage.py
221222
```
222223

223-
![Run the app to send the cloud-to-device command](./media/iot-hub-python-python-c2d/send-command.png)
224+
![Run the app to send the cloud-to-device command](./media/iot-hub-python-python-c2d/service.png)
224225

225-
1. Note the message received by the device.
226+
1. Note the messages received by the device.
226227

227-
![Message received](./media/iot-hub-python-python-c2d/message-received.png)
228+
![Message received](./media/iot-hub-python-python-c2d/device-2.png)
228229

229230
## Next steps
230231

10.9 KB
Loading
43.6 KB
Loading
14.4 KB
Loading

0 commit comments

Comments
 (0)