FIWARE-IoT Agent:通过MQTT向设备发送命令
FIWARE-IoT Agent: send command to device via MQTT
我正在使用 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,所以提交的 endpoint 没有在我的案例中使用,但是如果我删除它,MQTT 不会通知我的设备。
此请求有效,但它是否是创建能够通过 MQTT 向我的设备发送命令的设备的正确方法?
在此先感谢您的帮助!
[1]https://github.com/telefonicaid/fiware-IoTAgent-Cplusplus
此字段 ("endpoint": "notUsed") 来自以前不再实现的功能(在 MQTT 中没有意义)。因此,从最近的版本开始,它被忽略并且可以被删除。也许您使用的是以前版本的 IoT 代理,这就是为什么它是强制性的,但不是功能性的。
感谢使用IDAS!
我正在使用 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,所以提交的 endpoint 没有在我的案例中使用,但是如果我删除它,MQTT 不会通知我的设备。 此请求有效,但它是否是创建能够通过 MQTT 向我的设备发送命令的设备的正确方法?
在此先感谢您的帮助!
[1]https://github.com/telefonicaid/fiware-IoTAgent-Cplusplus
此字段 ("endpoint": "notUsed") 来自以前不再实现的功能(在 MQTT 中没有意义)。因此,从最近的版本开始,它被忽略并且可以被删除。也许您使用的是以前版本的 IoT 代理,这就是为什么它是强制性的,但不是功能性的。
感谢使用IDAS!