Device Update 代理从设备上的 du-config.json
文件中获取其配置信息。 代理读取这些值并将其报告给 Device Update 服务:
- AzureDeviceUpdateCore:4.ClientMetadata:4.deviceProperties["manufacturer"]
- AzureDeviceUpdateCore:4.ClientMetadata:4.deviceProperties["model"]
- DeviceInformation.制造商
- 设备信息.模型
- 连接数据
- 连接类型
文件位置
在使用 Linux OS 的 IoT 设备上安装 Debian 代理时,请修改 /etc/adu/du-config.json
文件以更新值。 对于 Yocto 生成系统,在名为 adu
的分区或磁盘中创建一个名为 /adu/du-config.json
的 json 文件。
字段列表
名字 | 说明 |
---|---|
SchemaVersion | 用于映射当前配置文件格式版本的架构版本。 |
aduShellTrustedUsers | 可以启动 adu-shell 程序的用户的列表。 请注意,adu-shell 是一个以“超级用户”身份执行多种更新操作的代理程序。 设备更新默认内容更新处理程序会调用 adu-shell 来执行需要超级用户权限的任务。 需要此特权的任务示例包括 apt-get install 或执行特权脚本。 |
aduc_manufacturer | 由 AzureDeviceUpdateCore:4.ClientMetadata:4 接口报告,用于将设备分类以便定位更新部署的目标。 |
aduc_model | 由 AzureDeviceUpdateCore:4.ClientMetadata:4 接口报告,用于将设备分类以便定位更新部署的目标。 |
连接类型 | 接受的值是 string 或 AIS 。 将设备手动连接到 IoT 中心以便进行测试时,使用 string 。 对于生产方案,在使用 IoT 标识服务将设备连接到 IoT 中心时使用 AIS 。 有关详细信息,请参阅了解 IoT 标识服务配置。 |
连接数据 | 如果 connectionType = "string",请在此处添加 IoT 设备的设备或模块连接字符串。 如果 connectionType = "AIS",请将 connectionData 设置为空字符串 ("connectionData": "" )。 |
制造商 | 由设备更新代理作为 DeviceInformation 接口的一部分报告。 |
模型 | 由设备更新代理作为 DeviceInformation 接口的一部分报告。 |
示例:“du-config.json”文件内容
{
"schemaVersion": "1.1",
"aduShellTrustedUsers": [
"adu",
"do"
],
"manufacturer": <Place your device info manufacturer here>,
"model": <Place your device info model here>,
"agents": [
{
"name": <Place your agent name here>,
"runas": "adu",
"connectionSource": {
"connectionType": "string", //or “AIS”
"connectionData": <Place your Azure IoT device connection string here>
},
"manufacturer": <Place your device property manufacturer here>,
"model": <Place your device property model here>
}
]
}