Gt06ProtocolDecoder - IndexOutOfBoundsException

ikerllona5 years ago

Hello,

I have Traccar 4.5 (logs said that the version is 4.4 though) installed on Windows machine. I´m using this tracker which uses GT06 protocol and 5023 port.

I´m having an issue at this point:

2019-05-12 17:05:59  INFO: [950b2d04] connected
2019-05-12 17:05:59  INFO: [950b2d04: 5023 < 5.35.166.144] HEX: 78780d0103536012000133670042df4f0d0a
2019-05-12 17:05:59  INFO: [950b2d04: 5023 > 5.35.166.144] HEX: 787805010042a9430d0a
2019-05-12 17:06:13  INFO: [950b2d04: 5023 < 5.35.166.144] HEX: 7878222813050c17060700d60110b8231f2710b878e32310b8639e2110b859fa2110b833ad1f10b82cde1700429a8e0d0a
2019-05-12 17:06:13  WARN: [950b2d04] 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-05-12 17:06:13  INFO: [950b2d04] disconnected

The server crashes and the tracker never connects.

The command sent by the device (49 bytes) is very similar to the one on page 38 of this GT06 manual

Thank you for your help

Anton Tananaev5 years ago

The documentation doesn't have message type 0x28, which is what your device sends.

ikerllona5 years ago

Thanks for the answer

So that message could be a device error, GT06 protocol variation?

Anyway, could it be possible to ignore this error to prevent the code crash and the disconnection of the device?

Thank you

Anton Tananaev5 years ago

It's not possible to ignore it.

ikerllona5 years ago

Excuse me, I think I´ve found the correct protocol document here

On page 12 there is a message type 0x28 called "LBS Multiple bases extension packet".

Does this make sense to you?

Thanks

Anton Tananaev5 years ago

Yes, it's already supported though.

ikerllona5 years ago

Ok, so what could be the problem that cause this error? And how could I solve it?

Thanks

Anton Tananaev5 years ago

The cause is message that doesn't match the format.