ZX303 IndexOutOfBoundsException

Freeman2 years ago

Hi,
I'm having some issues with my ZX303 when it sometimes sends data which causes an error (GT06 protocol)
It seems that most of the time the message type is 0x10 (GPS), and some other are 0x11 (GPS_LBS_6).
In the second case, the gps data is correct, but the lbs data is missing or wrong, and cause the following error :

 error - readerIndex(26) + length(2) exceeds writerIndex(27): PooledSlicedByteBuf(ridx: 26, widx: 27, cap: 27/27, unwrapped: PooledDirectByteBuf(ridx: 27, widx: 27, cap: 496)) - IndexOutOfBoundsException (... < Gt06ProtocolDecoder:338 < *:786 < *:1388 < ExtendedObjectDecoder:72 < ... < WrapperContext:102 < ...)

When failing, the ZX303 gets a disconnection.
Are there any other person having this issue or any inputs ?

Thanks in advance,

Anton Tananaev2 years ago

Please provide logs including HEX. And also please provide the protocol documentation.

Freeman2 years ago

Here are the logs, about the documentation, I guess it's the standard GT06. I bought a ZX303 from Ali, so not sure about the whole implementation.

2023-01-03 17:14:07  INFO: [T8c655538] connected
2023-01-03 17:14:07  INFO: [T8c655538: gt06 < 92.184.104.125] 78780d010861261022762799060d0a
2023-01-03 17:14:07  INFO: [T8c655538: gt06 > 92.184.104.125] 78780501762739fc0d0a
2023-01-03 17:14:28  INFO: [T8c655538: gt06 < 92.184.104.125] 787807135d0608195f0d0a
2023-01-03 17:14:28  INFO: [T8c655538: gt06 > 92.184.104.125] 78780513060820e00d0a
2023-01-03 17:14:28  INFO: [T8c655538] id: 861261022762799, time: 2023-01-03 17:13:31, lat: 46.01646, lon: 6.17135, speed: 3.2, course: 35.0
2023-01-03 17:14:32  INFO: [T8c655538: gt06 < 92.184.104.125] 78781510170103100e1f9904efe30400a97f88003410ffdd000d0a
2023-01-03 17:14:32  INFO: [T8c655538: gt06 > 92.184.104.125] 7878051010ff8df50d0a
2023-01-03 17:14:32  INFO: [T8c655538] id: 861261022762799, time: 2023-01-03 17:14:31, lat: 46.01671, lon: 6.17124, course: 16.0
2023-01-03 17:15:32  INFO: [T8c655538: gt06 < 92.184.104.125] 78780280070d0a
2023-01-03 17:15:32  INFO: [T8c655538: gt06 < 92.184.104.125] 78781511170103100e1f9904efe30400a97f88003410ffdd000d0a
2023-01-03 17:15:32  INFO: [T8c655538] error - readerIndex(26) + length(2) exceeds writerIndex(27): PooledSlicedByteBuf(ridx: 26, widx: 27, cap: 27/27, unwrapped: PooledDirectByteBuf(ridx: 27, widx: 27, cap: 512)) - IndexOutOfBoundsException (... < Gt06ProtocolDecoder:338 < *:786 < *:1388 < ExtendedObjectDecoder:72 < ... < WrapperContext:102 < ...)
2023-01-03 17:15:32  INFO: [T8c655538] disconnected
Anton Tananaev2 years ago

There is no standard GT06. There are probably hundreds of variations with small differences. That's why the documentation is essential here.

Freeman2 years ago

Ok, well, I contacted Topin to get more information about their implementation, but that seems a desperate journey :)
I'll let you know.
Regards,

DaveGG2 years ago

For topin you need use ZhongXun topin protol, read this thread https://www.traccar.org/devices/
and look down to port 5199. That is the port to you need send an sms like this DOMAIN#You.IP.Server#5199#
(You.IP.Server is you real IP server)
DOMAIN can back to the original server topin 365gps.net
SERVER can't return to original server topin.
You can use DOMAIN or SERVER in your sms.
Enjoy.

Freeman2 years ago

Hi,
Thank you for your help, that was indeed the problem.

DaveGG2 years ago

You wellcome.