我正在尝试配置设备并使用 1 个 Orion 组件发送回驱动命令。
我已成功配置用于更新 Orion 查询的设备:
curl -iX POST \
'http://orion:1024/v2/op/update' \
-H 'Content-Type: application/json' \
-H 'fiware-service: agriculture' \
-H 'fiware-servicepath: /agriculture' \
-d '{
"actionType":"update",
"entities":[{"motor":{"type":"command","value":{"requestTime":"2023-11-17T06:50:00.060",
"payload":{"motor_status":"on","requestTimestamp":"2023-11-17T18:49:59.091",
"motor_status":"on"},"transactionId":"xxxx-87a5-4xxx2-xxx-xxxxxxx"}},"id":"urn:ngsi-ld:test:test1","type":"test"}]}
我面临着,经过尝试,我得到了这个错误:
{"error":"NotFound","description":"The requested entity has not been found. Check type and id"}
猎户座报道时
fiware-orion 开始交易到 http://orion:1024/v2/op/update
fiware-orion | ERROR@10:16:34 postUpdateContext.cpp[190]:Runtime Error (error 'Timeout was reached' forwarding 'Update' to providing application)
fiware-orion | INFO@10:16:34 logMsg.h[1874]: Transaction ended
提前感谢您,感谢您的帮助!
您的提供商不正确。您已使用批量更新插入操作在 Orion 中创建一个名为
urn:ngsi-ld:test:test1
的实体。然而,您的注册是循环的,它将 "attrs": ["on", "off"]
转发到 http://orion:1024/v2/op/update
- 这意味着注册服务将在 http://orion:1024/v2/op/update/v2/op/update
上收到不存在的批量请求。
即使您将提供程序更改为
http://orion:1024
,这仍然是错误的,因为上下文代理不应该直接注册回自身 - 您应该使用另一个微服务,例如IoT Agent来将 NGSI 驱动请求向下转换设备可以理解的低级协议。