none
Using the MQTT protocol directly RRS feed

  • Question

  • Hi,

    - Which MQTT client tool (windows 10) can be used with the Azure IoT Hub?

    I have tried to setup the client MQTTBox and MQTTLens based on the documentation Using the MQTT protocol directly and they failed at the connection phase.

    Does anyone using the MQTTBox or MQTTLens for client test with an Azure IoT Hub, or which MQTT client tool is working with an Azure?

    the following screen snippet shows a MQTTBox client setup:

    Thanks in advance

    Roman



    • Edited by Roman Kiss Thursday, November 24, 2016 7:13 PM
    Thursday, November 24, 2016 7:12 PM

Answers

  • Hi Microsoft guys!

    I got it, please update all documents related with a device twin and MQTT support.

    for example:

    Using the MQTT protocol directly

    For the Username field, use {iothubhostname}/{device_id}/api-version=2016-11-14, where {iothubhostname} is the full CName of the IoT hub.

    For example, if the name of your IoT hub is contoso.azure-devices.net and if the name of your device is MyDevice01, the full Username field should contain contoso.azure-devices.net/MyDevice01/api-version=2016-11-14

    After this change (adding /api-version=2016-11-14 to the Username), the MQTTBox client can handled all Pub/Sub messages with the Azure IoT Hub (MQTT Broker). It's very useful client tool for simulation of the device messaging.

    Thanks

    Roman




    • Marked as answer by Roman Kiss Wednesday, December 7, 2016 6:21 PM
    • Edited by Roman Kiss Wednesday, December 7, 2016 7:05 PM
    Wednesday, December 7, 2016 6:21 PM

All replies

  • - Finally, I have figured out how to connect the MQTTBox client to the Azure IoT Hub (MQTT Broker).

    The following screen snippet shows its setup:

    Once, the MQTTBox is connected to the Azure IoT Hub (MQTT Broker), we can follow up the MSDN document Using the MQTT protocol directly.

    The following screen snippet shows a publisher of the telemetry event (D2C message) and the subscriber for C2D message:

    It looks like the D2C and C2D messages are working, but still I have a problem to simulate the new device twin features such as the twin properties and direct method with this MQTTBox client.

    For example, subscribing on the topic for direct methods $iothub/methods/POST/# and then invoking its method by Device Explorer Twin tool or by https request indicated, that the MQTTBox subscriber didn't perform a device method registration in the Azure IoT Hub broker. 

    See the following errors:

    I will appreciate any help to finalize a full usage of the MQTTBox client with the Azure IoT Hub (MQTT Broker).

    Thanks in advance.

    Roman 




    • Edited by Roman Kiss Wednesday, December 7, 2016 2:36 PM
    Wednesday, December 7, 2016 2:33 PM
  • Hi Microsoft guys!

    I got it, please update all documents related with a device twin and MQTT support.

    for example:

    Using the MQTT protocol directly

    For the Username field, use {iothubhostname}/{device_id}/api-version=2016-11-14, where {iothubhostname} is the full CName of the IoT hub.

    For example, if the name of your IoT hub is contoso.azure-devices.net and if the name of your device is MyDevice01, the full Username field should contain contoso.azure-devices.net/MyDevice01/api-version=2016-11-14

    After this change (adding /api-version=2016-11-14 to the Username), the MQTTBox client can handled all Pub/Sub messages with the Azure IoT Hub (MQTT Broker). It's very useful client tool for simulation of the device messaging.

    Thanks

    Roman




    • Marked as answer by Roman Kiss Wednesday, December 7, 2016 6:21 PM
    • Edited by Roman Kiss Wednesday, December 7, 2016 7:05 PM
    Wednesday, December 7, 2016 6:21 PM
  • Thanks a lot. I successfully established the connection with the help of your post. I have another question. The doc says Azure IoT Hub support mqtt over websockets. So is there any way to establish the connection through ws protocal?
    Monday, February 6, 2017 5:38 AM
  • - have a look at thread Using MQTT over Websockets on port 443

    Thanks

    Roman



    • Edited by Roman Kiss Monday, February 6, 2017 7:43 AM
    Monday, February 6, 2017 7:42 AM
  • hi

    i am able to connect with azure using mqttbox and able to publish the data but unable to subscribe.  Can you please help me on this.

    Wednesday, July 5, 2017 3:36 PM
  • Hi,

    - could you describe yours Topic to subscribe and Topic to publish?

    Thanks

    Roman



    • Edited by Roman Kiss Wednesday, July 5, 2017 5:07 PM
    Wednesday, July 5, 2017 5:07 PM