Kingneed GPS Units Speed Issue

vk3vcs8 years ago

Hello
I have imported some kingneed GPS units that seem to operate on port 5002 as a TK103 however i can not get it to report the correct speed, Looking at the HEX from the device it all looks ok but the calculation in traccar server seems to reduce it by about 1/2. I know this issue may already be answered but i'm not able to find the resolution.

Anton Tananaev8 years ago

By default Traccar stores and shows speed in knots.

vk3vcs8 years ago

Hi Anton,

I managed to find a post from 2015 in regards to Kingneed GPS protocol: See below

1.2 LLC format: (BP05)
(013632651491,BP05,040613,A,2234.0297N,11405.9101E,000.0,040137,17
8.48)
"(" stands for packet start
"013632651491" stands for tracker ID
"BP05" stands for data command
"040613" stands for data, 04/June/2013
"A" stands for GPS valid data,
"V"stands for GPS invalid data
"2234.0297" stands for latitude, format is ddmm.mmmm
"N" stands for north,
"S"stands for south
"11405.9101" stands for longitude, format is dddmm.mmmm
"E" stands for east,
"W"stands for west
"000.0" stands for speed, unit is km/h
"040137" stands for time, 04:01:37, UTC time
"178.48" stands for direction
"1.21" stands for altitude
"8" stands for stars
")" stands for packet end 

HEX IS:

283836343736383031303933343639302c425030352c3032303331372c412c333735312e3633303639532c31343434362e3633393931452c35372e3436392c3031313930302c31312e37322c31342e38302c31322c313729283836343736383031303933343639302c425030352c3032303331372c412c333735312e3437313835532c31343434362e3637383134452c35372e3030372c3031313931302c392e38362c31302e31302c31322c313729283836343736383031303933343639302c425030352c3032303331372c412c333735312e3332303337532c31343434362e3731343338452c35342e3933332c3031313932302c31302e37312c31342e32302c31322c313729

Decodes As:

(864768010934690,BP05,020317,A,3751.63069S,14446.63991E,57.469,011900,11.72,14.80,12,17)(864768010934690,BP05,020317,A,3751.47185S,14446.67814E,57.007,011910,9.86,10.10,12,17)(864768010934690,BP05,020317,A,3751.32037S,14446.71438E,54.933,011920,10.71,14.20,12,17)

Log Shows:

2017-03-02 12:19:35  INFO: [6E6C158F] id: 864768010934690, time: 2017-03-02 12:19:20, lat: -37.85534, lon: 144.77857, speed: 29.6, course: 10.7
2017-03-02 12:19:35  INFO: [6E6C158F] id: 864768010934690, time: 2017-03-02 12:19:00, lat: -37.86051, lon: 144.77733, speed: 31.0, course: 11.7
2017-03-02 12:19:35  INFO: [6E6C158F] id: 864768010934690, time: 2017-03-02 12:19:10, lat: -37.85786, lon: 144.77797, speed: 30.8, course: 9.9

As you can see above Hex is decoded at 57Knots which is about 105 Kmh however Log shows a lot less.

Any help would be greatly appreciated.
Thanks

Anton Tananaev8 years ago

You are contradicting yourself. First you say that device sends speed in km/h, but then you are saying that it's in knots.

As far as I can see, everything is decoded according to the documentation: 57 km/h ~ 30 knots.

vk3vcs8 years ago

Thank you Anton, I'm not the smartest tool in the shed :-) please forgive my confusion,

The device is reporting in knots, so device is sending in knots 57.469 but as listed above it gets reduced to 30.8 knots in the Log output,

Sorry..

Dave

Anton Tananaev8 years ago

What about the "post from 2015 in regards to Kingneed GPS protocol"? It says that the speed is in km/h.

Anyway, it's possible to configure expected units in the config. Set "tk103.speed" to "kn", if device is sending knots.

vk3vcs8 years ago

Anton you are awesome that worked

thank you so much...

Cheers
Dave

Ben Bull7 years ago

Hi Anton,

Im having a similar issue with a Kingneed TK05/TK10 device and Tk103 protocol. Device is sending kph but it seems as if the code is not converting it to knots to be stored in the DB.

Am I right in saying that line 407 in the Tk103protocolDecoder should read:

position.setSpeed(UnitsConverter.knotsFromKph(parser.nextDouble(0))); // instead of
position.setSpeed(convertSpeed(parser.nextDouble(0), "kmh")); // as it currently does?

and that import org.traccar.helper.UnitsConverter; should be included in the decoder's header?

Apologies if i'm missing something.
Cheers,
Ben

Anton Tananaev7 years ago

You are missing the fact that different device models report speed in different units, not always km/h.