VJOYCAR GT06 timezone time offset

chuyskywalkera year ago

So, I am trying to get my GT06 protocol device to report the correct time. Here's a snippet it reporting:

2023-08-01 19:10:00  INFO: [Tc94b7852] id: 865167040296197, time: 2023-08-02 02:09:59, lat: NN.NNNNN, lon: NN.NNNNN, course: 0.0

The server time is accurate, but the time for the location data is several hours off.

First, I tried serverTime like this:

 <string key='time.override'>serverTime</string>
 <string key='time.protocols'>gt06</string>

But that's a poor solution. The device will, it seems, buffer locations when it fails to submit them. With serverTime enabled, when the device re-submits the failed location infos, these are now from a previous physical location but get marked with the current time. This makes the "replay" jump all over the place and it's a mess.

There's no way I could find to disable buffered locations -- but even if there was such an option, it's silly to not just fix the time issue.

Now I've done some more reading:

And it seems like there are a few potential solutions:

  1. Get the device to report UTC back
  2. use <entry key='gt06.timezone'>25200</entry> to fix the offset that's being reported
  3. use some kind of UI timezone parameter to fix the offset on a per-device basis

The github thread seems to have the key bit of information -- these devices are sending the localized time where traccar is expecting a UTC date and are not marking it as non-utc. Thus when traccar interprets the date as a UTC date, it's now off by whatever amount of time you original offset.

In this situation, you can use this config value <entry key='gt06.timezone'>NNNNN</entry> to offset the value back to UTC. This will ensure that the SMS responses and traccar all agree on the time.

However... while I could jump through all those hoops, I'm in a timezone that has daylight savings (ugh). Thus, no matter what, the SMS command dates will be off at some point. If were to bother to "reset" the timezone each jump, I'd also have to re-adjust the traccar config. Given I have a dozen of these devices, it makes more sense to adjust them all to GMT,W,0,0# so they report UTC as traccar is expecting and accept that the dates in SMS messages will be in UTC.

(I thought I'd document my journey in case it's helpful to others that hit this.)

chuyskywalkera year ago

(Sidenote: when I tried to post this topic directly, I got a page that just said Forbidden. I had to post the topic with the body "x" and then edit the above content into the post)

Anton Tananaeva year ago

I think the value can be configured per device in the device attributes. So you don't necessarily need to change the config and restart the server.

Anton Tananaeva year ago

As for the posting error, it is probably because of large number of URLs in the post.