Positionid under devices stops updating

dashmeet8 years ago

Hey,

The positionid stops updating in the Devices table but the position table keeps receiving new data. Any idea why this is happening?

Anton Tananaev8 years ago

Usually it means that there is some issue with time of your "last" position.

dashmeet8 years ago

I queried the last position on the device table and the last position for that device in the database below. I'm not sure how to prevent this from happening or how to fix it. Also I'm not sure what's wrong with the data below? I have server time, device time and fix time for both.

2.3.3 :067 > TraccarPosition.where(id: 10846)
  TraccarPosition Load (77.0ms)  SELECT "positions".* FROM "positions" WHERE "positions"."id" = $1  [["id", 10846]]
 => #<ActiveRecord::Relation [#<TraccarPosition id: 10846, protocol: "h02", deviceid: 3, servertime: "2017-05-30 17:18:47", devicetime: "2017-06-02 00:02:28", fixtime: "2017-06-02 00:02:28", latitude: 35.4783076666667, longitude: -80.2495166666667, altitude: 0.0, speed: 48.85, course: 251.0, address: nil, accuracy: 0.0, network: "null">]>
2.3.3 :068 > TraccarPosition.where(deviceid: 3).last
  TraccarPosition Load (66.1ms)  SELECT  "positions".* FROM "positions" WHERE "positions"."deviceid" = $1 ORDER BY "positions"."id" DESC LIMIT $2  [["deviceid", 3], ["LIMIT", 1]]
 => #<TraccarPosition id: 10966, protocol: "h02", deviceid: 3, servertime: "2017-05-31 00:09:38", devicetime: "2017-05-31 00:09:37", fixtime: "2017-05-31 00:09:37", latitude: 35.3028526666667, longitude: -80.8000083333333, altitude: 0.0, speed: 0.0, course: 0.0, address: "6380 Mallard View Ln, Charlotte, NC, US", accuracy: 0.0, network: "null">
Anton Tananaev8 years ago

Time is clearly wrong. It might be a device issue or an issue with frame decoding. I would recommend to search on forum and github if you want more information about the frame issue and how to fix it.

dashmeet8 years ago

Do you know how I would go about fixing the system? I'm not referring to the frame issue, but rather how to start normal processes again? I tried updating the positionid in the device table, but it didn't start auto updating again.

Anton Tananaev8 years ago

You have to update or clear "positionid" in the database and restart the service.