Skip to content

Conversation

@bj00rn
Copy link

@bj00rn bj00rn commented Jul 14, 2025

Replace gmqtt with aiomqtt (async wrapper around paho-mqtt). I have major issues with getting TLS working when running broker behind reverse proxy. I've scoured the Issues section at gmqtt and TLS support seems patchy.

Sorry for spamming PRs 🤓

Rationale

Might seem a bit backward since the resent migration from paho-mqtt but aiomqtt is a wrapper around paho with async support.

gmqtt

seems to have patchy TLS support
not well maintained

aiomqtt (aka mqtt-asyncio)

well maintained 3+ releases 2025
good community support since uses underlying paho-mqtt
Working TLS
supports websockets and unix file connections

Changes in this PR

  • Use aiomqtt
  • Stop sending keepalive and instead set retain=True, qos=1 for birth message.
  • Set qos=1 for LWT
  • Fix deault port mapping for TLS

@nanomad
Copy link
Contributor

nanomad commented Sep 18, 2025

@bj00rn I'm just back from vacation. I'll postpone this for the next release

@bj00rn
Copy link
Author

bj00rn commented Oct 6, 2025

@nanomad had a look yet? I just did a rebase to fix lock file

@bj00rn
Copy link
Author

bj00rn commented Nov 28, 2025

@nanomad Feeling quite confident that this is ready for merge if you are interested. I've been running this locally for a while now. aiomqtt feels solid.

Had some issues with the Birth/keepalive and LWT. The client now sends birth message with retain=True qos=1 on connect. (Not sure if qos is strictly necessary). I've updated the send_* functions to support these options.

If this PR is accepted i could rework the subscription logic as subscription, no need to resubscribe on reconnect since aiomqtt client is reusable by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants