PublishQueueAsyncRK Strange Behaviour - repeat send after restart

Hi All,

We are using PublishQueueAsyncRK library, which is amazing, on our BSOM devices.

Our devices use an rfid reader along with other sensors. Sometimes the rfid reader stops working on our system. This is currently fixed with a particle function initiated device reset, which does indeed fix the rfid comms issue.

After reset, the device starts resending old data publishes that have been previously sent to the cloud. This issue has just occurred and now the device is resending all the data from the last 36 hours. I have seen the same behaviour across multiple of our devices.

So it seems like even though the data has been successfully sent, it is not clearing it correctly from the sd card, then when I see the RFID comms issue and initiate a reset, it then resends a bunch of data. Does anyone have any ideas about how I should trouble shoot this further?

I am using an SD card and both the PRIVATE and WITH_ACK flags for sending the data.

Thanks in advance
Ivan

Hey Ivan,

Sent a DM, but it seems like the old data isn't getting cleared from the SD card after the data has been published.

On Gen 3 devices I highly recommend using PublishQueuePosixRK instead of PublishQueueAsyncRK. One of the problems with the older Async library is that it is possible for changes to the queue file to be lost, which causes that exact behavior. The Posix version uses the Gen 3 flash file system directly and does not suffer from this problem. It's also significantly simpler internally, which leads to fewer hard-to-reproduce bugs.

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.