FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE
Ask a question

3723 questions

4243 answers

3160 comments

40693 members

Ask a question
0 votes
863 views
in Vehicle tracking by
I am trying to decode the data from a FMB920 device. I have got the coordinates on HEx format as below :

Lat :208e3d2b and Lng : 0e92f6c2. Converting I get the coordinates as Lat : 54.6192683 and Lng : 244512450.  But this is not the correct coordinates.
How do I calculate the correct coordinates.

I tried to convert the hex to binary and did the two complement. The location is still not correct. The actual location is somewhere in the United Arab Emirates.

1 Answer

0 votes
by

Hello touchworldtechnology,

Thank you for your question.

We want to note that you will need to check if your coordinate is negative or positive.

To determine if the coordinate is negative, convert it to binary format and check the very first bit. If it is 0, coordinate is positive, if it is 1, coordinate is negative.

Example:
Received value: 20 9C CA 80 converted to BIN: 00100000 10011100 11001010 10000000 first bit is 0, which means coordinate is positive converted to DEC: 547146368. For more information see two‘s complement arithmetic.

Please let us know if you will have more questions.

Best regards,

Teltonika Support

by

Thank you for your response. 

I was doing the same. But the coordinates I receive are not matching the actual coordinates. 

Please convert the below two coordinates :

Lat :208e3d2b and Lng : 0e92f6c2