Device Messages Out of Order

greendays2 years ago

Hi,

I have a number of devices that are disappearing from traccar and then reappear a while later. I dug into the database and noticed that some messages are coming out of order:

+--------+----------+---------------------+---------------------+
| id     | deviceid | servertime          | devicetime          |
+--------+----------+---------------------+---------------------+
| 460694 | 108      | 2023-03-04 12:39:11 | 2023-03-04 12:39:08 |
| 460693 | 108      | 2023-03-04 12:39:10 | 2023-03-04 12:39:07 |
| 460692 | 108      | 2023-03-04 12:39:09 | 2023-03-04 12:39:06 |
| 460691 | 108      | 2023-03-04 12:39:08 | 2023-03-04 12:39:06 |
| 460645 | 108      | 2023-03-04 12:37:49 | 2023-03-04 12:31:27 |
| 460644 | 108      | 2023-03-04 12:37:48 | 2023-03-04 12:30:33 |
| 460643 | 108      | 2023-03-04 12:37:47 | 2023-03-04 12:28:31 |
| 460641 | 108      | 2023-03-04 12:37:45 | 2023-03-04 12:28:30 |
| 460639 | 108      | 2023-03-04 12:37:44 | 2023-03-04 12:28:29 |
| 460637 | 108      | 2023-03-04 12:37:43 | 2023-03-04 12:28:29 |
| 460635 | 108      | 2023-03-04 12:37:42 | 2023-03-04 12:26:42 |
| 460633 | 108      | 2023-03-04 12:37:41 | 2023-03-04 12:26:29 |
| 460631 | 108      | 2023-03-04 12:37:40 | 2023-03-04 12:25:33 |
| 460630 | 108      | 2023-03-04 12:37:39 | 2023-03-04 12:25:29 |
| 460629 | 108      | 2023-03-04 12:37:38 | 2023-03-04 12:24:51 |
| 460626 | 108      | 2023-03-04 12:37:37 | 2023-03-04 12:24:42 |
| 460622 | 108      | 2023-03-04 12:37:36 | 2023-03-04 12:23:32 |
| 460620 | 108      | 2023-03-04 12:37:35 | 2023-03-04 12:23:13 |
| 460618 | 108      | 2023-03-04 12:37:34 | 2023-03-04 12:22:43 |
| 460616 | 108      | 2023-03-04 12:37:33 | 2023-03-04 12:22:42 |
| 460615 | 108      | 2023-03-04 12:37:32 | 2023-03-04 12:21:13 |
| 460614 | 108      | 2023-03-04 12:37:31 | 2023-03-04 12:20:46 |
| 460613 | 108      | 2023-03-04 12:37:30 | 2023-03-04 12:20:45 |
| 460612 | 108      | 2023-03-04 12:37:29 | 2023-03-04 12:20:44 |
| 460610 | 108      | 2023-03-04 12:37:28 | 2023-03-04 12:20:44 |
| 460609 | 108      | 2023-03-04 12:37:27 | 2023-03-04 12:20:33 |
| 460608 | 108      | 2023-03-04 12:37:26 | 2023-03-04 12:15:33 |
| 460607 | 108      | 2023-03-04 12:37:25 | 2023-03-04 12:12:07 |
| 460606 | 108      | 2023-03-04 12:37:24 | 2023-03-04 12:10:33 |
| 460605 | 108      | 2023-03-04 12:37:23 | 2023-03-04 12:05:33 |
| 460604 | 108      | 2023-03-04 12:37:22 | 2023-03-04 12:02:07 |
| 460603 | 108      | 2023-03-04 12:37:21 | 2023-03-04 12:00:33 |
| 460602 | 108      | 2023-03-04 12:37:20 | 2023-03-04 11:55:33 |
| 460600 | 108      | 2023-03-04 12:37:19 | 2023-03-04 11:52:07 |
| 460598 | 108      | 2023-03-04 12:37:18 | 2023-03-04 11:50:33 |
| 460597 | 108      | 2023-03-04 12:37:17 | 2023-03-04 11:45:33 |
| 460594 | 108      | 2023-03-04 12:37:16 | 2023-03-04 11:42:07 |
| 460593 | 108      | 2023-03-04 12:37:15 | 2023-03-04 11:40:33 |
| 460572 | 108      | 2023-03-04 12:37:02 | 2023-03-04 12:35:33 |
| 460571 | 108      | 2023-03-04 12:37:01 | 2023-03-04 12:34:41 |
| 460570 | 108      | 2023-03-04 12:37:00 | 2023-03-04 12:34:40 |
| 460569 | 108      | 2023-03-04 12:36:59 | 2023-03-04 12:34:39 |
| 460568 | 108      | 2023-03-04 12:36:58 | 2023-03-04 12:34:39 |
| 460567 | 108      | 2023-03-04 12:36:57 | 2023-03-04 12:33:27 |
| 460566 | 108      | 2023-03-04 12:36:56 | 2023-03-04 12:32:39 |
| 460565 | 108      | 2023-03-04 12:36:55 | 2023-03-04 12:31:29 |
| 460564 | 108      | 2023-03-04 12:36:55 | 2023-03-04 12:31:28 |
| 460563 | 108      | 2023-03-04 12:36:54 | 2023-03-04 12:31:27 |
| 458052 | 108      | 2023-03-04 11:35:35 | 2023-03-04 11:35:33 |
| 457884 | 108      | 2023-03-04 11:32:08 | 2023-03-04 11:32:07 |
| 457820 | 108      | 2023-03-04 11:30:34 | 2023-03-04 11:30:33 |
+ -------+----------+---------------------+---------------------+

