Context
PubSubClient (include/mqtt.h:11) is synchronous - publish() blocks until the TCP write completes, and the keepalive ping is driven from loop() calls in our MQTT task. Under load (slow WiFi, large payload, TLS retransmits) this blocks the LWIP stack and can cause AWS to drop the connection on missed keepalive.
Proposal
Spike on alternatives and pick one:
espMqttClientSecure - async, queue-based, supports TLS via WiFiClientSecure
AsyncMqttClient (marvinroger) - async on top of AsyncTCP (already a dependency)
Eval criteria:
- Truly non-blocking publish (returns immediately, success/failure via callback)
- Native TLS support with our existing AWS IoT certificate flow
- Works with multi-task ownership (publish from any task, callbacks on a known task)
- No regressions vs current MQTT_BUFFER_SIZE / message rate
Out of scope
Implementation - this is the spike to decide whether to do it.
Context
PubSubClient(include/mqtt.h:11) is synchronous -publish()blocks until the TCP write completes, and the keepalive ping is driven fromloop()calls in our MQTT task. Under load (slow WiFi, large payload, TLS retransmits) this blocks the LWIP stack and can cause AWS to drop the connection on missed keepalive.Proposal
Spike on alternatives and pick one:
espMqttClientSecure- async, queue-based, supports TLS via WiFiClientSecureAsyncMqttClient(marvinroger) - async on top of AsyncTCP (already a dependency)Eval criteria:
Out of scope
Implementation - this is the spike to decide whether to do it.