2016-09-11 10:10:24 +07:00
# ESP32 MQTT Library
2025-02-28 11:16:26 +01:00



2018-02-17 01:03:35 +07:00
## Features
2025-02-28 11:16:26 +01:00
- Based on: < https: // github . com / tuanpmt / esp_mqtt >
2018-02-22 10:07:57 +07:00
- Support MQTT over TCP, SSL with mbedtls, MQTT over Websocket, MQTT over Websocket Secure
2025-02-28 11:16:26 +01:00
- Easy to setup with URI
2018-02-17 01:03:35 +07:00
- Multiple instances (Multiple clients in one application)
- Support subscribing, publishing, authentication, will messages, keep alive pings and all 3 QoS levels (it should be a fully functional client).
2025-02-28 11:16:26 +01:00
- Support for MQTT 3.1.1 and 5.0
2018-02-17 01:03:35 +07:00
2018-02-16 02:40:16 +07:00
## How to use
2016-09-12 13:27:35 +07:00
2025-09-23 15:26:40 +02:00
ESP-MQTT is available through the [ESP-IDF Component Manager ](https://components.espressif.com/ ) and ships as a standard [ESP-IDF ](https://github.com/espressif/esp-idf ) component.
2018-02-17 11:42:41 +07:00
2025-09-23 15:26:40 +02:00
- To add it via the Component Manager (recommended), declare the dependency in your project's `idf_component.yml` , for example:
```yaml
dependencies:
espressif/mqtt: "*"
```
Replace `*` with the version constraint you want to track, or run `idf.py add-dependency espressif/mqtt` .
- For local development, clone this repository as `mqtt` so the component name matches:
2018-12-18 16:43:08 +01:00
2025-09-23 15:26:40 +02:00
```bash
git clone https://github.com/espressif/esp-mqtt.git mqtt
```
## Documentation
2018-12-18 16:43:08 +01:00
2025-09-23 15:26:40 +02:00
- Documentation of ESP-MQTT API: < https: // docs . espressif . com / projects / esp-mqtt / en / master / esp32 / index . html >
2018-02-16 18:46:13 +07:00
2018-02-16 02:40:16 +07:00
## License
2018-12-18 16:43:08 +01:00
2025-09-23 15:26:40 +02:00
- Apache License 2.0
- MQTT package origin: [Stephen Robinson - contiki-mqtt ](https://github.com/esar/contiki-mqtt )
- Additional contributions by [@tuanpmt ](https://twitter.com/tuanpmt )
2018-12-18 16:43:08 +01:00
2025-09-23 15:26:40 +02:00
## Older IDF versions
2018-12-18 16:43:08 +01:00
For [ESP-IDF ](https://github.com/espressif/esp-idf ) versions prior to IDFv3.2, please clone as a component of [ESP-IDF ](https://github.com/espressif/esp-idf ):
2025-02-28 11:16:26 +01:00
2018-12-18 16:43:08 +01:00
```
git submodule add https://github.com/espressif/esp-mqtt.git components/espmqtt
```
2025-02-28 11:16:26 +01:00
2018-12-18 16:43:08 +01:00
and checkout the [ESP-MQTT_FOR_IDF_3.1 ](https://github.com/espressif/esp-mqtt/tree/ESP-MQTT_FOR_IDF_3.1 ) tag