Notice how we have not received messages for about an hour after 2023-03-04 11:35:33 (device time). But, then, when you go up to 2023-03-04 12:35:33 (device time), you will notice the next message is from almost an hour earlier 2023-03-04 11:40:33 (device time). And, then, you notice a number of messages that are old... And, finally, it catches up with the current messages and continues.

I thought it could a problem with the device, but when I looked at the log, I see all messages received and logged in order.

I can add the log if you wish.

Anton Tananaev2 years ago

Let's see the logs for the same period.

greendays2 years ago

Is it possible to send the log privately since it has real GPS coordinates?

Anton Tananaev2 years ago

You can send it to the support email address.

Anton Tananaev2 years ago

The time in the log doesn't match anything.

Also, maybe you can filter the log and show only the relevant lines.

greendays2 years ago

I think it's more of a timezone issue with the hours being different. The server is CST (+2 from LA Time), and the device is GMT (+8 from LA).

I will filter the log and send it again.

greendays2 years ago

After converting the device times to the correct timezones, it looks as if the messages are coming from the device out of order. Traccar is processing the messages in the order received.

Anton Tananaev2 years ago

But you said you already checked it before?

greendays2 years ago

Yes, you pointed out the time difference. I was looking at the messages from +2 hours instead of the correct ones which were -2 hours. The +2 hours messages were coming in order, and the -2 hour messages were out of order from the device.

greendays2 years ago

The sequence I should have looked at:
2023-03-04 11:35:35 INF Sat Mar 04 09:35:33 PST 2023
2023-03-04 12:36:53 STT Sat Mar 04 10:31:27 PST 2023
2023-03-04 12:36:54 VGL Sat Mar 04 10:31:28 PST 2023

The sequence I was looking at:
2023-03-04 13:35:33 INF Sat Mar 04 11:35:33 PST 2023
2023-03-04 13:40:18 FRI Sat Mar 04 11:40:17 PST 2023
2023-03-04 13:40:34 INF Sat Mar 04 11:40:33 PST 2023

Sorry for the confusion.

Anton Tananaev2 years ago

No worries. In the future it would be good if you provide the evidence upfront, so we can double-check the information.

greendays2 years ago

Of course, I try to provide all relevant information with the initial report. However, in this particular case, I could not have provided logs with real GPS information publicly, and emailed it directly to you when you pointed out where to send it.