bertmelis / espMqttClient

MQTT 3.1.1 client library for the Espressif devices ESP8266 and ESP32 on the Arduino framework.
https://www.emelis.net/espMqttClient/
MIT License
92 stars 21 forks source link

MQTT ACK #140

Closed fabltd closed 5 months ago

fabltd commented 6 months ago

ESP32 using TLS

I have some code that is long running. This can cause the ACK to fail when using QOS 1. The message is then resent making the issue worse as the long running code is re triggered.

I don't think this is a bug more a programming issue.

Is there some function to confirm once the message has been Acknolodged I can then kick off the function. I have the payload from MQTT stored and need to trigger the long running prcoessing function. It sends out signals at a very slow speed 1 after the other to a 3rd party system.

All works fine when the longrunning function is disabled.

Thanks

bertmelis commented 6 months ago

I'm not entirely following. Your ESP starts a long process when a certain message is received and this causes the ACK to be delayed? Is this correct?

If yes, this automatically raises the question about task priorities and yielding. Do you yield() to other tasks in your "long process"? If possible, please do. If not possible, try to run espMqttClient in the other core (if your esp32 has two cores).

fabltd commented 6 months ago

Hi

Yes correct an MQTT message is recived and then a long process starts it sends 32 Messages over an RF link spaced 10 seconds apart.

This of course courses the ACK to be delayed. No I am not yielding. I will try this. Thanks

bertmelis commented 5 months ago

any progress?

bertmelis commented 5 months ago

Closing because of lack of updates.

Feel free to reopen if the issue persists.