finds.dev← search

// the find

espressif/esp-mqtt

★ 728 · C · Apache-2.0 · updated Jun 2026

ESP32 mqtt component

The official Espressif MQTT client component for ESP-IDF, maintained by the chip vendor themselves. Handles MQTT 3.1.1 and 5.0 over TCP, TLS, WebSocket, and WebSocket-Secure on ESP32 and related chips. If you're doing IoT work on ESP32 and need MQTT, this is the one you use — there isn't really a competing option worth considering.

Maintained by Espressif itself, so it tracks ESP-IDF breaking changes without the usual lag you see in community components. The outbox system buffers QoS 1/2 messages during disconnects and replays them on reconnect — most client libraries punt on this and leave it to you. Transport abstraction is clean: switching from plain TCP to TLS mutual auth is a config change, not a code change. The test suite is genuinely serious: host-side unit tests with mocks, target integration tests against a real broker, and a conformance test app — rare for embedded C.

MQTT 5.0 support exists but feels bolted on — it lives in separate `mqtt5_client.h` and `mqtt5_client.c` files rather than being unified with the v3.1.1 path, so you end up with two slightly different APIs for what is conceptually one protocol. The Kconfig knobs for tuning buffer sizes and task stack are powerful but the interaction between `MQTT_BUFFER_SIZE`, `MQTT_OUTBOX_EXPIRED_TIMEOUT_MS`, and heap fragmentation on long-running devices is poorly documented — you'll need to read source to understand the failure modes. Error handling from the event callback gives you an error type enum but no human-readable broker disconnect reason codes for MQTT 5.0 extended CONNACK codes. No async/non-blocking publish path for high-throughput use cases; everything goes through the internal task and outbox, which is the right default but a ceiling for data-intensive sensors.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →