GT06 LBS IndexOutOfBoundsException

chris d6 years ago

I am experiencing the following error: Connecting an LBS only tracker using GT06 protocol, I see the following error in the log (personal data replaced with xxx):

2019-02-27 09:15:08  INFO: [930c5f68] connected
2019-02-27 09:15:08  INFO: [930c5f68: 5023 < xxx.xxx.xxx.xxx] HEX: 78780d0103535xxxxxxxxxxx003cc3e20d0a
2019-02-27 09:15:08  INFO: [930c5f68: 5023 > xxx.xxx.xxx.xxx] HEX: 78780501003c33ba0d0a
2019-02-27 09:15:11  INFO: [930c5f68: 5023 < xxx.xxx.xxx.xxx] HEX: 787822280f06020c0036010403c7d27e302fc76ecc4c24c7d276cd21c7d230101fc76e300c1cc76e7e2c16003c51860d0a
2019-02-27 09:15:11  WARN: [930c5f68] error - readerIndex(49) + length(2) exceeds writerIndex(49): PooledSlicedByteBuf(ridx: 49, widx: 49, cap: 49/49, unwrapped: PooledHeapByteBuf(ridx: 49, widx: 49, cap: 1024)) - IndexOutOfBoundsException (... < Gt06ProtocolDecoder:631 < *:505 < *:898 < ExtendedObjectDecoder:51 < ... < WrapperContext:102 < ...)
2019-02-27 09:15:11  INFO: [930c5f68] disconnected

Knowing the nearby base stations I can interpret the string in the following way:

10403 
MCC MNC

Then there come six visible cells with some sort of power level for each cell with the following pattern

c7d2 7e30 2f 
LAC  CID  Power

Cells seem to be ordered with decreasing power level. I do not have a protocol specification of the device, so I do not know if the transmitted data adheres to a defined standard which Traccar can parse appropriately. The error happens always and for every LBS position data sent to the server. If there are less than 6 visible cells, the string is simply padded with zeros and it looks like this

2019-02-27 01:00:21  INFO: [8cc52b0e: 5023 < xxx.xxx.xxx.xxx] HEX: 78780d0103535xxxxxxxxxxx00056fa00d0a
2019-02-27 01:00:21  INFO: [8cc52b0e: 5023 > xxx.xxx.xxx.xxx] HEX: 7878050100059ff80d0a
2019-02-27 01:00:22  INFO: [8cc52b0e: 5023 < xxx.xxx.xxx.xxx] HEX: 787822280f0602032e05010403c7d2c4ee10c7d276ce0cc76e7c0307c76ecd3406c7d228ad0600000000000005f5de0d0a
2019-02-27 01:00:22  WARN: [8cc52b0e] error - readerIndex(49) + length(2) exceeds writerIndex(49): PooledSlicedByteBuf(ridx: 49, widx: 49, cap: 49/49, unwrapped: PooledHeapByteBuf(ridx: 49, widx: 49, cap: 1024)) - IndexOutOfBounds
Exception (... < Gt06ProtocolDecoder:631 < *:505 < *:898 < ExtendedObjectDecoder:51 < ... < WrapperContext:102 < ...)
2019-02-27 01:00:22  INFO: [8cc52b0e] disconnected

Can anybody confirm if the device is sending a wrongly formatted string or if there might be an error in Traccar parsing the string?

Anton Tananaev6 years ago

You would need to get protocol documentation to confirm that.