timezone issue on gt06 protocol

armana year ago

hello
i setup traccar with sqlserver database on a linux server using docker compose. we have devices that use gt06 protocol and all of them have timezone equal to E,3,30. the problem is devicetime and fixtime values are behind the UTC datetime. i checked multiple topics regarding gt06 devices but couldn't figure out why my configurations are ignored.
i tried to decode hex packet and found out device sends datetime in UTC:

17 > 23
0b > 11
17 > 23
0f > 15
0a > 10
08 > 8

things i applied to fix this (according to other topics):

  • device timezone attribute (different values to see if anything changes: GMT, 0, UTC, Asia/Tehran)
  • decoder.timezone configuration option
  • gt06.timezone configuration option
  • setting timezone on user level
  • setting timezone on server level

i didn't apply them altogether and made sure to restart service after each change. the issue is, nothing changes after setting these and values stay the same. im using latest docker image with tag traccar:5

i appreciate if you could help me figure this out. i can provide more info if required.

service log:

2023-11-23 15:10:10  INFO: [Tefdd1378: gt06 < 113.203.107.205] 78782222170b170f0a08c803e2e9b8064ed38000551801b00b09f700528a000e000107284f0d0a
2023-11-23 15:10:10  INFO: [Tefdd1378] id: 351742101656249, time: 2023-11-23 11:40:08, lat: 36.22368, lon: 58.79403, course: 280.0

position record on database:

servertime devicetime fixtime attributes
2023-11-23 15:10:10.6040000 2023-11-23 11:40:08.0000000 2023-11-23 11:40:08.0000000 {"sat":8,"ignition":false,"event":14,"archive":false,"distance":0.0,"totalDistance":13630.236355705449,"motion":false,"hours":85000}
Anton Tananaeva year ago

If your device is reporting UTC time, that's what we want. Don't need to change that part.

Make sure you check the login message to see if it includes any timezone other than UTC. If yes, you should be able to use gt06.timezone to set it to UTC.

armana year ago

thank you. i checked logs and found this:

2023-11-23 16:17:28  INFO: [T266b0dec: gt06 < 83.123.62.79] 787811010351742101656249220314a10011c8ec0d0a

i guess there is a timezone info in this but i can't easily decode it. checked https://www.traccar.org/protocols/ there are multiple documents for gt06 protocol. don't know which one to read.
besides i tested gt06.timezone first time i tried to fix this issue. but can check again. is this the correct form to add:

<entry key='gt06.timezone'>UTC</entry>
Anton Tananaeva year ago

Sorry, actually I think it should be decoder.timezone. You can either set it in the config or in the device attributes.

armana year ago

okay this is the result. first on is before applying attribute. second is after that. i restarted service.

id servertime devicetime fixtime
12711006 2023-11-23 17:32:00.2060000 2023-11-23 14:01:59.0000000 2023-11-23 14:01:59.0000000
12711484 2023-11-23 17:39:02.7550000 2023-11-23 14:09:01.0000000 2023-11-23 14:09:01.0000000
screenshot
Anton Tananaeva year ago

I think I found an issue. I'll follow up a bit later.

armana year ago

thanks
i also checked the login packet section on this document here and it seems to match the length of packet on my second previous message (22 bytes), currently trying to understand how conversion works

Anton Tananaeva year ago
armana year ago

thank you
im using docker. should i wait for the image to be pushed or do something else

Anton Tananaeva year ago

Yes, unless you want to do your own build.

armana year ago

ok i wait. can you say when that might happen ?

ADABmana year ago

I just started with Traccar recently, and a fix was provided for an issue I was having (Thanks Anton!). What I did that worked for me for testing asap was clone the Github repo, then installed gradle + default-jdk (Ubuntu 22.04) and ran "./gradlew assemble" in the root of the repo.
In the target folder was the output file tracker-server.jar.

I added this to my docker-compose.yml under the volumes section to override the image provided jar:

  • ./volumes/traccar/tracker-server.jar:/opt/traccar/tracker-server.jar:ro

Worked instantly for me, which was a happy surprise since I have never done anything with gradle or java before and it just worked!

armana year ago

so i did what ADABman explained and then added configuration for decoder timezone in traccar.xml like this:

<entry key='decoder.timezone'>0</entry>

and that fixed my issue :-)
thanks Anton
thanks ADABman