|
1 | 1 | ---
|
2 |
| -title: Device Update for IoT Hub tutorial using the Raspberry Pi 3 B+ reference Yocto image | Microsoft Docs |
3 |
| -description: Get started with Device Update for Azure IoT Hub by using the Raspberry Pi 3 B+ reference Yocto image. |
| 2 | +title: Azure Device Update for IoT Hub using a Raspberry Pi 3 Yocto image | Microsoft Docs |
| 3 | +description: Get started with Device Update for Azure IoT Hub by using the Raspberry Pi 3 B+ Yocto image. |
4 | 4 | author: eshashah
|
5 | 5 | ms.author: eshashah
|
6 |
| -ms.date: 3/8/2023 |
| 6 | +ms.date: 11/25/2024 |
7 | 7 | ms.topic: tutorial
|
8 | 8 | ms.service: azure-iot-hub
|
9 | 9 | ms.subservice: device-update
|
10 | 10 | ---
|
11 | 11 |
|
12 |
| -# Tutorial: Device Update for Azure IoT Hub using the Raspberry Pi 3 B+ reference image |
| 12 | +# Tutorial: Azure Device Update for IoT Hub using a Raspberry Pi 3 image |
13 | 13 |
|
14 |
| -Device Update for Azure IoT Hub supports image-based, package-based, and script-based updates. |
| 14 | +Device Update for Azure IoT Hub supports image-based, package-based, and script-based updates. This tutorial demonstrates an end-to-end Device Update for IoT Hub image-based update for a Raspberry Pi 3 B+ board. |
15 | 15 |
|
16 |
| -Image updates provide a higher level of confidence in the end state of the device. It's typically easier to replicate the results of an image update between a preproduction environment and a production environment because it doesn't pose the same challenges as packages and their dependencies. Because of their atomic nature, you can also adopt an A/B failover model easily. |
| 16 | +Image updates provide a high level of confidence in the end state of the device, and don't pose the same package and dependency management challenges as package or script based updates. It's easier to replicate the results of an image update between a preproduction and production environment, or easily adopt an A/B failover model. |
17 | 17 |
|
18 |
| -This tutorial walks you through the steps to complete an end-to-end image-based update by using Device Update for IoT Hub on a Raspberry Pi 3 B+ board. |
19 |
| - |
20 |
| -In this tutorial, you'll learn how to: |
| 18 | +In this tutorial, you: |
21 | 19 | > [!div class="checklist"]
|
22 | 20 | >
|
23 |
| -> * Download an image. |
24 |
| -> * Add a tag to your IoT device. |
25 |
| -> * Import an update. |
26 |
| -> * Deploy an image update. |
27 |
| -> * Monitor the update deployment. |
| 21 | +> - Download an image. |
| 22 | +> - Assign a tag to your IoT device. |
| 23 | +> - Import an update. |
| 24 | +> - Deploy the image update. |
| 25 | +> - Monitor the update deployment. |
28 | 26 |
|
29 | 27 | > [!NOTE]
|
30 | 28 | > Image updates in this tutorial were validated on the Raspberry Pi B3 board.
|
31 | 29 |
|
32 |
| - |
33 | 30 | ## Prerequisites
|
34 | 31 |
|
35 |
| -If you haven't already done so, create a [Device Update account and instance](create-device-update-account.md) and configure an IoT hub. This tutorial needs the device to be connected via ethernet connection. |
| 32 | +- A [Device Update account and instance configured with an IoT hub](create-device-update-account.md) |
| 33 | +- An IoT device connected via Ethernet |
| 34 | + |
| 35 | +## Get the update files |
| 36 | + |
| 37 | +1. The *Tutorial_RaspberryPi.zip* file has all the required files for the tutorial. Download the file from the **Assets** section of the latest release on the [GitHub Device Update Releases page](https://github.com/Azure/iot-hub-device-update/releases). |
| 38 | + |
| 39 | +1. Unzip the file. |
| 40 | + |
| 41 | +## Register the device and get the connection string |
36 | 42 |
|
37 |
| -Download files in **Assets** on the [Device Update GitHub releases page](https://github.com/Azure/iot-hub-device-update/releases). The Tutorial_RaspberryPi.zip has all the required files for the tutorial. |
| 43 | +Add your device to the device registry in your IoT hub and get the connection string IoT Hub generates for the device. |
| 44 | + |
| 45 | +1. In the [Azure portal](https://portal.azure.com), open the IoT hub page associated with your Device Update instance. |
| 46 | +1. In the navigation pane, select **Device management** > **Devices**. |
| 47 | +1. On the **Devices** page, select **Add Device**. |
| 48 | +1. Under **Device ID**, enter a name for the device. Ensure that **Autogenerate keys** checkbox is selected. |
| 49 | +1. Select **Save**. The device appears in the list on the **Devices** page. |
| 50 | +1. Get the device connection string by navigating to the device view, select the **Copy** icon next to **Primary Connection String**. |
| 51 | +1. Paste the copied characters somewhere for later use in the following steps: |
38 | 52 |
|
39 | 53 | ## Create a device in IoT Hub and get a connection string
|
40 | 54 |
|
41 |
| -Now, add the device to IoT Hub. From within IoT Hub, a connection string is generated for the device. |
| 55 | +Now, add the device to IoT Hub. From within |
42 | 56 |
|
43 | 57 | 1. From the [Azure portal](https://portal.azure.com), navigate to your IoT hub.
|
44 | 58 | 1. On the left pane, select **Devices**. Then select **New**.
|
45 | 59 | 1. Under **Device ID**, enter a name for the device. Ensure that the **Autogenerate keys** checkbox is selected.
|
46 |
| -1. Select **Save**. On the **Devices** page, the device you created should be in the list. |
47 |
| -1. Get the device connection string by navigating to the device view, select the **Copy** icon next to **Primary Connection String**. |
48 |
| -1. Paste the copied characters somewhere for later use in the following steps: |
| 60 | +1. Select **Save**. |
49 | 61 |
|
50 | 62 | **This copied string is your device connection string**.
|
51 | 63 |
|
52 | 64 | > [!NOTE]
|
53 |
| -> This tutorial uses a device connection string to authenticate and connect with the IoT Hub for ease of set-up. For production scenarios, we recommend using module identity and leveraging AIS([IoT Identity Service](https://azure.github.io/iot-identity-service/)) to provision devices. [Learn more ](device-update-agent-provisioning.md) |
| 65 | +> For ease of setup, this tutorial uses a device connection string to authenticate and connect with the IoT hub. For production scenarios, it's better to use module identity and [IoT Identity Service](https://azure.github.io/iot-identity-service/) to provision devices. For more information, see [Learn more ](device-update-agent-provisioning.md). |
54 | 66 |
|
55 | 67 | ## Set up Raspberry Pi
|
56 | 68 |
|
57 |
| -We provide base image and update files in **Assets** on the [Device Update GitHub releases page](https://github.com/Azure/iot-hub-device-update/releases). The Tutorial_RaspberryPi.zip has all the required files for the tutorial. |
58 |
| -The .wic file is the base image that you can flash on to a Raspberry Pi 3 B+ board. The swUpdate(.swu) file, custom swupdate script and manifest are the update files you would import through Device Update for IoT Hub. |
59 |
| - |
60 |
| -This base image uses a Yocto build(based on 3.4.4 release) with: |
61 |
| -* SWUpdate which enables the dual partition update with DU |
62 |
| -* Device Update agent |
| 69 | +In the *Tutorial_RaspberryPi* folder, the *.wic* file is the base image that you can flash on to a Raspberry Pi 3 B+ board. The swUpdate(.swu) file, custom swupdate script and manifest are the update files you would import through Device Update for IoT Hub. |
63 | 70 |
|
64 |
| -To learn more about the Yocto layers used, refer to [Device Update Yocto GitHub.](https://github.com/Azure/iot-hub-device-update-yocto). |
| 71 | +This base image uses a Yocto build based on the 3.4.4 release. The image has the Device Update agent and SWUpdate, which enables the dual partition update with Device Update. For more information about the Yocto layers used, see [Device Update Yocto GitHub.](https://github.com/Azure/iot-hub-device-update-yocto). |
65 | 72 |
|
66 |
| -You can use your favorite OS flashing tool to install the Device Update base image (adu-base-image) on the SD card that will be used in the Raspberry Pi 3 B+ device. Below are the instructions for using bmaptool to flash to the SD card. |
| 73 | +You can use your favorite OS flashing tool to install the Device Update base image (adu-base-image) on the SD card you use in the Raspberry Pi 3 B+ device. The following instructions use bmaptool to flash to the SD card. |
67 | 74 |
|
68 | 75 | ### Use bmaptool to flash the SD card
|
69 | 76 |
|
@@ -100,7 +107,7 @@ Device Update for Azure IoT Hub software is subject to the following license ter
|
100 | 107 |
|
101 | 108 | Read the license terms prior to using the agent. Your installation and use constitutes your acceptance of these terms. If you don't agree with the license terms, don't use the Device Update for IoT Hub agent.
|
102 | 109 |
|
103 |
| -## Configure the Device Update agent on Raspberry Pi |
| 110 | +### Configure the Device Update agent on Raspberry Pi |
104 | 111 |
|
105 | 112 | 1. Make sure that Raspberry Pi 3 is connected to the network.
|
106 | 113 | 1. SSH into the Raspberry Pi 3 by using the following command in the PowerShell window:
|
|
0 commit comments