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
This article provides end-to-end instructions for registering and provisioning a Linux IoT Edge device, including installing IoT Edge.
16
+
This article provides end-to-end instructions for registering and provisioning a Linux IoT Edge device, which includes installing IoT Edge.
17
17
18
-
Every device that connects to an IoT hub has a device ID that's used to track cloud-to-device or device-to-cloud communications. You configure a device with its connection information, which includes the IoT hub hostname, the device ID, and the information the device uses to authenticate to IoT Hub.
18
+
Each device that connects to an [IoT hub](../iot-hub/index.yml) has a device ID that's used to track [cloud-to-device](../iot-hub/iot-hub-devguide-c2d-guidance.md) or [device-to-cloud](../iot-hub/iot-hub-devguide-d2c-guidance.md) communications. You configure a device with its connection information, which includes:
19
19
20
-
The steps in this article walk through a process called manual provisioning, where you connect a single device to its IoT hub. For manual provisioning, you have two options for authenticating IoT Edge devices:
20
+
* IoT hub hostname
21
+
* Device ID
22
+
* Authentication details to connect to IoT Hub
23
+
24
+
The steps in this article walk through a process called *manual provisioning*, where you connect a single device to its IoT hub. For manual provisioning, you have two options for authenticating IoT Edge devices:
21
25
22
26
***Symmetric keys**: When you create a new device identity in IoT Hub, the service creates two keys. You place one of the keys on the device, and it presents the key to IoT Hub when authenticating.
23
27
@@ -38,14 +42,27 @@ This article covers using symmetric keys as your authentication method. If you w
38
42
39
43
## Prerequisites
40
44
41
-
This article covers registering your IoT Edge device and installing IoT Edge on it. These tasks have different prerequisites and utilities used to accomplish them. Make sure you have all the prerequisites covered before proceeding.
45
+
This article shows how to register your IoT Edge device and install IoT Edge (also called IoT Edge runtime) on your device. Make sure you have the device management tool of your choice, for example Azure CLI, and device requirements before you register and install your device.
42
46
43
47
<!-- Device registration prerequisites H3 and content -->
@@ -54,7 +71,7 @@ This article covers registering your IoT Edge device and installing IoT Edge on
54
71
55
72
## Provision the device with its cloud identity
56
73
57
-
Now that the container engine and the IoT Edge runtime are installed on your device, you're ready for the next step, which is to set up the device with its cloud identity and authentication information.
74
+
Now that the container engine and the IoT Edge runtime are installed on your device, you're ready to set up the device with its cloud identity and authentication information.
58
75
59
76
<!-- 1.1 -->
60
77
::: moniker range="iotedge-2018-06"
@@ -94,112 +111,138 @@ After entering the provisioning information in the configuration file, restart t
94
111
<!-- iotedge-2020-11 -->
95
112
::: moniker range=">=iotedge-2020-11"
96
113
97
-
You can quickly configure your IoT Edge device with symmetric key authentication using the following command:
114
+
1. You can quickly configure your IoT Edge device with symmetric key authentication using the following command. Replace `PASTE_DEVICE_CONNECTION_STRING_HERE` with your own connection string.
The `iotedge config mp` command creates a configuration file on the device and enters your connection string in the file.
120
+
This`iotedge config mp` command creates a configuration file on the device and enters your connection string in the configuration file.
104
121
105
-
Apply the configuration changes.
122
+
1.Apply the configuration changes.
106
123
107
124
```bash
108
125
sudo iotedge config apply
109
126
```
110
127
111
-
If you want to see the configuration file, you can open it:
128
+
1. To view the configuration file, you can open it:
112
129
113
130
```bash
114
131
sudo nano /etc/aziot/config.toml
115
132
```
116
-
133
+
Verify successful configuration
117
134
<!-- end iotedge-2020-11 -->
118
135
::: moniker-end
119
136
137
+
## Deploy modules
138
+
139
+
To deploy your IoT Edge modules, go to your IoT hub in the Azure portal, then:
140
+
141
+
1. Select **Devices** from the IoT Hub menu.
142
+
143
+
1. Select your device to open its page.
144
+
145
+
1. Select the **Set Modules** tab.
146
+
147
+
1. Since we want to deploy the IoT Edge default modules (edgeAgent and edgeHub), we don't need to add any modules to this pane, so select **Review + create** at the bottom.
148
+
149
+
1. You see the JSON confirmation of your modules. Select **Create** to deploy the modules.<br>
150
+
151
+
For more information, see [Deploy a module](quickstart-linux.md#deploy-a-module).
152
+
120
153
## Verify successful configuration
121
154
122
155
Verify that the runtime was successfully installed and configured on your IoT Edge device.
123
156
124
-
>[!TIP]
125
-
>You need elevated privileges to run `iotedge` commands. Once you sign out of your machine and sign back in the first time after installing the IoT Edge runtime, your permissions are automatically updated. Until then, use `sudo` in front of the commands.
157
+
>[!TIP]
158
+
>You need elevated privileges to run `iotedge` commands. Once you sign out of your machine and sign back in the first time after installing the IoT Edge runtime, your permissions are automatically updated. Until then, use `sudo` in front of the commands.
126
159
127
-
Check to see that the IoT Edge system service is running.
160
+
1.Check to see that the IoT Edge system service is running.
128
161
129
-
<!-- 1.1 -->
130
-
::: moniker range="iotedge-2018-06"
162
+
<!-- 1.1 -->
163
+
::: moniker range="iotedge-2018-06"
131
164
132
165
```bash
133
166
sudo systemctl status iotedge
134
167
```
135
168
136
-
::: moniker-end
169
+
::: moniker-end
137
170
138
-
<!-- iotedge-2020-11 -->
139
-
::: moniker range=">=iotedge-2020-11"
171
+
<!-- iotedge-2020-11 -->
172
+
::: moniker range=">=iotedge-2020-11"
140
173
141
174
```bash
142
175
sudo iotedge system status
143
176
```
144
177
145
-
A successful status response is `Ok`.
178
+
A successful status response shows the `aziot` services as running or ready.
146
179
147
-
::: moniker-end
180
+
::: moniker-end
148
181
149
-
If you need to troubleshoot the service, retrieve the service logs.
182
+
1. To troubleshoot the service, retrieve the service logs.
150
183
151
-
<!-- 1.1 -->
152
-
::: moniker range="iotedge-2018-06"
184
+
<!-- 1.1 -->
185
+
::: moniker range="iotedge-2018-06"
153
186
154
187
```bash
155
188
journalctl -u iotedge
156
189
```
157
190
158
-
::: moniker-end
191
+
::: moniker-end
159
192
160
-
<!-- iotedge-2020-11 -->
161
-
::: moniker range=">=iotedge-2020-11"
193
+
<!-- iotedge-2020-11 -->
194
+
::: moniker range=">=iotedge-2020-11"
162
195
163
196
```bash
164
197
sudo iotedge system logs
165
198
```
166
199
167
-
::: moniker-end
200
+
::: moniker-end
168
201
169
-
Use the `check` tool to verify configuration and connection status of the device.
202
+
1.Use the `check` tool to verify configuration and connection status of the device.
170
203
171
204
```bash
172
205
sudo iotedge check
173
206
```
174
207
175
-
>[!TIP]
176
-
>Always use `sudo` to run the check tool, even after your permissions are updated. The tool needs elevated privileges to access the config file to verify configuration status.
208
+
You can expect a range of responses that may include **OK** (green), **Warning** (yellow), or **Error** (red).
177
209
178
-
>[!NOTE]
179
-
>On a newly provisioned device, you may see an error related to IoT Edge Hub:
180
-
>
181
-
>**× production readiness: Edge Hub's storage directory is persisted on the host filesystem - Error**
182
-
>
183
-
>**Could not check current state of edgeHub container**
184
-
>
185
-
>This error is expected on a newly provisioned device because the IoT Edge Hub module isn't running. To resolve the error, in IoT Hub, set the modules for the device and create a deployment. Creating a deployment for the device starts the modules on the device including the IoT Edge Hub module.
210
+
:::image type="content" source="media/how-to-provision-single-device-linux-symmetric/config-checks.png" alt-text="Screenshot of sample responses from the check command." lightbox="media/how-to-provision-single-device-linux-symmetric/config-checks.png":::
211
+
212
+
>[!TIP]
213
+
>Always use `sudo` to run the check tool, even after your permissions are updated. The tool needs elevated privileges to access the config file to verify configuration status.
214
+
215
+
>[!NOTE]
216
+
>On a newly provisioned device, you may see an error related to IoT Edge Hub:
217
+
>
218
+
>**× production readiness: Edge Hub's storage directory is persisted on the host filesystem - Error**
219
+
>**Could not check current state of edgeHub container**
220
+
>
221
+
>This error is expected on a newly provisioned device because the IoT Edge Hub module is not yet running. Be sure your IoT Edge modules were deployed in the previous steps. Deployment resolves this error.
222
+
>
223
+
>Alternatively, you may see a status code as `417 -- The device's deployment configuration is not set`. Once your modules are deployed, this status will change.
224
+
>
186
225
187
-
View all the modules running on your IoT Edge device. When the service starts for the first time, you should only see the **edgeAgent** module running. The edgeAgent module runs by default and helps to install and start any additional modules that you deploy to your device.
226
+
1. When the service starts for the first time, you should only see the **edgeAgent** module running. The edgeAgent module runs by default and helps to install and start any additional modules that you deploy to your device.
227
+
228
+
Check that your device and modules are deployed and running, by viewing your device page in the Azure portal.
229
+
230
+
:::image type="content" source="media/how-to-provision-single-device-linux-symmetric/modules-deployed.png" alt-text="Screenshot of IoT Edge modules deployed and running confirmation in the Azure portal.":::
231
+
232
+
Once your modules are deployed and running, list them in your device or virtual machine with the following command:
188
233
189
234
```bash
190
235
sudo iotedge list
191
236
```
192
237
193
-
When you create a new IoT Edge device, it will display the status code `417 -- The device's deployment configuration is not set` in the Azure portal. This status is normal, and means that the device is ready to receive a module deployment.
194
-
195
238
## Offline or specific version installation (optional)
196
239
197
240
The steps in this section are for scenarios not covered by the standard installation steps. This may include:
198
241
199
-
* Install IoT Edge while offline
200
-
* Install a release candidate version
242
+
*Installing IoT Edge while offline
243
+
*Installing a release candidate version
201
244
202
-
Use the steps in this section if you want to install a specific version of the Azure IoT Edge runtime that isn't available through your package manager. The Microsoft package list only contains a limited set of recent versions and their sub-versions, so these steps are for anyone who wants to install an older version or a release candidate version.
245
+
Use the steps in this section if you want to install a [specific version of the Azure IoT Edge runtime](version-history.md) that isn't available through your package manager. The Microsoft package list only contains a limited set of recent versions and their sub-versions, so these steps are for anyone who wants to install an older version or a release candidate version.
203
246
204
247
Using curl commands, you can target the component files directly from the IoT Edge GitHub repository.
0 commit comments