esp-mqtt icon indicating copy to clipboard operation
esp-mqtt copied to clipboard

Add support for getting unsent messages out of mqtt outbox (IDFGH-8355)

Open bbinet opened this issue 2 years ago • 2 comments

I'm using esp-mqtt in a battery powered project, so to save energy I'm deep sleeping most of the time.

I send sensor data from time to time through mqtt, but if it takes too much time, I would like to return to deep sleep, and save the data which has not been actually sent (ack has not been received) to flash memory (NVS), so that I can try again the next time I wake up.

I couldn't find any API to get unsent data out of mqtt outbox. Can you think of any way to do it?

bbinet avatar Sep 21 '22 09:09 bbinet

Also when MQTT_EVENT_DELETED event is triggered, it would be helpful to be able to retrieve the data which has been deleted in case we want to do anything with it.

bbinet avatar Sep 21 '22 09:09 bbinet

Hi @bbinet, in your case, I would suggest taking the route of writing your own outbox.

euripedesrocha avatar Sep 21 '22 10:09 euripedesrocha

Thanks for reporting, would close due to short of feedback, feel free to reopen.

Alvin1Zhang avatar Oct 24 '22 05:10 Alvin1Zhang