I am testing Traccar with MySQL, primarily for TK103 protocol. I find that there are three TIMESTAMP fields in the 'position' table, all of which are apparently being used to record the time of the device's position - serverTime, deviceTime, fixTime.
While serverTime and deviceTime are somewhat self-explanatory to me, I do not follow fixTime. Its values differ from the other two in some records. I also see that 'position' table is indexed on deviceId+fixTime, which implies that it is an important field.
May I know what does this field actually record and how is it different from the other two?
Also, if I need to query the position table for a date/time range, is it best to query on the fixTime field instead of the other two fields?
Thanks.
Some devices send two timestamps:
- Time of the GPS fix (fixTime)
- Time when the message was formed (deviceTime)
Also, if message from device doesn't contain location data, but have some other valuable information (for example, sensor data), Traccar decodes that data and uses latest known GPS location. That's how you can get different values for fixTime and deviceTime columns.
For queries it's better to use fixTime as there is an index for it.
Thanks for the explanation.
I am testing Traccar with MySQL, primarily for TK103 protocol. I find that there are three TIMESTAMP fields in the 'position' table, all of which are apparently being used to record the time of the device's position - serverTime, deviceTime, fixTime.
While serverTime and deviceTime are somewhat self-explanatory to me, I do not follow fixTime. Its values differ from the other two in some records. I also see that 'position' table is indexed on deviceId+fixTime, which implies that it is an important field.
May I know what does this field actually record and how is it different from the other two?
Also, if I need to query the position table for a date/time range, is it best to query on the fixTime field instead of the other two fields?
Thanks.