Closed AshUK closed 4 years ago
Hi @AshUK
I agree that ideally we should be able to call these functions from the event handler. Unfortunately not being able to call stop/destroy functions like this is a limitation for several of components that uses event handlers.
For now we can at least update our documentation to reflect this and implement a check to stop it from deadlocking.
Thanks for reporting this.
Calling esp_mqtt_client_stop inside an MQTT eventloop handle causes the event loop to block.
Its useful to be able to stop and destroy an mqtt instance after a certain event. The work around for now is to notify another task from the MQTT event loop of an event and then call esp_mqtt_client_stop from there.