Skip to content

Commit 8a18e82

Browse files
authored
edits
1 parent 8fce398 commit 8a18e82

File tree

1 file changed

+159
-93
lines changed

1 file changed

+159
-93
lines changed

articles/iot-hub-device-update/device-update-agent-provisioning.md

Lines changed: 159 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -9,115 +9,179 @@ ms.service: iot-hub-device-update
99
---
1010

1111
# Device Update Agent Provisioning
12+
1213
The Device Update Module agent can run alongside other system processes and [IoT Edge modules](https://docs.microsoft.com/azure/iot-edge/iot-edge-modules) that connect to your IoT Hub as part of the same logical device. This section describes how to provision the Device Update agent as a module identity.
13-
Module Identity vs Device Identity: In IoT Hub, under each device identity, you can create up to 50 module identities. Each module identity implicitly generates a module twin. On the device side, the IoT Hub device SDKs enable you to create modules where each one opens an independent connection to IoT Hub. Module identity and module twin provide the similar capabilities as device identity and device twin but at a finer granularity. [Learn more about Module Identities in IoT Hub](https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-module-twins)
14-
15-
Currently supported IoT device types with Device Update:
16-
* Linux devices (IoT Edge and Non-IoT Edge devices):
17-
+ Image A/B update:
18-
- Yocto - ARM64 (reference image), extensible via open source to [build you own images](device-update-agent-provisioning.md#how-to-build-and-run-device-update-agent) for other architecture as needed.
19-
- Ubuntu 18.04 simulator
20-
+ Package Agent supported builds for the following platforms/architectures.
21-
- Ubuntu Server 18.04 x64 Package Agent
22-
- Debian 9
23-
* Constrained devices:
24-
+ AzureRTOS Device Update agent samples: [Device Update for Azure IoT Hub tutorial for Azure-Real-Time-Operating-System](device-update-azure-real-time-operating-system.md)
25-
* Disconnected devices:
26-
+ [Understand support for disconnected device update](connected-cache-disconnected-device-update.md)
27-
28-
## Pre-Requisite
29-
If you are setting up the IoT device/IoT Edge device for [package based updates](https://docs.microsoft.com/azure/iot-hub-device-update/understand-device-update#support-for-a-wide-range-of-update-artifacts), add packages.microsoft.com to your machine’s repositories by following the steps below:
30-
1. Log onto the machine or IoT device on which you intend to install the Device Update agent.
31-
2. Open a Terminal window.
32-
3. Install the repository configuration that matches your device’s operating system.
33-
```shell
34-
curl https://packages.microsoft.com/config/ubuntu/18.04/multiarch/prod.list > ./microsoft-prod.list
35-
```
36-
4. Copy the generated list to the sources.list.d directory.
37-
```shell
38-
sudo cp ./microsoft-prod.list /etc/apt/sources.list.d/
39-
```
40-
5. Install the Microsoft GPG public key.
41-
```shell
42-
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
43-
```
44-
```shell
45-
sudo cp ./microsoft.gpg /etc/apt/trusted.gpg.d/
46-
```
14+
15+
16+
## Module identity vs device identity
17+
18+
In IoT Hub, under each device identity, you can create up to 50 module identities. Each module identity implicitly generates a module twin. On the device side, the IoT Hub device SDKs enable you to create modules where each one opens an independent connection to IoT Hub. Module identity and module twin provide the similar capabilities as device identity and device twin but at a finer granularity. [Learn more about Module Identities in IoT Hub](https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-module-twins)
19+
20+
21+
## Support for Device Update
22+
23+
The following IoT device types are currently supported with Device Update:
24+
25+
* Linux devices (IoT Edge and Non-IoT Edge devices):
26+
* Image A/B update:
27+
- Yocto - ARM64 (reference image), extensible via open source to [build you own images](device-update-agent-provisioning.md#how-to-build-and-run-device-update-agent) for other architecture as needed.
28+
- Ubuntu 18.04 simulator
29+
30+
* Package Agent supported builds for the following platforms/architectures:
31+
- Ubuntu Server 18.04 x64 Package Agent
32+
- Debian 9
33+
34+
* Constrained devices:
35+
* AzureRTOS Device Update agent samples: [Device Update for Azure IoT Hub tutorial for Azure-Real-Time-Operating-System](device-update-azure-real-time-operating-system.md)
36+
37+
* Disconnected devices:
38+
* [Understand support for disconnected device update](connected-cache-disconnected-device-update.md)
39+
40+
41+
## Prerequisites
42+
43+
If you're setting up the IoT device/IoT Edge device for [package based updates](https://docs.microsoft.com/azure/iot-hub-device-update/understand-device-update#support-for-a-wide-range-of-update-artifacts), add packages.microsoft.com to your machine’s repositories by following these steps:
44+
45+
1. Log onto the machine or IoT device on which you intend to install the Device Update agent.
46+
47+
1. Open a Terminal window.
48+
49+
1. Install the repository configuration that matches your device’s operating system.
50+
```shell
51+
curl https://packages.microsoft.com/config/ubuntu/18.04/multiarch/prod.list > ./microsoft-prod.list
52+
```
53+
54+
1. Copy the generated list to the sources.list.d directory.
55+
```shell
56+
sudo cp ./microsoft-prod.list /etc/apt/sources.list.d/
57+
```
58+
59+
1. Install the Microsoft GPG public key.
60+
```shell
61+
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
62+
```
63+
64+
```shell
65+
sudo cp ./microsoft.gpg /etc/apt/trusted.gpg.d/
66+
```
4767

4868
## How to provision the Device Update agent as a Module Identity
69+
4970
This section describes how to provision the Device Update agent as a module identity on IoT Edge enabled devices, non-Edge IoT devices, and other IoT devices.
5071

72+
5173
### On IoT Edge enabled devices
74+
5275
Follow these instructions to provision the Device Update agent on [IoT Edge enabled devices](https://docs.microsoft.com/azure/iot-edge).
53-
1. Follow the instructions to [Install and provision the Azure IoT Edge runtime](https://docs.microsoft.com/azure/iot-edge/how-to-install-iot-edge?view=iotedge-2020-11&preserve-view=true).
54-
2. Then install the Device Update agent from [Artifacts](https://github.com/Azure/iot-hub-device-update/releases) and you are now ready to start the Device Update agent on your IoT Edge device.
76+
77+
1. Follow the instructions to [Install and provision the Azure IoT Edge runtime](https://docs.microsoft.com/azure/iot-edge/how-to-install-iot-edge?view=iotedge-2020-11&preserve-view=true).
78+
79+
1. Then install the Device Update agent from [Artifacts](https://github.com/Azure/iot-hub-device-update/releases) and you are now ready to start the Device Update agent on your IoT Edge device.
80+
5581

5682
### On non-Edge IoT Linux devices
83+
5784
Follow these instructions to provision the Device Update agent on your IoT Linux devices.
58-
1. Install the IoT Identity Service and add the latest version to your IoT device.
59-
* Log onto the machine or IoT device.
60-
* Open a terminal window.
61-
* Install the latest [IoT Identity Service](https://github.com/Azure/iot-identity-service/blob/main/docs/packaging.md#installing-and-configuring-the-package) on your IoT device using the command below.
62-
```shell
63-
sudo apt-get install aziot-identity-service
64-
```
65-
2. Provisioning IoT Identity service to get the IoT device information.
85+
86+
1. Install the IoT Identity Service and add the latest version to your IoT device.
87+
1. Log onto the machine or IoT device.
88+
1. Open a terminal window.
89+
1. Install the latest [IoT Identity Service](https://github.com/Azure/iot-identity-service/blob/main/docs/packaging.md#installing-and-configuring-the-package) on your IoT device using this command:
90+
91+
```shell
92+
sudo apt-get install aziot-identity-service
93+
```
94+
95+
1. Provisioning IoT Identity service to get the IoT device information.
6696
* Create a custom copy of the configuration template so we can add the provisioning information. In a terminal, enter the below command.
67-
```shell
68-
sudo cp /etc/aziot/config.toml.template /etc/aziot/config.toml
69-
```
97+
98+
```shell
99+
sudo cp /etc/aziot/config.toml.template /etc/aziot/config.toml
100+
```
70101

71-
3. Next edit the configuration file to include the connection string of the device you wish to act as the provisioner for this device or machine. In a terminal, enter the below command.
72-
```shell
73-
sudo nano /etc/aziot/config.toml
74-
```
102+
1. Next edit the configuration file to include the connection string of the device you wish to act as the provisioner for this device or machine. In a terminal, enter the below command.
103+
104+
```shell
105+
sudo nano /etc/aziot/config.toml
106+
```
75107

76-
4. You should be greeted with a view like below:
77-
:::image type="content" source="media/understand-device-update/config.png" alt-text="Diagram of IoT Identity Service config file." lightbox="media/understand-device-update/config.png":::
78-
* In the same nano window, find the block with “Manual provisioning with connection string”.
79-
* In the window, delete the “#” symbol ahead of 'provisioning'
80-
* In the window, delete the “#” symbol ahead of 'source'
81-
* In the window, delete the “#” symbol ahead of 'connection_string'
82-
* In the window, delete the string within the quotes to the right of 'connection_string' and then add your connection string there
83-
* Save your changes to the file with 'Ctrl+X' and then 'Y' and hit the 'enter' key to save your changes.
84-
5. Now apply and restart the IoT Identity service with the command below. You should now see a “Done!” printout that means you have successfully configured the IoT Identity Service. Note: The IoT Identity service registers module identities with IoT Hub using symmetric keys currently.
85-
```shell
86-
sudo aziotctl config apply
87-
```
88-
6. Finally install the Device Update agent from [Artifacts](https://github.com/Azure/iot-hub-device-update/releases) and you are now ready to start the Device Update agent on your IoT Edge device.
108+
1. You should see a message like the following example:
109+
110+
:::image type="content" source="media/understand-device-update/config.png" alt-text="Diagram of IoT Identity Service config file." lightbox="media/understand-device-update/config.png":::
111+
112+
1. In the same nano window, find the block with “Manual provisioning with connection string”.
113+
1. In the window, delete the “#” symbol ahead of 'provisioning'
114+
1. In the window, delete the “#” symbol ahead of 'source'
115+
1. In the window, delete the “#” symbol ahead of 'connection_string'
116+
1. In the window, delete the string within the quotes to the right of 'connection_string' and then add your connection string there
117+
1. Save your changes to the file with 'Ctrl+X' and then 'Y' and hit the 'enter' key to save your changes.
118+
119+
1. Now apply and restart the IoT Identity service with the command below. You should now see a “Done!” printout that means you have successfully configured the IoT Identity Service.
120+
121+
> [!Note]
122+
> The IoT Identity service registers module identities with IoT Hub by using symmetric keys currently.
123+
124+
```shell
125+
sudo aziotctl config apply
126+
```
127+
128+
1. Finally install the Device Update agent from [Artifacts](https://github.com/Azure/iot-hub-device-update/releases) and you are now ready to start the Device Update agent on your IoT Edge device.
129+
89130

90131
### Other IoT devices
132+
91133
The Device Update agent can also be configured without the IoT Identity service for testing or on constrained devices. Follow the below steps to provision the Device Update agent using a connection string (from the Module or Device).
134+
92135
1. Install Device Update agent from [Artifacts](https://github.com/Azure/iot-hub-device-update/releases).
93-
2. Log onto the machine or IoT Edge device/IoT device.
94-
3. Open a terminal window.
95-
4. Add the connection string to the [Device Update configuration file](device-update-configuration-file.md):
96-
* Enter the below in the terminal window:
97-
- [Package updates](device-update-ubuntu-agent.md) use: sudo nano /etc/adu/adu-conf.txt
98-
- [Image updates](device-update-raspberry-pi.md) use: sudo nano /adu/adu-conf.txt
99-
* You should see a window open with some text in it. Delete the entire string following 'connection_String=' the first-time you provision the Device Update agent on the IoT device. It is just place holder text.
100-
* In the terminal, replace <your-connection-string> with the connection string of the device for your instance of Device Update agent (NOTE DO NOT ADD QUOTES AROUND THE CONNECTION STRING)
101-
- connection_string=<your-connection-string>
102-
* Enter and save.
103-
5. Now you are now ready to start the Device Update agent on your IoT Edge device.
136+
137+
1. Log onto the machine or IoT Edge device/IoT device.
138+
139+
1. Open a terminal window.
140+
141+
1. Add the connection string to the [Device Update configuration file](device-update-configuration-file.md):
142+
1. Enter the below in the terminal window:
143+
- [Package updates](device-update-ubuntu-agent.md) use: sudo nano /etc/adu/adu-conf.txt
144+
- [Image updates](device-update-raspberry-pi.md) use: sudo nano /adu/adu-conf.txt
145+
146+
1. You should see a window open with some text in it. Delete the entire string following 'connection_String=' the first-time you provision the Device Update agent on the IoT device. It is just place holder text.
147+
148+
1. In the terminal, replace <your-connection-string> with the connection string of the device for your instance of Device Update agent.
149+
150+
> [!Important]
151+
> Do not add quotes around the connection string.
152+
153+
- connection_string=<your-connection-string>
154+
155+
1. Enter and save.
156+
157+
1. Now you are now ready to start the Device Update agent on your IoT Edge device.
158+
104159

105160
## How to start the Device Update Agent
161+
106162
This section describes how to start and verify the Device Update agent as a module identity running successfully on your IoT device.
163+
107164
1. Log into the machine or device that has the Device Update agent installed.
108-
2. Open a Terminal window, and enter the command below.
109-
```shell
110-
sudo systemctl restart adu-agent
111-
```
112-
3. You can check the status of the agent using the command below. If you see any issues, refer to this [troubleshooting guide](troubleshoot-device-update.md).
113-
```shell
114-
sudo systemctl status adu-agent
115-
```
116-
4. You should see status OK.
117-
5. On the IoT Hub portal, go to IoT device or IoT Edge devices to find the device that you configured with Device Update agent. There you will see the Device Update agent running as a module, For example:
118-
:::image type="content" source="media/understand-device-update/device-update-module.png " alt-text="Diagram of Device Update module name." lightbox="media/understand-device-update/device-update-module.png":::
165+
166+
1. Open a Terminal window, and enter the command below.
167+
```shell
168+
sudo systemctl restart adu-agent
169+
```
170+
171+
1. You can check the status of the agent using the command below. If you see any issues, refer to this [troubleshooting guide](troubleshoot-device-update.md).
172+
```shell
173+
sudo systemctl status adu-agent
174+
```
175+
176+
You should see status OK.
177+
178+
1. On the IoT Hub portal, go to IoT device or IoT Edge devices to find the device that you configured with Device Update agent. There you will see the Device Update agent running as a module. For example:
179+
180+
:::image type="content" source="media/understand-device-update/device-update-module.png " alt-text="Diagram of Device Update module name." lightbox="media/understand-device-update/device-update-module.png":::
181+
119182

120183
## How to build and run Device Update Agent
184+
121185
You can also build and modify your own customer Device Update agent.
122186

123187
Follow the instructions to [build](https://github.com/Azure/iot-hub-device-update/blob/main/docs/agent-reference/how-to-build-agent-code.md) the Device Update Agent
@@ -129,19 +193,21 @@ the agent.
129193
Now, make the changes needed to incorporate the agent into your image. Look at how to
130194
[modify](https://github.com/Azure/iot-hub-device-update/blob/main/docs/agent-reference/how-to-modify-the-agent-code.md) the Device Update Agent for guidance.
131195
132-
## Troubleshooting Guide
196+
197+
## Troubleshooting guide
133198
134199
If you run into issues, review the Device Update for IoT Hub [Troubleshooting Guide](troubleshoot-device-update.md) to help unblock any possible issues and collect necessary information to provide to Microsoft.
135200
136-
## Next Steps
137201
138-
Use below pre-built images and binaries for an easy demonstration of Device Update for IoT Hub.
202+
## Next steps
203+
204+
You can use the following pre-built images and binaries for a simple demonstration of Device Update for IoT Hub:
139205
140-
[Image Update: Getting Started with Raspberry Pi 3 B+ Reference Yocto Image](device-update-raspberry-pi.md) extensible via open source to build you own images for other architecture as needed.
206+
- [Image Update: Getting Started with Raspberry Pi 3 B+ Reference Yocto Image](device-update-raspberry-pi.md) extensible via open source to build you own images for other architecture as needed.
141207
142-
[Getting Started Using Ubuntu (18.04 x64) Simulator Reference Agent](device-update-simulator.md)
208+
- [Getting Started Using Ubuntu (18.04 x64) Simulator Reference Agent](device-update-simulator.md)
143209
144-
[Package Update:Getting Started using Ubuntu Server 18.04 x64 Package agent](device-update-ubuntu-agent.md)
210+
- [Package Update:Getting Started using Ubuntu Server 18.04 x64 Package agent](device-update-ubuntu-agent.md)
145211
146-
[Device Update for Azure IoT Hub tutorial for Azure-Real-Time-Operating-System](device-update-azure-real-time-operating-system.md)
212+
- [Device Update for Azure IoT Hub tutorial for Azure-Real-Time-Operating-System](device-update-azure-real-time-operating-system.md)
147213

0 commit comments

Comments
 (0)