You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An error occurred: Received packet 'PubAck: [PacketIdentifier=1] [ReasonCode=]' at an unexpected time.
I am facing the same issue, only secific to QOS2. Mqttnet 3.1.1, in C#.
var clientOptions = new MqttClientOptionsBuilder()
.WithTcpServer("test",8883) // Broker host and TLS secure post transfer
.WithCredentials("id", "pwd") // Username and password
.WithClientId("id")
.WithTls(new MqttClientOptionsBuilderTlsParameters
{
UseTls = true,
AllowUntrustedCertificates = true, // Set to false in production
IgnoreCertificateChainErrors = true, // Set to false in production
IgnoreCertificateRevocationErrors = true // Set to false in production
})
.WithCleanSession(false) // Clean session false
.WithCommunicationTimeout(TimeSpan.FromSeconds(10000))
.WithKeepAlivePeriod(TimeSpan.FromSeconds(1000))
.WithProtocolVersion(MQTTnet.Formatter.MqttProtocolVersion.V311)
.Build();
Payload: var
mqttMessage = new MqttApplicationMessageBuilder()
.WithTopic("") // Topic
.WithPayload(Encoding.UTF8.GetBytes(serializedMessage)) // JSON Payload
.WithQualityOfServiceLevel(MqttQualityOfServiceLevel.ExactlyOnce) //Qos2 exactly once
.WithRetainFlag()
.Build();
ERROR:
File Read successfully!!
Connecting to MQTT broker...
Connected to MQTT broker.
Connected to MQTT broker successfully.
**An error occurred: Received packet 'PubAck: [PacketIdentifier=1] [ReasonCode=]' at an unexpected time.**
Disconnected from MQTT broker.
The code works fine without await: mqttClient.PublishAsync(mqttMessage); when i use: await mqttClient.PublishAsync(mqttMessage);, it fails with the above error. Do you have any suggestions? @chkr1011 ( is await mandatory for publish?, what could be the potential consequences if i dont use it?)
I tried this based on another issue reference:
var properties = mqttClient.PublishAsync(mqttMessage);
await Task.WhenAll(properties);
Still the same issue. An error occurred: Received packet 'PubAck: [PacketIdentifier=1] [ReasonCode=]' at an unexpected time.
The text was updated successfully, but these errors were encountered:
An error occurred: Received packet 'PubAck: [PacketIdentifier=1] [ReasonCode=]' at an unexpected time.
I am facing the same issue, only secific to QOS2. Mqttnet 3.1.1, in C#.
Payload: var
ERROR:
The code works fine without await: mqttClient.PublishAsync(mqttMessage); when i use: await mqttClient.PublishAsync(mqttMessage);, it fails with the above error. Do you have any suggestions? @chkr1011 ( is await mandatory for publish?, what could be the potential consequences if i dont use it?)
I tried this based on another issue reference:
Still the same issue. An error occurred: Received packet 'PubAck: [PacketIdentifier=1] [ReasonCode=]' at an unexpected time.
The text was updated successfully, but these errors were encountered: