首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >将模块部署到物联网边缘设备时发生错误(错误代码:Argumentinvalid)

将模块部署到物联网边缘设备时发生错误(错误代码:Argumentinvalid)
EN

Stack Overflow用户
提问于 2022-06-01 09:32:03
回答 1查看 139关注 0票数 0

我试图部署一个Modbus模块从物联网集线器到物联网边缘设备,但我有一些困难。

我使用的码头形象:

代码语言:javascript
运行
复制
mcr.microsoft.com/azureiotedge/modbus:1.0

容器创建选项:(我使用了这个信标,因为我使用这个模块从modbus rtu设备读取数据)

代码语言:javascript
运行
复制
{
  "HostConfig": {
    "Devices": [
      {
        "PathOnHost": "/dev/ttyS0", 
        "PathInContainer": "/dev/ttyS0",
        "CgroupPermissions": "rwm"
      }
    ]
  }
}

模块:

代码语言:javascript
运行
复制
{  
      "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"
              }
            }
          }
        }
      }
    }

错误:

代码语言:javascript
运行
复制
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 ''.

带有教程的GitHub链接

EN

回答 1

Stack Overflow用户

发布于 2022-06-01 14:05:56

看起来,您应该在JSON中将“想要的”节点设置为一个单独的节点。例如:

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72459531

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档