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:
- Get the device to report UTC back
- use
<entry key='gt06.timezone'>25200</entry>
to fix the offset that's being reported
- 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.)
So, I am trying to get my GT06 protocol device to report the correct time. Here's a snippet it reporting:
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:
<entry key='gt06.timezone'>25200</entry>
to fix the offset that's being reportedtimezone
parameter to fix the offset on a per-device basisThe 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.)