Potentially incorrect code in GT06 protocol Decoder for Location Data Packet

Rony5 years ago

Hi Guys

I have doubt in this function of GT06ProtocolDecoder.java at this line

private boolean decodeGps(Position position, ByteBuf buf, boolean hasLength, TimeZone timezone) {
// code
...
        if (BitUtil.check(flags, 14)) {
            position.set(Position.KEY_IGNITION, BitUtil.check(flags, 15));
        }
...
//Rest of the code
}

I was looking at GT06 Protocol documentation of Concox, BSJ and other manufactures but i didn't find the use of the above code as none of the documentation has descibed this set of statement to be for Ignition.

If you can look at this Image from Protocol Documentation and also can look at official link to documentation

HEX with ignition On

78781f121405170f0027c4030e3b70085189600cd43901940b03fe00df2c00ec1ffc0d0a

Because of this we are facing false alert issue.
Use case. The user was driving and suddenly parked his car in the basement. The device lost the connection and went offline. User toggle ignition on and off but somehow the device was able to retrieve location from satellite, so it stored the location, now when the device comes in the vicinity of network, it throws the location packet with ignition on, so it toggle cache_ignition and ignition alert is triggered to the use and location packet is also valid.

But even if we don't consider the use case. According to doc i can't find anything related to ignition input in Status and course bytes.

Please shed some light.

Thanks a lot

Anton Tananaev5 years ago

How many GT06 documents have you checked? There is a million different variations. It was probably taken from one of the variants.

Rony5 years ago

I have checked the git history, it was added in the very first commit, So, I guess you probably used concox Gt06 doc, can you please look using git history.

Anton Tananaev5 years ago

Not sure what you want me to check.

Anton Tananaev5 years ago

If you can point to specific commit where it was added, I can try to find the reason.

Rony5 years ago
Rony5 years ago

Can you check with git, I am not having laptop right now

Rony5 years ago

Here is the revision number
9debdb83c7a00633b6ae751affea787afbd09729

This is a refactor commit which include this change at line no. 129

It is really hard for me to check the first ever introduction of this line in the legacy code.
I guess only you can find that.

Rony5 years ago

Hi Anton, any update regarding this
Our users are facing issues with this change, sometimes they get false alerts because of this.

I have added a comment here please check
https://github.com/traccar/traccar/commit/9debdb83c7a00633b6ae751affea787afbd09729#r39465878

Anton Tananaev5 years ago

It's a wrong commit and you know it, so I'm not sure what exactly you want me to check.

Rony5 years ago

Well, I am also not sure how do I make it simpler for you to understand but nevermind, Let's start again.
I just want to know according to which device's Protocol documentation this line is added in the GT06ProtocolDecoder.java

Rony5 years ago

Please help me if it's still unclear

Anton Tananaev5 years ago

Please read my earlier comment.

SZBSJKJa year ago

I'm an engineer from BSJ,you can contact me by the email:[removed],maybe I can help you.

vindiaa year ago

hey Rony and SZBSJKJ can you share your mail id i want some help on this traccar project