MQTT 3.1.1 vs MQTT 5.0.0

I am using an existing MQTT client application called Multimeter MQTT to send data and register devices on Cumulocity’s Device Management portal. The application comes with the option to select the version of the MQTT protocol:

  • 3.1.0
  • 3.1.1
  • 5.0.0.

While I am able to connect and publish data to Cumulocity using version 3.1.1, attempting to do so using version 5.0.0 results in the authentication error displayed below:

MQTTnet.Adapter.MqttConnectingFailedException: Connecting with MQTT server failed (1).
   at MQTTnet.Client.MqttClient.AuthenticateAsync(MqttClientOptions options, CancellationToken cancellationToken)
   at MQTTnet.Client.MqttClient.ConnectAsync(MqttClientOptions options, CancellationToken cancellationToken)
   at MQTTnet.Client.MqttClient.ConnectAsync(MqttClientOptions options, CancellationToken cancellationToken)
   at MQTTnetApp.Services.Mqtt.MqttClientService.Connect(ConnectionItemViewModel item) in C:\Users\...\mqttMultimeter-main\Source\Services\Mqtt\MqttClientService.cs:line 107
   at MQTTnetApp.Pages.Connection.ConnectionPageViewModel.Connect(ConnectionItemViewModel item) in C:\Users\...\mqttMultimeter-main\Source\Pages\Connection\ConnectionPageViewModel.cs:line 82

What is the main difference between MQTT v.3.1.1 and v.5.0.0 that could be causing the above error?

In the connection section of the Multimeter MQTT application, there is a section where one can enter an authentication method. I did not need to fill out that information to connect using 3.1.1, but I am wondering if that could be the reason the application is refusing to connect using 5.0.0.

Hi @luclib, Cumulocity dosen’t support MQTT 5.0.0. Please use MQTT 3.1.1. Your credentials of the platform is necessary for the connection. Here are some tutorials showing you how to connect MQTT clients. Hope this can help you.

2 Likes

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.