Issue when registering device through IDAS

218 views Asked by At

I'm using IDAS and i've previously registered 4 virtual sensors and i had no problem with it. After making tests with those sensors (a month ago from now or so) i went and tryed to register another sensor with no success.

My request:

python2.7 RegisterDevice.py SENSOR_TEMP sensortest3 sensortest3

The response:

* opening: ./devices/SENSOR_TEMP
* Asking to http://130.206.80.40:5371/iot/devices
* Headers: {'Fiware-Service': 'fiwaretestapi', 'content-type': 'application/json', 'Fiware-ServicePath': '/', 'X-Auth-Token': 'NULL'}
* Headers: {'Fiware-Service': 'fiwaretestapi', 'content-type': 'application/json', 'Fiware-ServicePath': '/', 'X-Auth-Token': 'NULL'}
* Sending PAYLOAD:
{
    "devices": [
        {
            "entity_name": "sensortest3",
            "entity_type": "thing",
            "static_attributes": [
                {
                    "type": "string",
                    "name": "att_name",
                    "value": "value"
                }
            ],
            "timezone": "Europe/Madrid",
            "attributes": [
                {
                    "type": "int",
                    "name": "temperature",
                    "object_id": "t"
                }
            ],
            "device_id": "sensortest3"
        }
    ]
}

...

* Status Code: 400
* Response:
{"reason":"The request is not well formed","details":"Missing required property: protocol [/devices[0]]"}

As you can see by my ListDevices.py request, i have 4 sensors registered:

* Asking to http://130.206.80.40:5371/iot/devices
* Headers: {'Fiware-Service': 'fiwaretestapi', 'content-type': 'application/json', 'Fiware-ServicePath': '/', 'X-Auth-Token': 'NULL'}
...

* Status Code: 200
* Response:
{ "count": 4,"devices": [{ "device_id" : "autocarro1" },{ "device_id" : "bustest3" },{ "device_id" : "bustest4" },{ "device_id" : "bustest5" }]}

Is there a limit or something to a number of devices in IDAS?

2

There are 2 answers

0
arkabide On BEST ANSWER

You just need to add the required property "protocol":

{"devices": [{"entity_name": "sensortest3",...,"protocol" : "PDI-IoTA-UltraLight", ... }]}
1
lucas On

We have released version 1.0.1 and I think you use this version. Any previous version was from develop branch and unstable. In 1.0.1 a device must have an assigned protocol (this concept from IoTA Manager is mapped to IoTA). In github repository (http://github.com/telefonicaid/fiware-IoTAgent-Cplusplus), there is branch reléase/1.0.1 with doc directory. In modules.md you can see protocol identifiers that you can use. In your case, I think you use Ultra Light protocol, the protocol field in device provisioning is PDI-IoTA-UltraLight.