Skip to content

MQTT: Fixed connection logic - #128

Merged
tuna-f1sh merged 3 commits into
Tigge:masterfrom
rasher:mqtt_fixes
Nov 9, 2026
Merged

tuna-f1sh merged 3 commits into
Tigge:masterfrom
rasher:mqtt_fixes

Conversation

@rasher

@rasher rasher commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

There were two issues with the MQTT connection which weren't obvious when I wrote and tested it, but became obvious once I started using it.

  1. I wasn't using the client right - constantly calling loop_start() and loop_stop() was causing things to grind to a halt, as the thread setup could take up to a second. Not noticeable with a single 1Hz device, but poison with anything above that. This is now done only once.
  2. Less significantly, I had implemented custom reconnect logic, which also interfered with the client thread unfavourably. Removed that in favour of setting up the client library's own reconnect mechanism.

Also fixed a copy/paste error in the README.

@tuna-f1sh

Copy link
Copy Markdown
Collaborator

Thanks. Looks good. I need to fix CI since 3.8 is depreciated. Other tests pass so merging.

@tuna-f1sh
tuna-f1sh merged commit 0d5c2e1 into Tigge:master Nov 9, 2026
9 of 27 checks passed
@rasher
rasher deleted the mqtt_fixes branch November 9, 2026 13:52
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