3

I've had some troubles getting the expected results doing the exercises from http://www.slideshare.net/FI-WARE/io-t-basicexercisesdevelopersweek

No problem when registering a new device, its entity it's also successfully created on Orion CB but when querying for the created Entity non of the device attributes are shown. Created Entity just have TimeInstant attribute.

I get a 200 response code when sending observations but it apparently has noeffect since Entity attributes on CB are missing.

Registering device

  • URL: /iot/devices
  • Method: POST
  • Payload:

JSON

{
 "devices": [
    {
        "device_id": "14:da:e9",
        "entity_name": "Thing12",
        "entity_type": "Thing12Type",
        "protocol": "PDI-IoTA-UltraLight",
        "timezone": "Europe/Madrid",
        "attributes": [
            {
                "name": "weight",
                "type": "double",
                "object_id": "weight"
            },
            {
                "name": "valid",
                "type": "boolean",
                "object_id": "valid"
            }
        ]
    }
 ]
}

Listing devices

  • URL: /iot/devices/14:da:e9
  • Method: GET

JSON

{
"device_id": "14:da:e9",
"entity_name": "Thing12",
"entity_type": "Thing12Type",
"protocol": "PDI-IoTA-UltraLight",
"timezone": "Europe/Madrid",
"attributes": [
    {
        "name": "weight",
        "type": "double",
        "object_id": "weight"
    },
    {
        "name": "valid",
        "type": "boolean",
        "object_id": "valid"
    }
],
"service": "openiot",
"service_path": "/"
}

Querying CB

  • URL: /ngsi10/contextEntities/Thing12
  • Method: GET

JSON

{
"contextElement": {
    "type": "Thing12Type",
    "isPattern": "false",
    "id": "Thing12",
    "attributes": [
        {
            "name": "TimeInstant",
            "type": "ISO8601",
            "value": "2015-06-25T13:07:18.354970Z"
        }
    ]
},
"statusCode": {
    "code": "200",
    "reasonPhrase": "OK"
}
}
arkabide
  • 76
  • 4
  • Ironically, if I send observations for a non existing device on IDAS, a brand new entity is created at Orion CB with the corresponding attributes and values. By using the created entityId ("thing:"+URLGivenInventedId) I can even update every attributes' values which is, obviously, the expected behaviour. What am I missing? – arkabide Jun 26 '15 at 08:15

2 Answers2

1

The problem seems to be on image orion-psb-image-R4.2. After launching a new instance (CentOS-6.3init) and installing every component manually the problem seem solved. Maybe a conflict between versions in previous instance.

arkabide
  • 76
  • 4
0

Attributes are created in the ContextBroker as soon as you send observations related to those properties. Just try to send observations for "weight" and "valid" and your should be able to see those attributes at the ContextBroker related Entity.

Let us know if that worked for you.

The behaviour you observed for the non-created device was intentionally designed so that devices registration might be optional (although we do not recommend it).

Thanks for using IDAS!

Carlos Ralli
  • 316
  • 1
  • 3
  • 1
    Hi Carlos, thanks for your answer. I had already tried it but unfortunately I can't make it work. I post to /d?k=4jggokgpepnvsb2uv4s40d59ov&i=14:da:e9 some observations as 'weight|45#valid|true' and, even though I get a 200 response code, none of the attributes are shown on CB entity. I have tried: 'weight|45#valid|true', "weight|45#valid|true", weight|45#valid|true, just one attribute, but nothing happens on CB. I have even renamed attribute object_id to a one single letter name just in case the mistake was there but it was not the case. I hope you can help me. – arkabide Jun 30 '15 at 07:14