Fiware 添加嵌套的OPC-UA变量将导致;字符串不能强制为nodeId; 错误:无法将字符串强制为nodeId

Fiware 添加嵌套的OPC-UA变量将导致;字符串不能强制为nodeId; 错误:无法将字符串强制为nodeId,fiware,fiware-orion,opc-ua,Fiware,Fiware Orion,Opc Ua,嗨, 我正忙着使用代理在Orion Broker和带有OPC-UA服务器的PLC之间建立连接。 我成功地设置了所有部件,并且能够接收(测试)数据,但是我无法按照教程使用json文件向Orion Broker添加实体: curl http://localhost:4001/iot/devices -H "fiware-service: plcservice" -H "fiware-servicepath: /demo" -H &

嗨, 我正忙着使用代理在Orion Broker和带有OPC-UA服务器的PLC之间建立连接。 我成功地设置了所有部件,并且能够接收(测试)数据,但是我无法按照教程使用json文件向Orion Broker添加实体:

curl http://localhost:4001/iot/devices      -H "fiware-service: plcservice"      -H "fiware-servicepath: /demo"      -H "Content-Type: application/json"      -d @add_device.json
{ 
"devices": [
    {
        "device_id": "plc1",
        "entity_name": "PLC1",
        "entity_type": "plc",
        "attributes": [
            
            {
                "object_id": "ns*4:s*MAIN.mainVar",
                "name": "main",
                "type": "Number"
            }
        ],
        "lazy": [
        ],
        "commands" : []
  }
]
预期结果将是使用提供的数据向OrionBroker添加实体,但这只会导致错误消息:

{"name":"Error","message":"String cannot be coerced to a nodeId : ns*4:s*MAIN.mainVar"}
可疑错误 IoAgent是否可能无法很好地处理嵌套变量

采取的步骤
  • 双重检查OPC数据的可用性:
    • OPC数据每秒更改一次,可以在代理日志中看到
  • 降低了设置的复杂性,仅包括代理和物联网代理

其他信息: 添加_device.json文件:

curl http://localhost:4001/iot/devices      -H "fiware-service: plcservice"      -H "fiware-servicepath: /demo"      -H "Content-Type: application/json"      -d @add_device.json
{ 
"devices": [
    {
        "device_id": "plc1",
        "entity_name": "PLC1",
        "entity_type": "plc",
        "attributes": [
            
            {
                "object_id": "ns*4:s*MAIN.mainVar",
                "name": "main",
                "type": "Number"
            }
        ],
        "lazy": [
        ],
        "commands" : []
  }
]
}


物联网代理的配置(来自localhost:4081/config):


我是iotagent opcua repo的维护者之一,我们已经识别并修复了您正在解决的错误,请将您的代理更新到最新版本(1.4.0)


如果您从未听说过,从1.3.8开始,我们引入了一个新的配置属性“relaxTemplateValidation”,它允许您使用以前禁止使用的字符(例如=和;)。我建议您在提供的配置示例中查看它。

这就解决了问题