obabec / rust-mqtt

Rust native mqtt client for both std and no_std environmnents.
MIT License
41 stars 21 forks source link

Support MQTT 3.1.1 #20

Open lulf opened 2 years ago

obabec commented 2 years ago

Support for 3.1.1 is in the plan, I had some time off but I will start working on that shortly :).

Ddystopia commented 7 months ago

Hello, I would like to know what steps should be taken to add support for MQTT v3.1.1 . Could you please describe a rough outline so that I can roughly estimate the amount of work and complexity? I'm willing to implement it.

yanshay commented 2 months ago

Any updates on this? Unfortunately even modern devices support only mqtt3. Is there an alternative mqtt for rust no_std that support mqtt3?

Ddystopia commented 2 months ago

Any updates on this? Unfortunately even modern devices support only mqtt3. Is there an alternative mqtt for rust no_std that support mqtt3?

We just went with netxduo. I kind of regret it. Mqtt is not so hard so you can try build your own implementation. There are no_std packet serializers/deserializers to help out.

yanshay commented 2 months ago

Mqtt is not so hard so you can try build your own implementation. There are no_std packet serializers/deserializers to help out.

Would it be easier to incorporate those serializers/deserializers into this project?

Ddystopia commented 2 months ago

Mqtt is not so hard so you can try build your own implementation. There are no_std packet serializers/deserializers to help out.

Would it be easier to incorporate those serializers/deserializers into this project?

Owners probably have no interest in supporting it

lulf commented 2 months ago

Personally I don't have the time to maintain or work on this project, so my apologies for not responding. I think mqtt3 support would be a welcome feature, but you might be more productive creating a fork and/or step up as a maintainer for it, unless Ondrej shows some renewed interest.

FWIW, I believe the steps would be to add a 'v3' module here https://github.com/obabec/rust-mqtt/blob/main/src/packet/mod.rs, and wire that up accordingly to how v5 is done. Probably it would make sense to define some trait that allows switching between them at compile time to avoid the cost of supporting both code paths.

yanshay commented 2 months ago

I'm not familiar with the differences between v3 and v5, but is there maybe a way to add a translation layer that translates v3 to v5 and the other way around? Or are the flows and packets structure completely different? From a really brief look at Paho MQTT source it seems to me they have something that looks like that at least in some areas of the code.

lulf commented 2 months ago

Yeah, I think mqtt v5 can implement all of v3, so that's definitely an option.

yanshay commented 2 months ago

Would it require just translating message format/data back and forth or also some different flows/logic?