Skip to content

fix(mqtt): wait up to 10 s for CONNACK - #143

Open
drronnie85 wants to merge 1 commit into
Blueforcer:mainfrom
drronnie85:fix/mqtt-connack-timeout
Open

drronnie85 wants to merge 1 commit into
Blueforcer:mainfrom
drronnie85:fix/mqtt-connack-timeout

Conversation

@drronnie85

Copy link
Copy Markdown

The connect wait was the same 2 s PubSubClient socket timeout used for reading packets. Brokers that check the password against another service, such as the Home Assistant Mosquitto add-on, can take longer than that to answer, so every attempt ended in a timeout (state -4) although the broker was up. AWTRIX 3 used PubSubClient's 15 s default and connected fine.

The CONNACK wait is now 10 s; packet reads keep their 2 s timeout, so a stalled packet still cannot hold the loop for longer than before. An unreachable broker still fails on the TCP connect deadline.

What this changes

How it was verified

  • python scripts/test_native.py passes
  • pio run -e awtrix, pio run -e awtrix_s3_octal and pio run -e awtrix_s3_quad build
  • Tested on hardware — board:

Checklist

  • New behaviour has a host test in test/, or it genuinely cannot run off-device
  • src/core/ stayed portable (no Arduino, FastLED or board headers)
  • Documentation in docs/ updated for any new field, endpoint or setting
  • Regenerated any checked-in generated file this change invalidates
    (see the table in CONTRIBUTING.md)

The connect wait was the same 2 s PubSubClient socket timeout used for
reading packets. Brokers that check the password against another service,
such as the Home Assistant Mosquitto add-on, can take longer than that to
answer, so every attempt ended in a timeout (state -4) although the broker
was up. AWTRIX 3 used PubSubClient's 15 s default and connected fine.

The CONNACK wait is now 10 s; packet reads keep their 2 s timeout, so a
stalled packet still cannot hold the loop for longer than before. An
unreachable broker still fails on the TCP connect deadline.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant