Multiple GPS devices and one connection only

unky8 years ago

In my current system using OpenGTS all my GPS devices are connected to my custom java server. It looks like every devices makes connection to my java server called BUFFOR-SERVER. Then my BUFOR_SERVER server gather all datas from every devices, make only ONE connection to OpenGTS server and put all messages to OpenGTS. It works fine and all events are put in open gts database without any problem.
Summary: GPS DEVICES->many connections->BUFFER_SERVER->one connection->OpenGTS

Now I have tried this scenarion with Traccar and there is a problem because Traccar puts every messages sent bu BUFFER_SERVER to one device only. It looks like traccar allow one connection for one device. I cannot send many different GPS message to Traccar in ONE connection.
It seems that Traccar does not decode and distinguish GPS datas using IMEI. It only decode and distinguish one time per connection and then put all messages from this connection to one device only.

Is it BUG or it was Traccar idea to does not distinguish gps data and put all data from one connection to one device only?

I use Xexun - TK103-2 GPS devices.

Anton Tananaev8 years ago

It's not a bug, it's the way it works, but the behavior can be changed by setting "decoder.ignoreSessionCache" to "true" in the config.

Note that one connection per many devices won't work for some GPS trackers because they only send identification once per connection.

unky8 years ago

Thanx for answer. I will try “decoder.ignoreSessionCache” parameter :)

unky8 years ago

I have tried this parameter and now NO DEVICES are updated.
Looking at the log i see:
2017-01-22 21:38:38 WARN: Unknown device - 013777009564517 (192.168.0.103)
2017-01-22 21:38:38 WARN: Unknown device - 013777009524123 (192.168.0.103)

But I have added such devices with IMEI like above.

What is wrong now?

Anton Tananaev8 years ago

If you see "unknown device" warning, it means that devices are not registered.

unky8 years ago

I have noticed that actually I do not add two device so I have corrected it. Now I do not get messages:
2017-01-22 21:38:38 WARN: Unknown device – 013777009564517 (192.168.0.103)
2017-01-22 21:38:38 WARN: Unknown device – 013777009524123 (192.168.0.103)
Device are added to system with proper ID.

But problem still exists. All devices are not updated.

Look at belows log. It seems that messages are properly decoded. I see time/lat/lon and so on.
But devces are not update in database.

LOGFILE:

