Traccar reporting device battery level at 0 when device in sleep mode

nebbs22513 days ago

Hello,

I have just set up a traccar server (version 6.6) for personal use with a TK911 device using watch protocol (port 5093).
It is working fine when awake and moving, but when the device enters sleep mode (sleep mode by shock after 5 minutes of inactivity), Traccar displays the device with a battery level at 0. Indeed, in the reports/route screen, I see some odd recordings with the same timestamp with battery level at 0.

Here is the reports/route screenshot for the device. As you can see, the device enters sleep at 10:33:23 with 100% battery and then I have several records with the same timestamp with battery level at 0 :

report_route.jpg

Here is the traccar log for the same time interval. You can see the device is reporting its location every 30s when awake, and after the full location update at 22:33:25, it sends a shorter message every 5 minutes which seems to include the battery level (second last parameter with the value 100)

2025-04-13 22:29:48  INFO: [T6e05d2e7: watch < 172.22.0.1] [SG*9139009161*0066*UD,130425,222947,A,5.349054,N,3.992257,W,7.685,009,17,9,90,98,0,50,00000000,1,1,612,5,2092,2064388,25,,00]
2025-04-13 22:29:49  INFO: [T6e05d2e7] id: 9139009161, time: 2025-04-13 22:29:47, lat: 5.34905, lon: -3.99226, speed: 4.1, course: 9.0
2025-04-13 22:31:25  INFO: [T6e05d2e7: watch < 172.22.0.1] [SG*9139009161*0067*UD,130425,223122,A,5.349146,N,3.992363,W,1.351,203,75,7,100,98,0,50,00000000,1,1,612,5,2092,2064388,28,,00]
2025-04-13 22:31:25  INFO: [T6e05d2e7] id: 9139009161, time: 2025-04-13 22:31:22, lat: 5.34915, lon: -3.99236, speed: 0.7, course: 203.0
2025-04-13 22:32:25  INFO: [T6e05d2e7: watch < 172.22.0.1] [SG*9139009161*0065*UD,130425,223223,A,5.348999,N,3.992298,W,0.0,203,64,8,100,98,0,50,00000000,1,1,612,5,2092,2064388,27,,00]
2025-04-13 22:32:25  INFO: [T6e05d2e7] id: 9139009161, time: 2025-04-13 22:32:23, lat: 5.34900, lon: -3.99230, course: 203.0
2025-04-13 22:32:32  INFO: [T6e05d2e7: watch < 172.22.0.1] [SG*9139009161*0009*LK,0,100,0]
2025-04-13 22:32:32  INFO: [T6e05d2e7] id: 9139009161, time: 2025-04-13 22:32:23, lat: 5.34900, lon: -3.99230, course: 203.0
2025-04-13 22:32:32  INFO: [T6e05d2e7: watch > 172.22.0.1] [SG*9139009161*0002*LK]
2025-04-13 22:33:25  INFO: [T6e05d2e7: watch < 172.22.0.1] [SG*9139009161*0067*UD,130425,223323,A,5.348999,N,3.992298,W,0.0,203,64,11,100,100,0,50,00000000,1,1,612,5,2092,2064388,27,,00]
2025-04-13 22:33:26  INFO: [T6e05d2e7] id: 9139009161, time: 2025-04-13 22:33:23, lat: 5.34900, lon: -3.99230, course: 203.0
2025-04-13 22:37:33  INFO: [T6e05d2e7: watch < 172.22.0.1] [SG*9139009161*0009*LK,0,100,0]
2025-04-13 22:37:33  INFO: [T6e05d2e7] id: 9139009161, time: 2025-04-13 22:33:23, lat: 5.34900, lon: -3.99230, course: 203.0
2025-04-13 22:37:33  INFO: [T6e05d2e7: watch > 172.22.0.1] [SG*9139009161*0002*LK]
2025-04-13 22:42:33  INFO: [T6e05d2e7: watch < 172.22.0.1] [SG*9139009161*0009*LK,0,100,0]
2025-04-13 22:42:33  INFO: [T6e05d2e7] id: 9139009161, time: 2025-04-13 22:33:23, lat: 5.34900, lon: -3.99230, course: 203.0
2025-04-13 22:42:33  INFO: [T6e05d2e7: watch > 172.22.0.1] [SG*9139009161*0002*LK]
2025-04-13 22:47:34  INFO: [T6e05d2e7: watch < 172.22.0.1] [SG*9139009161*0009*LK,0,100,0]
2025-04-13 22:47:34  INFO: [T6e05d2e7] id: 9139009161, time: 2025-04-13 22:33:23, lat: 5.34900, lon: -3.99230, course: 203.0
2025-04-13 22:47:34  INFO: [T6e05d2e7: watch > 172.22.0.1] [SG*9139009161*0002*LK]
2025-04-13 22:52:34  INFO: [T6e05d2e7: watch < 172.22.0.1] [SG*9139009161*0009*LK,0,100,0]
2025-04-13 22:52:34  INFO: [T6e05d2e7] id: 9139009161, time: 2025-04-13 22:33:23, lat: 5.34900, lon: -3.99230, course: 203.0
2025-04-13 22:52:34  INFO: [T6e05d2e7: watch > 172.22.0.1] [SG*9139009161*0002*LK]

Is this a bug or a configuration issue?

-Fred

nebbs22513 days ago

Well, nevermind about the odd timestamp, I just figured out that it was the last GPS fix time, not the server time.
If I display the server time in the reports/route, then it matches what I see in the traccar logs. So it seems that traccar does not display the device's battery level correctly when in sleep mode (shorter hearbeat message every 300 seconds) or I missed a configuration.

report_route_2.jpg

Track-trace13 days ago

Those LK messages are just Link Keep messages where the device reports that it is still alive. They should not show up in reports i would say.

Ps.
The devices that i use with Watch protocol work correctly reporting only real position with battery in reports on 6.6

Anton Tananaev13 days ago

When a message doesn't include GPS location, Traccar will reuse the last known location. That's why you see the same fix time.