Traccar Device comes online but it doesn't update device.positionId

user5 years ago

We have started facing one problem, when ever we add new device. The device comes online but its positionId is never set in devices table even after position entry for this device is added in position table. Note everytime new gps data is being sent from device.

user5 years ago

And also it doesn't print logs of MotionEventHandler as it does for other protocols and it prints id, time, lat, lng.

Anton Tananaev5 years ago

What do you mean by online? Does it actually send any location data?

user5 years ago

Yes it does send the location data with correct latitude and longitude. What I mean by online is when it sends the data, in web application I see its status changing from offline to online but clicking on this device would not show any attributes. To cross verify i had to see my database and I found device.positionId was never updated.

Anton Tananaev5 years ago

If you don't see any location in the web app, how do you know it sends it?

user5 years ago

When we click on device in web app. It fetches the latest position by positionId in device table. I cross checked it with other working protocols I have. They works fine and these devices positionId gets updated to lastest position.

For new protocol I was able to push the position data to position table like normally how I did in my working protocol I.e Teltonika. And I see the details getting added in this table as new row, but the field of device i.e positionId was not updated.

user5 years ago

Every time when data was parsed and updated to position table, I could see the logs for id, time fix, lat and lng being printed in console. But for my new protocol it's doesn't print but data is getting added in to position table.

Anton Tananaev5 years ago

So, you are not using official version of Traccar? Then I would recommend to debug your code step by step to find out what happens.

user5 years ago

Am using Official version of traccar. But not the latest one.

Anton Tananaev5 years ago

What "new protocol" are you talking about then?

user5 years ago

Ok I understood. But can you please tell me when does MotionEventHandler in pipeline gets executed? On what condition.

Anton Tananaev5 years ago

Read Netty documentation.