Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protocol Version 132 (MQTT 3.1.1 Bridge) Support #1413

Closed
mac866 opened this issue May 18, 2022 · 7 comments
Closed

Protocol Version 132 (MQTT 3.1.1 Bridge) Support #1413

mac866 opened this issue May 18, 2022 · 7 comments
Labels
bug Something isn't working

Comments

@mac866
Copy link

mac866 commented May 18, 2022

Hi,

I currently use MQTTnet as a endpoint for various MQTT clients.
For this reason, I would like to thank you for your great work!

I need to integrate a new "BlackBox-Hardware client", but it connects with protocol version 132 [MQTT 3.1.1 Bridge] which results in:

MQTTnet.Exceptions.MqttProtocolViolationException: Protocol level '132' not supported.
   at MQTTnet.Formatter.MqttPacketFormatterAdapter.ParseProtocolVersion(ReceivedMqttPacket receivedMqttPacket)
   at MQTTnet.Formatter.MqttPacketFormatterAdapter.DetectProtocolVersion(ReceivedMqttPacket receivedMqttPacket)
   at MQTTnet.Adapter.MqttChannelAdapter.ReceivePacketAsync(CancellationToken cancellationToken)
   at MQTTnet.Server.Internal.MqttClientSessionsManager.ReceiveConnectPacket(IMqttChannelAdapter channelAdapter, CancellationToken cancellationToken)
   at MQTTnet.Server.Internal.MqttClientSessionsManager.HandleClientConnectionAsync(IMqttChannelAdapter channelAdapter, CancellationToken cancellationToken)

I cannot change the configuration of this client, but I could reproduce the same behaviour via the Mosquitto Broker in bridge mode.

Are there ways to connect with version 132 without making changes to the client?

THX

@mac866 mac866 added the bug Something isn't working label May 18, 2022
@chkr1011
Copy link
Collaborator

chkr1011 commented Jun 4, 2022

Do you have a link for me with the full protocol specification or more details? Currently there is no way to make a connection but I can add support for this when you provide more details about this feature.

@MD-V
Copy link
Contributor

MD-V commented Jun 6, 2022

Hello @chkr1011 according to https://github.com/eclipse/mosquitto/blob/3cbe805e71ac41a2a20cc9b2ea6b3b619f49554a/lib/send_connect.c#L153 the protocol level property will additionally contain 0x80 if try_private is set to true (https://mosquitto.org/man/mosquitto-conf-5.html) on the bridge side. Maybe this issue is related to: #1166

@mac866
Copy link
Author

mac866 commented Jun 7, 2022

Hello @chkr1011,
I have not found a spec, but there is a VerneMQ commit that solved it for them:
vernemq/vernemq@70b5691
THX

@chkr1011
Copy link
Collaborator

Please try this version from the myget feed: https://www.myget.org/feed/mqttnet/package/nuget/MQTTnet/4.0.0.180

It allows sending the flag in the client and the server will now "ignore" it so that a connection can be established.

@mac866
Copy link
Author

mac866 commented Jun 14, 2022

Hi @chkr1011,
4.0.0.180 works like a charm - thanks a lot!!!

@SeppPenner
Copy link
Collaborator

Nice, so we can close this issue? :)

@mac866
Copy link
Author

mac866 commented Jun 14, 2022

Yes - THX!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

4 participants