Telic decoding with wrong long/lat

Henrik6 years ago

Hi,

we are using the latest traccar docker image and have some GPS devices connected to it. I would like to add some telic devices ( Telic SBC-AVL and Picotrack Endurance Rechargeable) but the traccar server is showing me the wrong longitude and latitude. Other traccars from other manufactures are working without any problems.

I have configured the telic devices to port 5067 of my traccar server. I can see the messages in the traccar-log. I have manually decoded the HEX values which are coming from the telic devices and talked to telic about it. The problem seems to be the traccar server. One example:

Log entry:

2019-06-06 10:48:54  INFO: [a03911e1]: 5067 < xx.xx.xx.xx] HEX: 
303032363335373234373035383030313138377c3236327c30317c30303130303230313500780000003030323133353732343730353830303131383739392c3036303631393039353835352c302c3036303631393039353835352c3030383533313538352c35323032343435382c332c302c302c342c2c2c35342c363231333836332c2c3030303030302c30302c333533342c303030302c303030302c3032303000

2019-06-06 10:48:54  INFO: [a03911e1] id: 357247058001187, time: 2019-06-06 09:58:55, lat: 52.04076, lon: 8.88598, course: 0.0

Decoded HEX to ASCII is:

0026357247058001187|262|01|001002015002135724705800118799,060619095855,0,060619095855,008531585,52024458,3,0,0,4,,,54,6213863,,000000,00,3534,0000,0000,0200

The telic sends the coordinates:
52.024458 and 8.531585 which are the correct coordinates. But the traccar server uses the coordinates lat: 52.04076, lon: 8.88598

Thanks for your help!

Henrik6 years ago

The same 'problem' occurs on the traccar demo server ( http://demo5.traccar.org/ ).

All of the GPS Positions are somehow shifted to (north) east. (~30 km airline)

Anton Tananaev6 years ago

Do you have protocol documentation?

Henrik6 years ago

The protocol documentation is available here: https://we.tl/t-jl2Zj0DoPF

I have found out what seems to be the probem:

In the TelicProtocolDecoder.java class this statement is used:

        if (parser.hasNext(6)) {
            position.setLongitude(parser.nextCoordinate(Parser.CoordinateFormat.DEG_MIN_MIN));
            position.setLatitude(parser.nextCoordinate(Parser.CoordinateFormat.DEG_MIN_MIN));
}

When i have a look in the Parser class the following is done with the coordinates:

case DEG_MIN_MIN:
                coordinate = nextInt(0);
                coordinate += Double.parseDouble(next() + '.' + next()) / 60;
break;

I guess this is done because the telic tracker should send degrees and minutes splitted but it seems to be correct to just divede the values you are using for parsing with 100. Than the correct values are shown. So this gives me the correct values:

case DEG_MIN_MIN:
                coordinate = nextInt(0);
                coordinate += Double.parseDouble(next() + '.' + next()) / 100;
break;

Another example where the coordinates are decoded wrong:

2019-06-06 07:22:00  INFO: [45c5c62a: 5067 < 176.83.213.208] HEX: 303032363335333136313037323735323434307c3236327c30327c30303230303430323000
2019-06-06 07:22:01  INFO: [45c5c62a: 5067 < 176.83.213.208] HEX: 730000003030323133353331363130373237353234343039392c3036303631393037323230302c302c3036303631393037323135392c3030373336303034382c34393939393338302c332c34352c3130312c392c2c2c3437332c343539313631302c2c303030302c30302c302c3230322c302c3034313400
2019-06-06 07:22:01  INFO: [45c5c62a] id: 353161072752440, time: 2019-06-06 07:21:59, lat: 50.66563, lon: 7.60008, speed: 24.3, course: 101.0

Transformed HEX to ASCII is:

002135316107275244099,060619072200,0,060619072159,**007360048,49999380**,3,45,101,9,,,473,4591610,,0000,00,0,202,0,0414

The correct values for longitude and latitude should be:
7.360048 and 49.999380

Traccar decodes it to:
7.60008 and 50.66563

When i now take the figures after the dot and multiply it with sixty and divde it with 100 i get the correct values. In this example the figure in front of the dot is also wrong because in your calculation (divide with 60) you get a result which is greater than 1.

Anton Tananaev6 years ago

Looks like there are several different variations of the protocol. I need to know how to distinguish between two.

Henrik6 years ago

I asked Telic which devices use another protocol than the one which is avaible with the SBC_AVL or Picotrack. They say that every telic device is using the accuracy of 100μ° or 1μ°. It is possible to distinguish between them by the length of longitude and latitude:

Extended GPS position Mode 
In standard mode the GPS position is transmitted in a accuracy of 100μ°. Therefore the latitude has a maximum string length of 7 characters and the longitude 6 characters. 
If the extended mode is activated, the resolution is 1μ° and the latitude is always transmitted with a fix minimum string length of 8 and the longitude with a fix minimum string length of 9.
So the Server can detect the setting of GPS accuracy by checking the string length without the knowledge of this configuration in the device.

They say that there is no other protocol used by any of the Telic devices. It is possible to see which telic device is used in the HEX codes:

Current values when document was created:
SBC-AVL: Code = 0404, 0406, 0409
SBC-AVL Power: Code = 0405, 0407, 0410,

Anton Tananaev6 years ago

Updated decoder to work according to your quote.

Henrik6 years ago

Thank you! Can you give me an estimation when the next docker version including this commit will be available?

Anton Tananaev6 years ago

Unfortunately not.

Henrik6 years ago

When will it be decided when there will be the next update? We would like to fix the bug as soon as possible, but still use the Docker package. Is there any other way to fix the bug in our system as soon as possible?