0
votes

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
What did you mean about 'never received messages'? Did it mean that the back end can not receive the messages which sent from MQTT.fx(Device-To-Cloud), or MQTT.fx can not receive the messages which sent from service(Cloud-To-Device)?Michael Xu - MSFT
MQTT.fx being subscribed on devices/mydevice/messages/devicebound/#, never received messages sent from MQTT.fx to devices/mydevice/messages/events/ (I use the application as sender and receiver). Connection is established (green light turned on)amplifier

1 Answers

0
votes

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.

enter image description here