mirror of
https://github.com/espressif/esp-mqtt.git
synced 2026-06-06 05:14:44 +00:00
470cb93049aea2dd51c7bb9db4dae963370d4a98
In the mqtt5 protocol the broker can disconnect the client with a disconnect packet. This packet contains a reason value that can be useful for certain applications in which it is important to know the reason of disconnection. While the client is connected is possible that a disconnect packet is reaceived by the broker to force a disconnection. Before this patch this approach causes a generic error on transport in case of disconnection from the broker. If the packet is managed before getting an error it is possible to save the reason code in the disconnect_return_code variable in the error_handle, and dispatch the disconnect event that can be managed by the application event loop, that now can know the reason of disconnection from the broker. Reset the variable in case of error. Signed-off-by: Flavia Caforio <flavia.caforio@amarulasolutions.com>
ESP32 MQTT Library
Features
- Based on: https://github.com/tuanpmt/esp_mqtt
- Support MQTT over TCP, SSL with mbedtls, MQTT over Websocket, MQTT over Websocket Secure
- Easy to setup with URI
- 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).
How to use
ESP-MQTT is a standard ESP-IDF component. Please refer to instructions in ESP-IDF
Documentation
-
Please refer to the standard ESP-IDF, documentation for the latest version: https://docs.espressif.com/projects/esp-idf/
-
Documentation of ESP-MQTT API: https://docs.espressif.com/projects/esp-idf/en/latest/api-reference/protocols/mqtt.html
License
- MQTT Package - Stephen Robinson - contiki-mqtt
- Others @tuanpmt Apache License
Older IDF verisons
For ESP-IDF versions prior to IDFv3.2, please clone as a component of ESP-IDF:
git submodule add https://github.com/espressif/esp-mqtt.git components/espmqtt
and checkout the ESP-MQTT_FOR_IDF_3.1 tag
Description
Mirror of https://github.com/espressif/esp-mqtt.git for ESP-IDF submodules
Languages
C
78.7%
C++
11.7%
Python
7.3%
CMake
2.1%
Shell
0.2%