我试图部署一个Modbus模块从物联网集线器到物联网边缘设备,但我有一些困难。
我使用的码头形象:
mcr.microsoft.com/azureiotedge/modbus:1.0
容器创建选项:(我使用了这个信标,因为我使用这个模块从modbus rtu设备读取数据)
{
"HostConfig": {
"Devices": [
{
"PathOnHost": "/dev/ttyS0",
"PathInContainer": "/dev/ttyS0",
"CgroupPermissions": "rwm"
}
]
}
}
模块:
{
"properties.desired":{
"PublishInterval": "5000",
"SlaveConfigs": {
"Slave01": {
"SlaveConnection": "<IPV4 address>",
"TcpPort": "502",
"RetryCount": "10",
"RetryInterval": "100",
"HwId": "PowerMeter-0a:01:01:01:01:01",
"Operations": {
"Op01": {
"PollingInterval": "2000",
"UnitId": "1",
"StartAddress": "400001",
"Count": "2",
"CorrelationId": "MessageType1",
"DisplayName": "Voltage"
},
"Op02": {
"PollingInterval": "2000",
"UnitId": "1",
"StartAddress": "400002",
"Count": "2",
"CorrelationId": "MessageType2",
"DisplayName": "Current"
}
}
},
"Slave02": {
"SlaveConnection": "/dev/ttyS0",
"RetryCount": "10",
"RetryInterval": "50",
"HwId": "mfm",
"BaudRate": "9600",
"DataBits": "8",
"StopBits": "1",
"Parity": "NONE",
"FlowControl": "NONE",
"Operations": {
"Op01": {
"PollingInterval": "2000",
"UnitId": "1",
"StartAddress": "40001",
"Count": "2",
"DisplayName": "Voltage"
},
"Op02": {
"PollingInterval": "2000",
"UnitId": "1",
"StartAddress": "40002",
"Count": "2",
"DisplayName": "Current"
}
}
}
}
}
}
错误:
Set Modules
An error occurred while submitting. The request contained incorrectly formatted information.
Details: ErrorCode:Argumentinvalid; Property or Tag name has invalid characters. Error in Property/Tag properties.desired. Must not contain Control Characters,
'.', '$', '#', or ''.
发布于 2022-06-01 14:05:56
看起来,您应该在JSON中将“想要的”节点设置为一个单独的节点。例如:
https://stackoverflow.com/questions/72459531
复制相似问题