Vehicle status is a number in HEX format.
If you carefully read the documentation that you referenced, you'll notice that there are two types of messages. One is text-based and the other one is binary. Obviously you can't decode binary message into a text string.
So, you mean the heartbeat message is the only thing which I should worry about and calculate everything from this?
No, that's not what I meant.
ok I spent some more time to read this document and found "FFFFFBFF" in the end, is in hex format which when converts to decimal gives us 4294966271 and further this is converted in binary gives us 11111111111111111111101111111111
and if I split it into chunks of eight like this 11111111 11111111 11111011 11111111
I can make some information out of it. I am not sure how to decode information from these 0s and 1s based on that document, how should I understand this part? Also Can you please clarify about "negative logic" does this means I consider everything in opposite i.e. 1 means 0 and 0 mean 1?
Documentation includes active value column. For example, "Low battery alarm" active value is 0.
Hi, hex =
24420996067215543031081733259600060703338602000000fffffbfdff00120d0000000002da010000000003333836332c572c3030302e30302c3030302c3331303831372c46464646464246442c3733302c30312c302c302c3623
hex is data packet for LKGPS protocol, this data packet container date,time,odometer, speed, angle, lat, lng,N/S, E/W, imei,battery level, GSM Signal, country code, iccid, baseStation, cellID
the hex is the real GPS LOCATION from LKGPS Protocol, the other only is the heartbeat package
the problem is decode the hex string , when is decode return:
$...3863,W,000.00,000,310817,FFFFFBFD,730,01,0,0,6#
what is the solution for get all data ?
thanks
The problem is that you are trying to decode binary data into text. It's never going to work.
so what is the correct way?
Correct way is to decode it as binary data. I'm sure node is capable of handling binary data.
I have implemented this whole thing in NodeJs. Let me know if anyone needs this protocol decoder ;)
Thanks Malkit, i need, where can i see it? or send to my mail [removed], regards
Hi All ,
I am trying to writing the LKGPS protocol decoder in NodeJs.
BufferIN String (input Data):
2a48512c343231303136393738372c56312c3131303235322c412c333034322e353131392c4e2c30373634312e373036332c452c3030302e31302c3030302c3235303331372c464646464642464623
buffer Length : 79
After Decoding input buffer data then i am getting below data
hexdecodedata : *HQ,4210169787,V1,110252,A,3042.5119,N,07641.7063,E,000.10,000,250317,FFFFFBFF#
BitData : 0 - *HQ
BitData : 1 - 4210169787
BitData : 2 - V1
BitData : 3 - 110252
BitData : 4 - A
BitData : 5 - 3042.5119
BitData : 6 - N
BitData : 7 - 07641.7063
BitData : 8 - E
BitData : 9 - 000.10
BitData : 10 - 000
BitData : 11 - 250317
BitData : 12 - FFFFFBFF#
How to parse the or Decode these hexdecodedata and get all information. Please help !
Please Malkit Singh share the code
Hi All,
I am trying to implement the protocol in NodeJs (I guess its LKGPS protocol).
Here is the link to protocol document
https://drive.google.com/file/d/0Bw13bQgIGLTaSkEzTFJlZjNaWVk/view
As per the document, the device sends 2 types of data
Here are few samples of data I am receiving at the server. I made one vanilla server which is listening at some port and console logs the received data.
I am getting data like in buffers like this
When I am hex decoding this buffer I am getting this string
Which decodes to
using https://www.traccar.org/hex-decoder/
This information is perfect. As per the documentation of this protocol, this is heartbeat data because it starts with *HQ and ends with #.
Can you please guide me how to understand last part of this string i.e. FFFFFBFF#
From the documentation I know it's a vehicle status but I don't know how to decode it.
Also. I am getting different types of heart beat messages like these
The first message type is ok but what about second and third messages? Is there anything wrong with my decoding code or these message mean something else?
Coming to the second type of data i.e. GPS data which device sends (as per the documentation this data start with 24).
Here is one sample of this data which I am getting at the server end.
But whenever I try to decode these message using https://www.traccar.org/hex-decoder/
I am getting weird results like
It doesn't decode correctly. What could be the reason for this?
Thanks