Files
project-vesper/lib/AsyncMqttClient/VENDORED.md
T
bonaminandClaude Opus 5.5 c43d9ae11c feat(MQTT): confirmed delivery for playback/reports; vendor AsyncMqttClient; pin all deps (F-073)
- MQTTDriver::publishConfirmed(): QoS 1 + PUBACK tracking (8 s; heartbeat
  20 s). A missed PUBACK forces a reconnect. status/playback relies on the
  existing republish-current-state-on-connect; control/reports are resent
  after the next CONNACK (newest 4). Publish + registration under one
  recursive mutex since the PUBACK can arrive before publish() returns.
- AsyncMqttClient vendored into lib/ (upstream 3d93fc7) with one patch:
  _onPubAck()/_onPubComp() call _handleQueue(), so a QoS 1 message delays
  the next packet by one RTT instead of RTT + up to ~500 ms.
- platformio.ini: platform and every library pinned to the exact versions
  already being built (git deps by commit). Clean-libdeps rebuild verified
  to resolve the same AsyncTCP and the vendored AsyncMqttClient.
- Removed board_build.cmake_extra_args (timer stack): no effect on Arduino
  builds, the SDK is precompiled with 2048. Replaced by a warning comment.
- mqtt.status gains resent_messages and the new forced-reset reasons.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 21:50:54 +03:00

34 lines
1.6 KiB
Markdown

# AsyncMqttClient (vendored, patched)
This is a copy of the library kept in the repo, not downloaded at build time.
PlatformIO builds it from `lib/` automatically. Do not add it back to `lib_deps`.
| | |
|---|---|
| Upstream | https://github.com/marvinroger/async-mqtt-client |
| Commit | `3d93fc7f662e65366f8e2b0d88b108f874f035b9` (2024-09-25, "Merge pull request #310") |
| Copied | `src/`, `LICENSE`, `library.json` (dependencies removed — AsyncTCP comes from `lib_deps`) |
| Version | `0.9.0+vesper.1` |
## Why vendored
1. We patch it (below).
2. It used to come from the repo's default branch with no pin, so any upstream push could change the
firmware on the next clean build. Upstream is unmaintained, so updates are unlikely, but a copy here
means nothing changes unless someone changes it in a commit.
## Patches
Every patched line is marked `[vesper patch]` — `grep -rn "vesper patch" lib/AsyncMqttClient`.
1. **`_onPubAck()` / `_onPubComp()` call `_handleQueue()`.** The outbound queue is sent strictly in order
and stops after each QoS 1/2 PUBLISH until its acknowledgement arrives. Upstream releases the packet
on the ack but doesn't restart sending, so the next queued packet waited for the next lwIP poll
(~500 ms). Every QoS 1 message therefore delayed whatever was behind it by a round trip plus up to
half a second. Now it's just the round trip. See feature catalog F-072/F-073.
## Updating
Don't just copy a newer upstream over this folder. Diff upstream against the commit above, re-apply the
patches, bump the `+vesper.N` suffix in `library.json`, update this file, and test MQTT on hardware.