2017-01-22 21:52:54  INFO: [3C86F6A7] connected
2017-01-22 21:52:54 DEBUG: [3C86F6A7: 1010 < 192.168.0.103] HEX: 3137303132323231353233342c4f72616e67652c4750524d432c3230353233342e3030302c412c353330372e303238312c4e2c30313735392e333239322c452c302e30302c3233322e37332c3232303131372c2c2c412a36362c462c2c20696d65693a3031333737373030393532343132332c30382c36372e342c463a342e3238562c312c3133332c31343736382c3236302c30332c443445362c354139390a0d
2017-01-22 21:52:54 DEBUG: [3C86F6A7: 1010 < 192.168.0.103] HEX: 3137303132323231353233342c3530382c4750524d432c3230353233342e3030302c412c353330372e333139332c4e2c30313830302e313434362c452c302e30302c39372e37312c3232303131372c2c2c412a35342c462c2c20696d65693a3031333934393030393938393830302c30382c33322e302c463a342e3234562c312c3132392c32363236362c3236302c30332c443445362c354132310a0d3137303132323231353233392c3332343230363034302c4750524d432c3230353233392e3030302c412c353330372e323938352c4e2c30313830302e313130372c452c302e30302c3334392e37372c3232303131372c2c2c412a36312c462c2c20696d65693a3031333737373030393536343235312c30382c34322e392c463a342e3230562c312c3133362c33363032312c3236302c30332c443445362c363234410a0d3137303132323231353234392c4f72616e67652c4750524d432c3230353234392e3030302c412c353330372e303238312c4e2c30313735392e333239322c452c302e30302c3233322e37332c3232303131372c2c2c412a36432c462c2c20696d65693a3031333737373030393532343132332c30382c36372e352c463a342e3238562c312c3133332c34303038322c3236302c30332c443445362c354139390a0d3137303132323231353234382c4f72616e67652c4750524d432c3230353234382e3030302c412c353330372e323938382c4e2c30313830302e313333372c452c302e30302c3139352e39322c3232303131372c2c2c412a36332c462c2c20696d65693a3031333737373030393536343531372c30392c33362e392c463a342e3238562c312c3133332c32353339372c3236302c30332c443445362c354132310a0d3137303132323231353235312c4f72616e67652c4750524d432c3230353235312e3030302c412c353330372e323939382c4e2c30313830302e313233352c452c302e30302c3334382e35382c3232303131372c2c2c412a36442c462c2c20696d65693a3031333737373030393532393536392c30382c32342e322c463a342e3239562c312c3133332c31323237372c3236302c30332c443445362c354132310a0d3137303132323231353235322c3530382c4750524d432c3230353235322e3030302c412c353330372e333139332c4e2c30313830302e313434362c452c302e30302c39372e37312c3232303131372c2c2c412a35342c462c2c20696d65693a3031333934393030393938393830302c30392c33312e392c463a342e3234562c312c3132392c35303634392c3236302c30332c443445362c354132310a0d
2017-01-22 21:52:54  INFO: [3C86F6A7] id: 013777009524123, time: 2017-01-22 21:52:34, lat: 53.11714, lon: 17.98882, speed: 0.0, course: 232.7
2017-01-22 21:52:54  INFO: [3C86F6A7] id: 013777009524123, time: 2017-01-22 21:52:49, lat: 53.11714, lon: 17.98882, speed: 0.0, course: 232.7
2017-01-22 21:52:54  INFO: [3C86F6A7] id: 013777009529569, time: 2017-01-22 21:52:51, lat: 53.12166, lon: 18.00206, speed: 0.0, course: 348.6
2017-01-22 21:52:54  INFO: [3C86F6A7] id: 013777009564517, time: 2017-01-22 21:52:48, lat: 53.12165, lon: 18.00223, speed: 0.0, course: 195.9
2017-01-22 21:52:54  INFO: [3C86F6A7] id: 013949009989800, time: 2017-01-22 21:52:52, lat: 53.12199, lon: 18.00241, speed: 0.0, course: 97.7
2017-01-22 21:52:54  INFO: [3C86F6A7] id: 013949009989800, time: 2017-01-22 21:52:34, lat: 53.12199, lon: 18.00241, speed: 0.0, course: 97.7
2017-01-22 21:52:54  INFO: [3C86F6A7] id: 013777009564251, time: 2017-01-22 21:52:39, lat: 53.12164, lon: 18.00185, speed: 0.0, course: 349.8
2017-01-22 21:52:56 DEBUG: [3C86F6A7: 1010 < 192.168.0.103] HEX: 3137303132323231353235342c3332343230363034302c4750524d432c3230353235342e3030302c412c353330372e323938352c4e2c30313830302e313130372c452c302e30302c3334392e37372c3232303131372c2c2c412a36412c462c2c20696d65693a3031333737373030393536343235312c30382c34322e392c463a342e3230562c312c3133362c35363934372c3236302c30332c443445362c363234410a0d
2017-01-22 21:52:56  INFO: [3C86F6A7] id: 013777009564251, time: 2017-01-22 21:52:54, lat: 53.12164, lon: 18.00185, speed: 0.0, course: 349.8
2017-01-22 21:53:01 DEBUG: [3C86F6A7: 1010 < 192.168.0.103] HEX: 3137303132323231353330312c4f72616e67652c4750524d432c3230353330312e3030302c412c353330372e303238312c4e2c30313735392e333239312c452c302e30302c3233322e37332c3232303131372c2c2c412a36322c462c2c20696d65693a3031333737373030393532343132332c30392c36372e362c463a342e3237562c312c3133332c35373831302c3236302c30332c443445362c354139390a0d
2017-01-22 21:53:01  INFO: [3C86F6A7] id: 013777009524123, time: 2017-01-22 21:53:01, lat: 53.11714, lon: 17.98882, speed: 0.0, course: 232.7
2017-01-22 21:53:01 DEBUG: [3C86F6A7: 1010 < 192.168.0.103] HEX: 3137303132323231353235392c4f72616e67652c4750524d432c3230353235392e3030302c412c353330372e323938382c4e2c30313830302e313333372c452c302e30302c3139352e39322c3232303131372c2c2c412a36332c462c2c20696d65693a3031333737373030393536343531372c30392c33372e302c463a342e3238562c312c3133332c31373939322c3236302c30332c443445362c354132310a0d
2017-01-22 21:53:02  INFO: [3C86F6A7] id: 013777009564517, time: 2017-01-22 21:52:59, lat: 53.12165, lon: 18.00223, speed: 0.0, course: 195.9
2017-01-22 21:53:03 DEBUG: [3C86F6A7: 1010 < 192.168.0.103] HEX: 3137303132323231353330332c4f72616e67652c4750524d432c3230353330332e3030302c412c353330372e323939382c4e2c30313830302e313233352c452c302e30302c3334382e35382c3232303131372c2c2c412a36422c462c2c20696d65693a3031333737373030393532393536392c30392c32342e322c463a342e3239562c312c3133332c33383130352c3236302c30332c443445362c354132310a0d
2017-01-22 21:53:03  INFO: [3C86F6A7] id: 013777009529569, time: 2017-01-22 21:53:03, lat: 53.12166, lon: 18.00206, speed: 0.0, course: 348.6
2017-01-22 21:53:04 DEBUG: [3C86F6A7: 1010 < 192.168.0.103] HEX: 3137303132323231353330342c3530382c4750524d432c3230353330342e3030302c412c353330372e333139332c4e2c30313830302e313434362c452c302e30302c39372e37312c3232303131372c2c2c412a35362c462c2c20696d65693a3031333934393030393938393830302c30392c33312e392c463a342e3234562c312c3132392c35333030392c3236302c30332c443445362c354132310a0d
2017-01-22 21:53:04  INFO: [3C86F6A7] id: 013949009989800, time: 2017-01-22 21:53:04, lat: 53.12199, lon: 18.00241, speed: 0.0, course: 97.7
2017-01-22 21:53:12 DEBUG: [3C86F6A7: 1010 < 192.168.0.103] HEX: 3137303132323231353330392c3332343230363034302c4750524d432c3230353330392e3030302c412c353330372e323938352c4e2c30313830302e313130372c452c302e30302c3334392e37372c3232303131372c2c2c412a36332c462c2c20696d65693a3031333737373030393536343235312c30372c34322e392c463a342e3230562c312c3133362c33303335322c3236302c30332c443445362c363234410a0d
2017-01-22 21:53:12  INFO: [3C86F6A7] id: 013777009564251, time: 2017-01-22 21:53:09, lat: 53.12164, lon: 18.00185, speed: 0.0, course: 349.8
2017-01-22 21:53:19 DEBUG: [3C86F6A7: 1010 < 192.168.0.103] HEX: 3137303132323231353331392c4f72616e67652c4750524d432c3230353331392e3030302c412c353330372e303238312c4e2c30313735392e333238392c452c302e30302c3233322e37332c3232303131372c2c2c412a36322c462c2c20696d65693a3031333737373030393532343132332c30382c36382e302c463a342e3237562c312c3133332c33333337372c3236302c30332c443445362c354139390a0d
2017-01-22 21:53:19  INFO: [3C86F6A7] id: 013777009524123, time: 2017-01-22 21:53:19, lat: 53.11714, lon: 17.98882, speed: 0.0, course: 232.7
Anton Tananaev8 years ago

If you see messages decoded and there are no warnings, it means that they have been saved in the database. Please double-check everything before claiming that there is some problem.

unky8 years ago

I have tracked again where is a problem and I see that messages are finally added to database.
The problem was that I checked it in WebGui and I looked in DeviceList window. Looking there all devices field "Last Update" is RED and there is no date in this field.

Look at screenshot below:
Screenshot WebGui

Anton Tananaev8 years ago

That will be fixed in the next release. The code is already there on GitHub, if you want to make your own build.

unky8 years ago

Is it already fixed on GitHub?

unky8 years ago

OK, source downloaded from GitHub and compiled. Now "Last Update" is working properly and it looks fine.
Thanx a lot Anton Tananaev. You are doing great job! :)

rmoreno7 years ago

hello Anton Tananaev, I'm new with traccar, I have it mounted on a ubuntu server. I connected it to postgresql, My Doubt is ¿ I can connect a single traccar with more than one db postgresq ?

Regards;

Anton Tananaev7 years ago

No, Traccar can only work with a single database at the moment.