FIWARE-IoT代理:通过MQTT

时间:2015-11-23 10:40:52

标签: fiware iot

我使用FIWARE IoT代理[1]使用MQTT协议与我的设备通信,我创建了一个命令,可以更新我的设备值,这是我创建设备的请求:

curl -X POST http://193.48.247.247:80/iot/devices \
-i \
-H "Content-Type: application/json" \
-H "Fiware-Service: egmsmartcity" \
-H "Fiware-ServicePath: /egmsmartcitypath" \
-d ' { "devices": [ { "device_id": "streetlight1",
 "entity_name": "sensors:streetlight1",
 "entity_type": "sensors",
"protocol": "PDI-IoTA-MQTT-UltraLight",
 "timezone": "Europe/Paris",
 "endpoint": "notUsed",
 "commands": [{ "name": "streetlight1", "type": "command", "value": ""}]  } ] }'

由于我使用的是MQTT,因此我的情况下没有使用提交的端点,但如果删除它,则MQTT不会通知我的设备。 此请求正在运行,但它是否是创建设备以通过MQTT向我的设备发送命令的正确方法?

提前感谢您的帮助!

[1] https://github.com/telefonicaid/fiware-IoTAgent-Cplusplus

1 个答案:

答案 0 :(得分:1)

此字段("端点":" notUsed")来自先前不再实现的功能(在MQTT中没有意义)。因此,从最近的版本开始,它被忽略并且可以被删除。也许您正在使用以前版本的IoT Agent,这就是为什么它是强制性的,尽管它不起作用。

感谢您使用IDAS!