mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-10-28 11:14:58 +00:00
On boards with PSRAM the MQTT client runs in its own task with a 5120 byte stack. Verifying an EC certificate chain against a CA, such as Let's Encrypt ISRG Root X2, needs about 6 KB, so the task overflowed and the board boot looped on every connect. The espMqttClient constructors now take the stack size, and startClient() passes EMSESP_MQTT_STACKSIZE_CA (8192) when TLS is on with a CA, keeping the 5120 default for insecure TLS and plain MQTT. The client is recreated when that changes. The stack usage log reports against the size the task was created with.
espMqttClient
MQTT client library for the Espressif devices ESP8266 and ESP32 on the Arduino framework. Aims to be a non-blocking, fully compliant MQTT 3.1.1 client.
Copy of https://github.com/bertmelis/espMqttClient
Based on Version 1.7.0 - https://github.com/bertmelis/espMqttClient/tree/v1.7.0
with additional changes to support EMS-ESP such as compiling with Tasmota and not using SecureWifiClient in these two files:
src/espMqttClient.cpp
src/Transport/ClientSecureSync.h
src/Config.h
License
This library is released under the MIT Licence. A copy is included in the repo. Parts of this library, most notably the API, are based on Async MQTT client for ESP8266 and ESP32.