bertmelis/espMqttClient

MQTT ACK

Closed this issue · 4 comments

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

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).

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

any progress?

Closing because of lack of updates.

Feel free to reopen if the issue persists.