Wrong device time

GrueneNeun3 years ago

Hello everyone,

i installed a Traccar server on an Ubuntu 20.04LTS VM. The VM has its timezone set to "Europe/Berlin" and shows the correct time:

              Local time: Mo 2022-02-28 12:15:04 CET
           Universal time: Mo 2022-02-28 11:15:04 UTC
                 RTC time: Mo 2022-02-28 11:15:05
                Time zone: Europe/Berlin (CET, +0100)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

I have two Teltonika RUT955 Routers with integrated GPS capabilities which i would like to monitor via Traccar. I succesfully added them to Traccar and they regularly send their positions. They also are set to "Europe/Berlin" in their time settings - this can't be changed because they themselves act as time servers. But in the Traccar GUI and in the logfile, the time reported is 2 hours in the future.

2022-02-28 12:19:06  INFO: [3d1a8ec5: teltonika < XXX.XXX.XXX.XXX] HEX: 00000000000000f308080000017f407571a80003fdda831ea62181002600000800000000000000000000017f40765c080003fddadc1ea62163002700000800000000000000000000017f407746680003fddb151ea6214f002700000600000000000000000000017f407830c80003fddb341ea6213f002800000800000000000000000000017f40791b280003fddb4a1ea62135002800000700000000000000000000017f407a05880003fddbad1ea62111002900000600000000000000000000017f407aefe80003fddbe51ea620ff002900000400000000000000000000017f407bda480003fddbf51ea620f100290000080000000000000000080000dda3
2022-02-28 12:19:06  INFO: [3d1a8ec5: teltonika > XXX.XXX.XXX.XXX] HEX: 00000008
2022-02-28 12:19:06  INFO: [3d1a8ec5] id: 868159051661416, time: 2022-02-28 14:11:53, lat: 51.42040, lon: 6.69682, course: 0.0
2022-02-28 12:19:06  INFO: [3d1a8ec5] id: 868159051661416, time: 2022-02-28 14:14:53, lat: 51.42040, lon: 6.69684, course: 0.0
2022-02-28 12:19:06  INFO: [3d1a8ec5] id: 868159051661416, time: 2022-02-28 14:15:53, lat: 51.42040, lon: 6.69684, course: 0.0
2022-02-28 12:19:06  INFO: [3d1a8ec5] id: 868159051661416, time: 2022-02-28 14:13:53, lat: 51.42040, lon: 6.69683, course: 0.0
2022-02-28 12:19:06  INFO: [3d1a8ec5] id: 868159051661416, time: 2022-02-28 14:17:53, lat: 51.42039, lon: 6.69685, course: 0.0
2022-02-28 12:19:06  INFO: [3d1a8ec5] id: 868159051661416, time: 2022-02-28 14:12:53, lat: 51.42040, lon: 6.69683, course: 0.0
2022-02-28 12:19:06  INFO: [3d1a8ec5] id: 868159051661416, time: 2022-02-28 14:16:53, lat: 51.42039, lon: 6.69685, course: 0.0
2022-02-28 12:19:06  INFO: [3d1a8ec5] id: 868159051661416, time: 2022-02-28 14:18:53, lat: 51.42039, lon: 6.69686, course: 0.0

I already set Server timezone (in Traccar) to "Europe/Berlin" and also set the devices timezone in Traccar.
While searching for a solution, i also modified the unit file so it contains the timezone for the JVM:

ExecStart=/opt/traccar/jre/bin/java -Duser.timezone="Europe/Berlin" -Xmx1G -jar tracker-server.jar conf/traccar.xml

I even deleted a device and re-added it with the correct timezone configured right from the beginning.

Up to now, nothing changed the 2 hour difference - maybe someone can point me in the right direction of what i am missing?

GrueneNeun3 years ago

Update: To get a different reading, i also checked with my smartphone which reports the correct local time. So the problem seems to only to exist with the Teltonika devices...

Anton Tananaev3 years ago

Traccar expects UTC time from devices.

GrueneNeun3 years ago

Okay, so there is no possibility to tell Traccar that a device sends its time in local time for a specific timezone?

Anton Tananaev3 years ago

There is a configuration option for some protocols using decoder.timezone.

GrueneNeun3 years ago

I already tried that, it did not change the time reported in the log file. Do i have to restart the traccar process or something after such a change?

Anton Tananaev3 years ago

Yes, for any configuration change you obviously need to restart the server.

GrueneNeun3 years ago

So i set the timezone for one of the devices in the device attributes via the GUI, stopped the server and started it again, the log clearly states that it did start. I even restarted both of the RUT955 devices to be sure they establish a new connection if that matters.
Still, both report their positions with a timestamp 2 hours in the future - so it seems the timezone setting unfortunately made no difference.

Did i do something wrong? Is there anything else i can try than setting the devices timezone to "Europe/Berlin"?

Anton Tananaev3 years ago

It could be that the timezone is not supported for this specific protocol. What protocol are you using?

GrueneNeun3 years ago

The devices are Teltonika RUT955 Routers, so they use "teltonika" on port 5027.

Anton Tananaev3 years ago

Looks like it's not supported for Teltonika currently.