Fiware 在IOTUL代理中未找到设备组
我正在尝试使用物联网代理UL2.0发送测量值 首先,我创建了一个设备,如下所示:Fiware 在IOTUL代理中未找到设备组,fiware,Fiware,我正在尝试使用物联网代理UL2.0发送测量值 首先,我创建了一个设备,如下所示: 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",
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" }
]
}
]
}
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
然后我尝试发送如下测量值:
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" }
]
}
]
}
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
但我得到了以下错误:
{
"name": "DEVICE_GROUP_NOT_FOUND",
"message": "Couldn\t find device group"
}
设备组是什么
谢谢 我想出了解决办法
我刚刚在config.js
中将config.defaultTransport
更改为HTTP
,并使用TEF
作为apikey
有效地向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
我希望这对某些人有所帮助。请小心,您需要配置一个服务,以便可以使用自己的API密钥,这可以通过发出这样的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"
}
]
}
邮递http://130.206.80.40:5371/iot/services
标题:
{
“内容类型”:“应用程序/json”,
“X-Auth-Token”:“[Token]”,
“Fiware服务”:“openiot”,
“Fiware服务路径”:“/”
}
有效载荷:
{
“服务”:[
{
“apikey”:“4JGGOGKGPEPNVSB2UV4S40D59OV”,
“cbroker”:http://0.0.0.0:1026",
“实体类型”:“事物”,
“资源”:“/物联网/日”
}
]
}
jose manuel cantera先前的回答是正确的。另外,请注意资源
字段应以斜杠/
开头。我的问题和你的一样,看这张票