Best Python MQTT Client

55 views
Skip to first unread message

Rok Kozel

unread,
Oct 26, 2023, 8:38:07 AM10/26/23
to MQTT
Hi, we are choosing new mqtt library, and my question is which python client to choose, since none of them look like they are actively maintained.

Thank you for the help.

Our list

·         Paho mqtt

o   Pros

§  Supported by well-known company - eclipse.

o   Cons

§  Might not be maintained that well – last commit 9 months ago.

·         Fastapi-mqtt

o   Pros

§  Looks quite well maintained.

§  A lot of activity, commits etc.

§  Wrapper around FAST Api (well known, reputable).

§  Enforces pydantic (big plus)

o   Cons     

§  Not sure why FAST Api dependency is beneficial.

§  No major organization is backing up development.

§  Uses gmqtt behind the scenes.

·         This one doesn’t look that well maintained.

·         gmqtt

o   Pros

§  Looks simple.

o   Cons

§  Not much documentation.

§  It was not maintained recently.

Greg Troxel

unread,
Oct 26, 2023, 8:49:30 AM10/26/23
to Rok Kozel, MQTT
Rok Kozel <rok...@gmail.com> writes:

> Hi, we are choosing new mqtt library, and my question is which python
> client to choose, since none of them look like they are actively maintained.

Thanks for posting. This was a bit hard to read afer plain text
conversion (your mail seemed to be html only) but I think I follow, and
I hope my formatting cleanup didn't misrepresent it.

> · Paho mqtt <https://github.com/eclipse/paho.mqtt.python>
> o *Pros*
> § Supported by well-known company - eclipse.
> o *Cons*
> § Might not be maintained that well – last commit 9 months ago.

There are definitely maintenance issues, but it also seems that many are
using it and it's mostly ok. Certainly my issues have been somewhat
edge cases. I'm using this in production for two things (reporting UPS
status and sending decodes of 433 IOT devices) and the only problems I
can pin on the code are mishandling ssl errors that happen during
netflakes, which I've filed a bug about.

As for "supported by eclipse":
- eclipse is a trade association (technically a company but not really)
- it is obvious that there is no staff paid by eclipse to support this
client, so "morally supported", yes but "supported by", no.

> · Fastapi-mqtt <https://github.com/sabuhish/fastapi-mqtt>
> o *Pros*
> § Looks quite well maintained.
> § A lot of activity, commits etc.
> § Wrapper around FAST Api (well known, reputable).
> § Enforces pydantic (big plus)
> o *Cons *
> § Not sure why FAST Api dependency is beneficial.
> § No major organization is backing up development.
> § Uses *gmqtt *behind the scenes.

Using a web framework when you just want to do MQTT does not make sense,
so I'd say that's out of the question unless you are already using FastAPI.

> · gmqtt <https://github.com/wialon/gmqtt>
> o *Pros*
> § Looks simple.
> o *Cons*
> § Not much documentation.
> § It was not maintained recently.

This seems interesting to me but I haven't dug in yet. It's async but
these days I'd say that's more + than -.


Rok Kozel

unread,
Oct 27, 2023, 9:59:52 AM10/27/23
to Greg Troxel, MQTT
Hi Greg,

Thank you for answering my question and sharing your experiences. Do you maybe know of any other libraries that are well supported? 

Have a nice weekend.

Best,

Rok

Greg Troxel

unread,
Oct 27, 2023, 11:46:06 AM10/27/23
to Rok Kozel, MQTT
Rok Kozel <rok...@gmail.com> writes:

> Thank you for answering my question and sharing your experiences. Do you
> maybe know of any other libraries that are well supported?

No, I don't. I would have mentioned them...
Reply all
Reply to author
Forward
0 new messages