Azure topic and sending message over MQTT

早过忘川 提交于 2019-12-13 20:17:42

问题


Is it possible to send messages to azure to any custom topic via mqtt. All example that I've found so far work with standard topics

'devices/' + hubName + '/messages/events/'
'devices/' + hubName + '/messages/devicebound/#'

Btw, I tried to send/subscribe on the topic/subscription above with MQTT.fx application and never received messages, although the connection was successful.


回答1:


Did you have a look on these ??

Azure IoT Hub - Send message (C2D) to one device on 2 topics instead of devicebound/#

Can I send a message to a group of Azure IoT Hub Devices connected via MQTT WebSocket?

https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-c2d-guidance




回答2:


The topic filter of devices/{device_id}/messages/devicebound/# is to subscribe receiving message from IoT Hub(Cloud-To-Device message), it think you need to understand the difference about device-to-cloud message and cloud-to-device message from here. The topic of devices/{device_id}/messages/events/ is for sending a device-to-cloud message from device.

You can use Device Explorer to test this issue. When you send a message to device with the tool, MQTT.fx will receive the message.



来源:https://stackoverflow.com/questions/51104579/azure-topic-and-sending-message-over-mqtt

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!