What is fixTime field in Position table?

rb_traccar_user9 years ago

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.

Anton Tananaev9 years ago

Some devices send two timestamps:

  1. Time of the GPS fix (fixTime)
  2. 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.

rb_traccar_user9 years ago

Thanks for the explanation.