Is it enough to specify "TransportType.Mqtt"(C#) to communicate with Azure IoT Hub by MQTT?

ima 31 Reputation points
2020-12-04T02:50:54.023+00:00

I'm writing an application in c #. I am using the Azure-Iot-SDK to specify "TransportType.Mqtt" to send to Azure IoT Hub via mqtt.
When executed, DeviceExploler also confirmed the sent data.

However, although I monitored the packet data sent by the application side (using "WireShark"), I could not monitor the MQTT packet.

When I monitored the transmission from another MQTT communication application to another MQTT broker, I was able to monitor the MQTT packets.

Is it enough to set "TransportType.Mqtt" for MQTT communication using Azure-Iot-SDK?

Azure IoT SDK
Azure IoT SDK
An Azure software development kit that facilitates building applications that connect to Azure IoT services.
207 questions
0 comments No comments
{count} vote

Accepted answer
  1. QuantumCache 20,031 Reputation points
    2020-12-04T17:50:47.207+00:00

    Hello @ima Welcome to Microsoft Q&A Platform and thanks for your query.

    I too had the same experience with WireShark while capturing the MQTT packets on my Desktop application.

    I hope the below information may help with your initial query.

    I have used the Sample C# application, Download the Azure IoT C# samples from https://github.com/Azure-Samples/azure-iot-samples-csharp/archive/master.zip and extract the ZIP archive. Use the Send simulated telemetry section.

    45189-image.png

    After changing the Wireshark Protocol settings, I was able to see the packet captured with MQTT protocol.

    Below the screen grab show that I changed the Wireshark protocol settings to listen on port 8883.

    • Wireshark---> Edit--->Protocols-->Scroll to MQTT---> Enter the port number **8883 in the textbox 'MQTT TCP port'**

    45188-image.png

    Captured Packet.

    45361-image.png

    Please comment below if you need further help in this matter.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful