Skip to content

Commit 64ba20f

Browse files
Update device-update-raspberry-pi.md
1 parent f441c22 commit 64ba20f

File tree

1 file changed

+69
-73
lines changed

1 file changed

+69
-73
lines changed

articles/iot-hub-device-update/device-update-raspberry-pi.md

Lines changed: 69 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -107,97 +107,94 @@ Two configuration files must be on the device so that Device Update for IoT Hub
107107
## Configure the Device Update agent on Raspberry Pi
108108

109109
1. Make sure that Raspberry Pi 3 is connected to the network.
110-
1. Follow these instructions to add the configuration details:
110+
1. SSH into the Raspberry Pi 3 by using the following command in the PowerShell window:
111111

112-
1. First, SSH in to the machine by using the following command in the PowerShell window:
113-
114-
```shell
115-
ssh raspberrypi3 -l root
116-
```
112+
```shell
113+
ssh raspberrypi3 -l root
114+
```
117115

118-
1. The DU configuration files (du-config.json and du-diagnostics-config.json) must be on the device so that Device Update for IoT Hub configures properly.
119-
To create or open the `du-config.json` file for editing by using:
116+
1. The DU configuration files (du-config.json and du-diagnostics-config.json) must be on the device so that Device Update for IoT Hub configures properly.
117+
1. To create or open the `du-config.json` file for editing by using:
120118

121119
```bash
122-
nano /adu/du-config.json
120+
nano /adu/du-config.json
123121
```
124122

125-
1. After you run the command, you should see an open editor with the file. If you've never created the file, it will be empty. Now copy the below du-config.json contents, and substitute the configurations required for your device. Then replace the example connection string with the one for the device you created in the preceding steps.
126-
127-
### du-config.json
128-
129-
```JSON
130-
{
131-
"schemaVersion": "1.0",
132-
"aduShellTrustedUsers": [
133-
"adu",
134-
"do"
135-
],
136-
"manufacturer": "contoso",
137-
"model": "virtual-vacuum-v2",
138-
"agents": [
139-
{
140-
"name": "main",
141-
"runas": "adu",
142-
"connectionSource": {
143-
"connectionType": "string",
144-
"connectionData": "HostName=example-connection-string.azure-devices.net;DeviceId=example-device;SharedAccessKey=M5oK/rOP12aB5678YMWv5vFWHFGJFwE8YU6u0uTnrmU="
145-
},
146-
"manufacturer": "contoso",
147-
"model": "virtual-vacuum-v2"
148-
}
149-
]
150-
}
151-
```
152-
123+
2. After you run the command, you should see an open editor with the file. If you've never created the file, it will be empty. Now copy the below du-config.json contents, and substitute the configurations required for your device. Then replace the example connection string with the one for the device you created in the preceding steps.
124+
125+
### du-config.json
126+
127+
```JSON
128+
{
129+
"schemaVersion": "1.0",
130+
"aduShellTrustedUsers": [
131+
"adu",
132+
"do"
133+
],
134+
"manufacturer": "contoso",
135+
"model": "virtual-vacuum-v2",
136+
"agents": [
137+
{
138+
"name": "main",
139+
"runas": "adu",
140+
"connectionSource": {
141+
"connectionType": "string",
142+
"connectionData": "HostName=example-connection-string.azure-devices.net;DeviceId=example-device;SharedAccessKey=M5oK/rOP12aB5678YMWv5vFWHFGJFwE8YU6u0uTnrmU="
143+
},
144+
"manufacturer": "contoso",
145+
"model": "virtual-vacuum-v2"
146+
}
147+
]
148+
}
149+
```
153150
154-
1. After you finish your changes, select `Ctrl+X` to exit the editor. Then enter `y` to save the changes.
155-
156-
1. Now you need to create the `du-diagnostics-config.json` file by using similar commands. Start by creating or opening the `du-diagnostics-config.json` file for editing by using:
151+
3. After you finish your changes, select `Ctrl+X` to exit the editor. Then enter `y` to save the changes.
152+
153+
1. Now you need to create the `du-diagnostics-config.json` file by using similar commands.
154+
1. Start by creating or opening the `du-diagnostics-config.json` file for editing by using:
157155
158156
```bash
159-
nano /adu/du-diagnostics-config.json
157+
nano /adu/du-diagnostics-config.json
160158
```
161159
162-
1. Copy the du-diagnostics-config.json contents provided below, and substitute any configurations that differ from the default build. The example du-diagnostics-config.json file represents the default log locations for Device Update for IoT Hub. You only need to change these default values if your implementation differs.
160+
2. Copy the du-diagnostics-config.json contents provided below, and substitute any configurations that differ from the default build. The example du-diagnostics-config.json file represents the default log locations for Device Update for IoT Hub. You only need to change these default values if your implementation differs.
163161
164162
### du-diagnostics-config.json
165163
166-
```JSON
167-
{
168-
"logComponents":[
169-
{
170-
"componentName":"adu",
171-
"logPath":"/adu/logs/"
172-
},
173-
{
174-
"componentName":"do",
175-
"logPath":"/var/log/deliveryoptimization-agent/"
176-
}
177-
],
178-
"maxKilobytesToUploadPerLogPath":50
179-
}
180-
```
181-
182-
183-
3. After you finish your changes, select `Ctrl+X` to exit the editor. Then enter `y` to save the changes.
184-
4. Use the following command to show the files located in the `/adu/` directory. You should see both of your configuration files.du-diagnostics-config.json files for editing by using:
185-
186-
```bash
187-
ls -la /adu/
188-
```
164+
```JSON
165+
{
166+
"logComponents":[
167+
{
168+
"componentName":"adu",
169+
"logPath":"/adu/logs/"
170+
},
171+
{
172+
"componentName":"do",
173+
"logPath":"/var/log/deliveryoptimization-agent/"
174+
}
175+
],
176+
"maxKilobytesToUploadPerLogPath":50
177+
}
178+
```
179+
3. After you finish your changes, select `Ctrl+X` to exit the editor. Then enter `y` to save the changes.
180+
181+
1. Use the following command to show the files located in the `/adu/` directory. You should see both of your configuration files.du-diagnostics-config.json files for editing by using:
182+
183+
```bash
184+
ls -la /adu/
185+
```
189186
190187
1. Restart the Device Update system daemon to make sure that the configurations were applied. Use the following command within the terminal logged in to the `raspberrypi`:
191188
192-
```bash
193-
systemctl start deviceupdate-agent
194-
```
189+
```bash
190+
systemctl start deviceupdate-agent
191+
```
195192
196193
1. Check that the agent is live by using the following command:
197194
198-
```bash
199-
systemctl status deviceupdate-agent
200-
```
195+
```bash
196+
systemctl status deviceupdate-agent
197+
```
201198
202199
You should see the status appear as alive and green.
203200
@@ -213,9 +210,8 @@ Two configuration files must be on the device so that Device Update for IoT Hub
213210
1. The base and update image files have a version number in the file name.
214211

215212
```markdown
216-
adu-<image type>-image-<machine>-<version number>.<extension>
213+
adu-<image type>-image-<machine>-<version number>.<extension>
217214
```
218-
219215
Use that version number in the later "Import the update" section.
220216

221217
## Add a Device Update group tag to your device

0 commit comments

Comments
 (0)