通过IDAS注册设备时出现问题

时间:2015-06-15 13:16:00

标签: fiware fiware-orion

我正在使用IDAS,我之前已经注册了4个虚拟传感器,我没有遇到任何问题。在用这些传感器进行测试之后(一个月前从现在开始)我去尝试注册另一个传感器但没有成功。

我的要求:

python2.7 RegisterDevice.py SENSOR_TEMP sensortest3 sensortest3

回应:

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

正如您在ListDevices.py请求中看到的那样,我注册了4个传感器:

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

IDAS中的许多设备是否有限制?

2 个答案:

答案 0 :(得分:1)

我们已发布1.0.1版本,我认为您使用的是此版本。以前的任何版本都来自develop分支和不稳定。在1.0.1中,设备必须具有指定的协议(IoTA Manager中的此概念映射到IoTA)。 在github存储库(http://github.com/telefonicaid/fiware-IoTAgent-Cplusplus)中,有一个带有doc目录的分支reléase/ 1.0.1。在modules.md中,您可以看到可以使用的协议标识符。在您的情况下,我认为您使用Ultra Light协议,设备配置中的协议字段是PDI-IoTA-UltraLight。

答案 1 :(得分:1)

您只需要添加所需的属性" protocol":

{"devices": [{"entity_name": "sensortest3",...,"protocol" : "PDI-IoTA-UltraLight", ... }]}
相关问题