Warning

This document is not updated for ESP32C61 yet, so some of the content may not be correct.

This warning was automatically inserted due to the source file being in the add_warnings_pages list.

ESP-MQTT

[中文]

Overview

ESP-MQTT is an implementation of MQTT protocol client, which is a lightweight publish/subscribe messaging protocol. Now ESP-MQTT supports MQTT v5.0.

The ESP-IDF component ESP-MQTT has been moved from ESP-IDF since version v6.0 to a separate repository:

To add ESP-MQTT component in your project, please run idf.py add-dependency espressif/mqtt.

Hosted Documentation

The documentation can be found on the link below:

Application Examples

Two reference examples are available in ESP-IDF:

  • MQTT over TLS (certificate bundle): examples/protocols/mqtt

    • Validates the broker with ESP-IDF's certificate bundle (default).

    • Default broker URI targets mqtts://test.mosquitto.org:8886 (Let's Encrypt chain).

    • Alternative configuration pins Mosquitto CA and uses mqtts://test.mosquitto.org:8883.

  • MQTT 5.0 over TLS (certificate bundle): examples/protocols/mqtt5

    • Uses MQTT v5.0 with TLS and validation via the certificate bundle.

    • Default broker URI targets mqtts://test.mosquitto.org:8886.

For additional transport modes (TCP, WS/WSS, mutual auth, etc.), see the examples in the espressif/mqtt component repository.


Was this page helpful?