Report Trips API diferente do traccar-web

Junior Silva21 days ago

Hello friends. After searching a lot to see if I could find an answer, I didn't find it and I decided to ask for help.
I have a small problem that in my traccar-web, it shows the correct Report Trips, with the trips exactly as they were. However, when I consume it through the API, either through the code I developed or through postman, it shows completely meaningless information. Could someone help me with this?
For a better analysis, I am sending 2 trips that are in the same time range, but are completely different.

These two trips are from postman (wrong), and are in the range of 03/27/2025, from 10:49 to 16:24:

        "deviceId": 10,
        "deviceName": "Renegade",
        "distance": 25013.830797634088,
        "averageSpeed": 6.068000107035198,
        "maxSpeed": 0.0,
        "spentFuel": 0.0,
        "startOdometer": 4429747.533561083,
        "endOdometer": 4454761.364358717,
        "startTime": "2025-03-27T10:49:27.000+00:00",
        "endTime": "2025-03-27T13:03:00.000+00:00",
        "startPositionId": 22909,
        "endPositionId": 23250,
        "startLat": -5.796340000000001,
        "startLon": -35.20780222222222,
        "endLat": -5.789995,
        "endLon": -35.19889111111112,
        "startAddress": "Rua Segundo Wanderley, Barro Vermelho, Natal, 59022-040, Rio Grande do Norte, BR",
        "endAddress": "Rua Jundiaí, Tirol, Natal, 59020-120, Rio Grande do Norte, BR",
        "duration": 8013000,
        "driverUniqueId": null,
        "driverName": null

and

        "deviceId": 10,
        "deviceName": "Renegade",
        "distance": 2229.4397319536656,
        "averageSpeed": 0.9745163320352627,
        "maxSpeed": 0.0,
        "spentFuel": 0.0,
        "startOdometer": 4455935.299618124,
        "endOdometer": 4458164.739350078,
        "startTime": "2025-03-27T15:10:23.000+00:00",
        "endTime": "2025-03-27T16:24:30.000+00:00",
        "startPositionId": 23361,
        "endPositionId": 23445,
        "startLat": -5.790495,
        "startLon": -35.20624222222222,
        "endLat": -5.8002433333333325,
        "endLon": -35.2067,
        "startAddress": "Avenida Deodoro da Fonseca, Cidade Alta, Natal, 59020-600, Rio Grande do Norte, BR",
        "endAddress": "Rua Júlio Gomes Moreira, Barro Vermelho, Natal, 59022-080, Rio Grande do Norte, BR",
        "duration": 4447000,
        "driverUniqueId": null,
        "driverName": null

and these two below are from traccar-web (correct), in the same interval and same date as the two above.

28/03/2025, 13:01	28/03/2025, 13:21	8.97 km
28/03/2025, 15:04	28/03/2025, 15:16	3.45 km

I can't put them in JSON because I got them from the web interface, I don't know how the frontend got this data but I need to know.
Thanks in advance for your help.

Anton Tananaev21 days ago

You should compare the API requests.

Junior Silva21 days ago

Problem identified and solved. But now another problem.
But this is a bug and you can confirm it for me because it also happens with traccar-web, front-end.
When I filter the trips from 03/28/2025 00:00 to 03/28/2025 23:59, it returns the correct trips made during that entire day.
When I filter the trips from 03/28/2025 00:00 to 03/29/2025 23:59 or even any time (it just needs to be a later day), it tells me completely incorrect trips from the 28th, which it showed correctly when the filter was on the previous date.
Is this problem only on my server? Do you have any idea what it is or is it a bug in the system itself?
Regards, Anton.

Anton Tananaev21 days ago

It is likely related to fast reports. Reports shorter than 24 hours are calculated from raw data. Reports longer than 24 hours are calculated based on events, which might be less accurate in certain cases. The threshold is configurable.

Junior Silva18 days ago

Where to set the limit Anton? Thanks in advance for the explanation.

Anton Tananaev18 days ago

In the configuration file.

Junior Silva18 days ago

Perfect friend. It worked now. What would be the pros and cons of inserting a quick report value of 6 months for example? Are there any negative or positive points?

Anton Tananaev18 days ago

Regular reports will be slower and will use more resources to calculate.