Fiware Ultralight 2.0 IoTAgent:如何从设备发送测量?

时间:2018-01-30 13:48:43

标签: fiware fiware-orion

我正在使用Fiware平台创建智能城市物联网项目。 我试图运行端到端流程。 我有以下Docker容器在运行。

集装箱码口名称

24f036202f78 0.0.0.0:4041->4041/tcp,.0.0.0:7896->7896/tcp fiware_iotagent_1

81e16c78312e 0.0.0.0:1026->1026/tcp fiware_orion_1

bf699e1acdd3 0.0.0.0:1883->1883/tcp fiware_mosquitto_1

bfc256deddd0 0.0.0.0:27017->27017/tcp fiware_mongo_1

我正在使用以下教程。

http://fiwaretourguide.readthedocs.io/en/latest/connection-to-the-internet-of-things/how-to-read-measures-captured-from-iot-devices/

我可以创建服务和设备。 (数据如下)。

现在,当我发送测量值时,它无法正常工作。

请指导我,我做错了什么?如果可能的话,提供具有逐步示例的参考,以进行端到端的物联网测试。

请求详细信息(使用POSTMAN) 头

Content-Type:text/plain
fiware-service:{{FiwareService}}
fiware-servicepath:{{FiwareServicePath}}
X-Auth-Token:{{AuthToken}}

POST网址: http://130.206.XXX.XXX:4041/iot/d?k=tourguide-devices&i=restaurant-sensor-0115206c51f60b48b77e4c937835795c33bb953f

正文内容: ' T | 25'

响应:

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>Error</title>
    </head>
    <body>
        <pre>Cannot POST /iot/d</pre>
    </body>
</html>

使用IotAgent URL的标头的服务和设备数据,即http://130.206.XXX.XXX:4041/iot/ 标题

Content-Type:application/json
fiware-service:tourguide
fiware-servicepath:/
X-Auth-Token:{{AuthToken}}

服务

{
    "_id": "5a7063e6b8adcc0001c34723",
    "subservice": "/",
    "service": "tourguide",
    "apikey": "tourguide-devices",
    "resource": "/iot/dev-restaurants",
    "attributes": [],
    "lazy": [],
    "commands": [],
    "entity_type": "tourguide-devices",
    "internal_attributes": [],
    "static_attributes": []
}

设备

{
    "device_id": "restaurant-sensor-0115206c51f60b48b77e4c937835795c33bb953f",
    "service": "tourguide",
    "service_path": "/",
    "entity_name": "0115206c51f60b48b77e4c937835795c33bb953f",
    "entity_type": "Restaurant",
    "transport": "HTTP",
    "attributes": [
        {
            "object_id": "t",
            "name": "temperature",
            "type": "number"
        }
    ],
    "lazy": [],
    "commands": [],
    "static_attributes": [],
    "protocol": "UL20"
}

此致

Krishan Babbar

1 个答案:

答案 0 :(得分:1)