Hex Decoder Gibberish. Why?

sebi5361 6 years ago

I have a Chinese Clone GPS Tracker.
I tested a bunch of ports and made it work flawlessly on Traccar with port 5013.
Based on the supported devices page, port 5013 corresponding protocol seems to be h02.

I am trying to verify that my protocol is indeed h02 based on the content of my tracker-server.log file:

2020-03-24 14:52:56  INFO: [5541b115: h02 < 5.35.166.138] HEX: 2491711824631352522403204337228604003505090c000000ffffdfff0000197d0000000000d0140110c8fae7
2020-03-24 14:52:56  INFO: [5541b115] id: 9171182463, time: 2020-03-24 14:52:52, lat: 43.62048, lon: 3.84182, course: 0.0

The Hex decoder of the HEX part gives:

[binary data]

...which looks like gibberish to me and has nothing to do with:

'h02' : '*HQ,123456789012345,V1,121300,A,6000.0000,N,13000.0000,E,0.00,0.00,010112,ffffffff,000000,000000,000000,000000#'

...found in the test-integration.py file.
What am I doing wrong? Thanks!

Anton Tananaev 6 years ago

You should carefully read the supported devices page, especially what's written at the top.

sebi5361 6 years ago

I am sorry but I don't get what I should understand from that page.
That port 5013 is not related to protocol h02 only?
Can you be more precise?

Anton Tananaev 6 years ago

If you own a Chinese device, please make sure to check the page about clones.

sebi5361 6 years ago

Yes I have read the page about clones.
That's why I tested many ports and ended up making it work with port 5013.
But I also tried to identify the protocole and this is where I am having trouble analysing the HEX string.
What should I understand from the page about clones that I didn't understand?

Anton Tananaev 6 years ago

Well, H02 supports both text and binary formats. HEX decoder obviously won't work on the binary.

sebi5361 6 years ago

OK.
So if I understand right my HEX string contains latitude, longitude, etc. encoded with the h02 protocol, but in a binary format that cannot be decrypted by the HEX decoder. Is that right?
Is there an alternative tool to decrypt it?

Anton Tananaev 6 years ago

HEX decoder only works if it's a text protocol. It doesn't work for binary ones. Some vendors provide tools to decode their binary protocols, but there's no generic tool for obvious reasons.

sebi5361 6 years ago

Got it.
But Traccar knows obviously how to decrypt it.
Do you know in which part of the code this is done?

Anton Tananaev 6 years ago

It's done in protocol decoder.

sebi5361 6 years ago

Thanks

Foxchip 6 years ago

I have also a H02 device : CCTR-830G
How to know with information are sent by the tracker? I would like to know if I can read fuel information!

sebi5361 6 years ago

Looking at the State Panel in Traccar, additional information than latitude and longitude is given (E.g., a warning if my tracker is disconnected from its main power source). You should have a look there to see if information about fuel is mentioned.

According to the sample in the test-integration.py file regarding the h02 protocole, there are many additional information than the latitude and longitude. The code of the protocol decoder should give you some clues too.

But I am not an expert...