[英]DEVICE_GROUP_NOT_FOUND in iotagent-ul
I'm trying to send measurements using IoT Agent UL2.0.我正在尝试使用 IoT 代理 UL2.0 发送测量值。
First, I created a device as follows:首先,我创建了一个设备如下:
POST /iot/devices HTTP/1.1
Host: localhost:4061
Fiware-Service: Empresa1
Fiware-ServicePath: /empresa1
Content-Type: application/json
Cache-Control: no-cache
{
"devices": [
{
"device_id": "A6",
"entity_name": "A6",
"entity_type": "E6",
"attributes": [
{ "object_id": "a", "name": "aaa", "type": "text" },
{ "object_id": "b", "name": "bbb", "type": "text" },
{ "object_id": "c", "name": "ccc", "type": "text" }
]
}
]
}
Then I'm trying to send measurements as follows:然后我尝试按如下方式发送测量值:
POST /iot/d?i=A6&k=A6&d=a|7|b|7|c|7 HTTP/1.1
Host: localhost:7896
Fiware-Service: Empresa1
Fiware-ServicePath: /empresa1
Content-Type: text/plain
Cache-Control: no-cache
But I'm getting the following error:但我收到以下错误:
{
"name": "DEVICE_GROUP_NOT_FOUND",
"message": "Couldn\t find device group"
}
What the device group
is? device group
是什么?
Thanks!谢谢!
I figured out how to solve it.我想出了解决办法。
I just changed config.defaultTransport
to HTTP
in config.js
and used TEF
as apikey.我刚刚在
config.js
中将config.defaultTransport
更改为HTTP
,并使用TEF
作为 apikey。
The request that effectively sent measures to Orion was the following:有效向 Orion 发送措施的请求如下:
POST /iot/d?i=A6&k=TEF&d=a|7|b|7|c|7 HTTP/1.1
Host: localhost:7896
Fiware-Service: Empresa1
Fiware-ServicePath: /empresa1
Content-Type: text/plain
Cache-Control: no-cache
I hope this helps somebody.我希望这对某人有帮助。
be careful, you need to configure a service, so that you can use your own API KEY, and that can be done by issuing an HTTP request like this小心,你需要配置一个服务,这样你就可以使用你自己的 API KEY,这可以通过发出这样的 HTTP 请求来完成
POST http://130.206.80.40:5371/iot/services Headers: { 'Content-Type': 'application/json', 'X-Auth-Token' : '[TOKEN]', 'Fiware-Service': 'openiot', 'Fiware-ServicePath': '/' } Payload: { "services": [ { "apikey": "4jggokgpepnvsb2uv4s40d59ov", "cbroker": "http://0.0.0.0:1026", "entity_type": "thing", "resource": "/iot/d" } ] }
The previous answer from jose-manuel-cantera is correct. jose-manuel-cantera 之前的回答是正确的。 Also, pay attention in the
resource
field should start with a slash /
.另外,注意
resource
字段应该以斜杠/
开头。 I was having the same issue as yours, see this ticket https://github.com/telefonicaid/iotagent-ul/issues/459 .我遇到了与您相同的问题,请参阅此票证https://github.com/telefonicaid/iotagent-ul/issues/459 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.