簡體   English   中英

通過IDAS注冊設備時出現的問題

[英]Issue when registering device through IDAS

我正在使用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中的設備數量是否有限制?

我們已經發布了版本1.0.1,我認為您使用的是此版本。 任何以前的版本都來自develop分支,並且不穩定。 在1.0.1中,設備必須具有分配的協議(IoTA Manager中的此概念已映射到IoTA)。 在github存儲庫( http://github.com/telefonicaid/fiware-IoTAgent-Cplusplus )中,存在帶有文檔目錄的reléase/ 1.0.1分支。 在modules.md中,您可以看到可以使用的協議標識符。 就您而言,我認為您使用的是Ultra Light協議,設備配置中的協議字段為PDI-IoTA-UltraLight。

您只需要添加所需的屬性“協議”:

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM