2017-02-16 26 views
1

我在嘗試使用IoT Agent UL2.0發送測量結果。DEVICE_GROUP_NOT_FOUND in iotagent-ul

首先,我創建了一個設備如下:

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" 
} 

device group是什麼?

謝謝!

回答

1

我想出瞭如何解決它。

我剛剛將config.defaultTransport更改爲HTTP,config.js並將TEF用作apikey。

,有效地送到措施,獵戶座的要求是以下幾點:

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 

我希望這可以幫助別人。

1

要小心,你需要配置服務,使您可以使用自己的API KEY,並能夠通過發出這樣

 

    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請求來完成