Cell Data Transmitting in Wrong Order

Hello,
I’m using a Boron to transmit data to a google sheet using a webhook. The boron regularly transmits strings of data to the particle cloud, and triggers a webhook to post the data to a google sheet.

Each package of data sent includes its own timestamp. But they are posted to the google sheet in the incorrect order. While running the test, I see that the cell signal was pretty low, around 20%. I’m suspecting the poor cell signal might be the cause, but does anyone else have an idea of what the problem could be?

The readings should be in the order:

4/18/2023	12:35:24					Sensor Start
4/18/2023	12:35:10	22.746	7.969	918.2	285	
4/18/2023	12:35:12					Sensor Stop

But instead I’m seeing this, the timestamps are in the wrong order.

4/18/2023	12:35:21	22.759	7.974	917.8	285	
4/18/2023	12:35:23					Sensor Stop
4/18/2023	12:35:24					Sensor Start
4/18/2023	12:35:10	22.746	7.969	918.2	285	
4/18/2023	12:35:12					Sensor Stop
4/18/2023	12:35:31	22.768	7.974	916.4	285	
4/18/2023	12:35:33					Sensor Stop
4/18/2023	12:35:35					Sensor Start
4/18/2023	12:35:42	22.777	7.973	917.8	285	
4/18/2023	12:36:07					Sensor Start
4/18/2023	12:35:53	22.781	7.974	917.1	285	
4/18/2023	12:35:55					Sensor Stop
4/18/2023	12:36:04	22.788	7.974	917.6	286	
4/18/2023	12:35:57					Sensor Start
4/18/2023	12:36:15	22.793	7.976	917.6	286	
4/18/2023	12:36:17					Sensor Stop
4/18/2023	12:36:18					Sensor Start
4/18/2023	12:35:46					Sensor Start
4/18/2023	12:36:06					Sensor Stop
4/18/2023	12:35:44					Sensor Stop
4/18/2023	12:36:25	22.796	7.976	917.3	286	

Particle publish does not guarantee in-order delivery. If you need ordering, you should do it on your back-end, where you should also handle duplicates, which can also occur.

When there is low cellular signal, it’s quite likely that publishes will arrive out-of-order because an earlier one can be stuck in retry (which can take 20 seconds), but the subsequent one goes through without retry.

Similarly, duplicates occur when the ACK from the cloud gets lost, so the device retransmits the data, but the data actually was received by the cloud, it was just the ACK that was lost.

1 Like

Ah, thanks for the information.