Closed OpenJarvisAI closed 6 months ago
The mqtt_clent is for MQTT 3.1, this one is for MQTT 5 although the API of the two packages is basically the same.
If you do not need MQTT 5 features you are better of using mqtt_clent.
If I’m building an app that users can use to connect to either an mqtt 5 or 3 broker, can I just use this library or do I need to import both?
If your users need basic MQTT functionality as provided by MQTT 3 and also the extended functionality as provided by MQTT 5 then use this library. All modern brokers support both MQTT 3 and MQTT 5 so you should be OK here. This client only identifies itself as an MQTT 5 client so this won't work with older non MQTT 5 brokers as they are expecting an MQTT 3 client however these are fairly rare these days. If you are using one of these brokers then you will have to use the mqtt_client.
@shamblett My server brokers supports mqtt5, can I upgrade this lib in my client from your previous to mqtt5? Does the code need to change?
thanks, btw, what advantages could mqtt5 brings ?
Yes, it should be a drop in change i.e. change your import from mqtt_client to mqtt5_client.
Mqtt 5 adds message properties, definable authentication schemes, better status code feedback from the broker and topic aliases amongst other bits am bobs.
From my understanding, mqtt5_client could be the long term support now? If so, I will move to mqtt5_client now. Hopefully can resolve one of my disconnecting imediately issue when connected
previosu maintained no longer?