HiveMQ Edge to Azure IoT Hub: UNSUPPORTED_PROTOCOL_VERSION

Hi HiveMQ Community!

I like the concept of the Hive MQ Edge, but i encounter an issue connecting it to Azure IoT Hub. I proceeded as described here for the settings of the Bridge: using-the-mqtt-protocol-directly-as-a-device. I enabled TLS but left the settings blank.

I get the following message in the event log of the edge:

com.hivemq.client.mqtt.mqtt5.exceptions.Mqtt5ConnAckException: CONNECT failed as CONNACK contained an Error Code: UNSUPPORTED_PROTOCOL_VERSION.

Is this because Azure only supports MQTT 3 ? What can i do to connect it?

Hi Simeon,

Welcome to the community! It seems you’re encountering an issue with connecting HiveMQ Edge to Azure IoT Hub, specifically receiving a UNSUPPORTED_PROTOCOL_VERSION error. Let’s troubleshoot this.

Before diving into solutions, could you confirm if you’re experiencing this problem solely with HiveMQ Edge? Have you successfully connected any other MQTT clients like MQTT.fx or MQTT-Explorer or Mosquitto to the Azure IoT Hub without encountering similar issues?

Additionally, it might be helpful to verify if MQTT-CLI client (Home - MQTT CLI) can establish a connection with your Azure IoT Hub or if it encounters the same problem. This would help narrow down whether the issue lies with HiveMQ Edge configuration or if it’s related to Azure IoT Hub’s compatibility with MQTT versions.

Looking forward to your response!
Warm regards
Dasha from HiveMQ Team

Hi Daria,

thank you for your response! I managed to connect and publish messages to the Azure IoT Hub via MQTT Explorer and with the MQTT CLI.

Thank you for the hint to use the CLI, with that it was easy to see that it really depends on the MQTT Version. With -V 3 i can create the connection and then publish successfully, with -V 5 i get the UNSUPPORTED_PROTOCOL_VERSION response.

In my research i fond that only a preview version of Azure IoT Hub supports MQTT 5 (Azure IoT Hub MQTT 5 support (preview) - Azure IoT | Microsoft Learn) and it has quite a view limitations. I’m not jet sure if i can use it.

Is there an option to set the MQTT Bridge on HiveMQ Edge to V 3 to be able to use the standard Azure IoT Hub? Or is there another way around this issue?

Kind regards,
Simeon

Hi @simeon,

Thank you for delving deeper into this matter! After reviewing the bridge implementation in hivemq-edge, it appears there isn’t an option to set the Bridge to V3. Should you find this feature beneficial in supporting MQTT v.3-only brokers, I encourage you to share your idea with our developers. Simply visit https://github.com/hivemq/hivemq-edge/issues, select New Issue, and then proceed with Feature request. Your input is greatly appreciated!

Best regards,
Dasha from HiveMQ Team