# 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:

- esp-mqtt component on GitHub

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:

- esp-mqtt documentation

## Application Examples

Two reference examples are available in ESP-IDF:

- MQTT over TLS (certificate bundle): 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): 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?

- Thank you! We received your feedback.
- If you have any comments, fill in Espressif Documentation Feedback Form.

- We value your feedback.
- Let us know how we can improve this page by filling in Espressif Documentation Feedback Form.