LKGPS protocol
1.The structure of commands send by terminal:
Normal information(v1):
*XX,YYYYYYYYYY,V1,HHMMSS,S,latitude,D,longitude,G,speed,direction,DDMMYY,vehicle_stat
us#
Confirmation of information(V4):
*XX,YYYYYYYYYY,V4,CMD,hhmmss,HHMMSS,S,latitude,D,longitude,G,speed,direction,DDMM
YY,vehicle_status#
In which:
* : Head of command
XX : Name of maker, Consists of two ASCII characters, such as HQ.
, : separator
YYYYYYYYYY : SN of terminal, is ten characters front of IMEI.
CMD : Command
HHMMSS : Time: hour/minute/second,device time, GMT, Beijing is 8 hours ahead
GMT.
S : Effective mark of data, ‘A’ stand for effective, ‘V’ stand for invalid.
Latitude : Latitude, format : DDFF.FFFF, DD : Degree(00 ~ 90), FF.FFFF : minute
(00.0000 ~ 59.9999), keep four decimal places.
D : latitude marks (N:north, S:south)
Longitude : longitude, format : DDDFF.FFFF, DDD : Degree (000 ~ 180 ), FF.FFFF :
minute
(00.0000 ~ 59.9999), keep four decimal places.
G : longitude marks (E:east, W:west)
Speed: speed,range of 000.00 ~ 999.99 knots, Keep two decimal places.
Speed maybe empty, as longitude,G,,direction, speed is 0.
Direction: Azimuth, north to 0 degrees, resolution 1 degrees, clockwise direction.
Direction maybe empty, as longitude,G,speed,, MMDDYY, azimuth is zero.
DDMMYY:day/month/year
vehicle_status(V1): Vehicle state, four bytes, says the terminal parts state, vehicle
parts state and alarm state, etc. Use ASCII character and hexadecimal values. Below
are the meaning of each byte, use negative logic, bit=0 is effective. The table below:
Wire vehicle tracker
Automotive
State vehicle
Retention machine Alarm status
Rank parts
components status
First Byte Second Byte Third Byte Fourth Byte
0 0 0 0 0
1 0 0 Vibration Alarm 0 Armed 0 SOS
Speed
2 0 0 0 ACC off 0
alarm
3 0 0 0 0
4 0 Power cut alarm 0 Power cut 1 0
5 0 0 0 0
6 0 0 0 0
7 0 0 0 0
Wireless vehicle tracker
Automotive
State vehicle
Retention machine Alarm status
Rank parts
components status
First Byte Second Byte Third Byte Fourth Byte
0 0 0 0 0
1 0 0 Shock alarm 0 0 Drop alarm
Speed
2 0 0 0 0
alarm
3 0 0 0 0
4 0 0 1 0
5 0 0 0 0
6 0 0 0 0
7 0 0 Low battery alarm 0 0
Pet&personal tracker
Automotive
State vehicle
Retention machine Alarm status
Rank parts
components status
First Byte Second Byte Third Byte Fourth Byte
0 0 0 0 0
1 0 0 0 0 SOS
2 0 0 0 0
3 0 0 0 0
4 0 0 1 0
5 0 0 0 0
6 0 0 0 0
7 0 0 Low battery alarm 0 0
2.Commands send by center
1)Clear alarm R7
*XX,YYYYYYYYYY,R7,HHMMSS #
For example: *TH, 000000,R7,130305#
Terminal received the command will clear all the alarm information, but does not
send back information, monitoring system can be appended to send a single
monitoring command to confirm whether have clear alarm or not.
3.GPRS agreement
Standard mode(Binary V1 normal information) encoding format:
0
No. 00 02 03 04 05 06 07 08 09 0A 0B
1
Content $ 0x1030731001 0x050316 0x220902
Recording
Meaning Terminal Serial Number Time Date
Head
0
No. 0D 0E 0F 10 11 12 13 14 15 16 17 18
C
Content 0x22128745 0x00 0x113466574C 0x014028
Meaning Latitude Reserve Longitude,N,E,AV Speed, direction
No. 19 1A 1B 1C 1D 1E 1F
Content 0Xfffffbff 0xff 0x00
Operators
Meaning vehicle_status User_alarm_flag Reserve
Number
In which, “$”(0x24): Recording Head, for the start point of center identity record;
Time: 0x050316, GMT+0 5 o’clock 3 minutes 16 seconds, same as Beijing time(GMT+8) 13
o’clock 3 minutes 16 seconds;
Date: 0x220902, 22th September,2002;
Latitude value: 0x22128745,22°12.8745;
Longitude value: 0x113466574C,113°46.6574,meaning of last bit(No.0x15):
bit7654,last place of longitude;
bit3,1:east longitude,0:west longitude;
bit2,1:north latitude,0:south latitude;
bit1,1:A,0:V
bit0, not defined
Speed, direction:0x014028:speed 014 knot,direction 028;
vehicle_status、 User_alarm_flag:Vehicle status in binary system, and user defined alarm
status,same meaning as SMS(in ASCII).
Operators number:Recording numbers in binary system, add 1 every time send back
record data.
Notice:No temperature data in stand mode record(same as V1 normal information).
stand mode encoding format:
0
No. 00 02 03 04 05 10 15
1
Stand mode
$ 0x1030731001 0x00 4C
content
Stand mode Recording
Terminal Serial Number Reserve N、E、AV
meaning Head
Encoding format:
No. 00 01 02 03 04 05 06 07 08 09 0A 0B
Conte
$ 0x1030731001 0x050316 0x220902
nt
Recordi
Meani
ng Terminal Serial Number Time Date
ng
Head
No. 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18
Conte
0x22128745 0x00 0x113466574C 0x014028
nt
Meani Battery
Latitude value Longitude value、N、E、AV Speed, Direction
ng level
No. 19~1C 1D-1E 1F 20 21~24 25 26 27
Conte 0Xfffffbf 0x000
0xff 0x01CC 0x01
nt f 01234
GPS
Milea
GSM
Meani vehicle_ User_alarm_f GPS ge Country Operators
Signal(1
ng status lag Signal Unit: Code Number
~31)
Kilom
eter
No. 28 29 2A 2B 2C
Content 0x8763 0x5B9C 0x00
Station Operator
Meaning Cell ID
number Number
Base station information
Country code, 460 = 0x01CC
Operator number, 01 = 0x01
Station number, 34569 = 0x8763
Cell ID, 23452 = 0x5B9C
Hexadecimal data flow: 01 CC 01 87 63 5B 9C
Multi cell base station protocol
*XX,YYYYYYYYYY,NBR,HHMMSS,MCC,MNC,TA,NUM,LAC,CID,RXLEV ,LAC,CID,RXLEV….,DDMMYY,
vehicle_status#
XX:Manufacturer
YYYYYYYYYY:ID
HHMMSS time
MCC Country Code MCC(3 bits)
MNC Network code MNC(3 bits)
NUM Numbers of Base Station, maximum is 6.
TA GSM time delay
LAC Location Area Code LAC(5 bits)
CID Cell Tower CID(5 bits)
RXLEV Signal Strength
DDMMYY Date
vehicle_status (refer to “Common Data Definition”)
E.g.
*HQ,7893267560,NBR,081606,460,0,1,4,9338,3692,150,9338,3691,145,9338,3690,140,
9338,3692,139,220513,FFFFFBFF#
Multi cell base station protocol,add Last field of ASCII power level information:
*HQ,7893267560,NBR,081606,460,0,1,4,9338,3692,150,9338,3691,145,9338,3690,140,
9338,3692,139,220513,FFFFFBFF,cell#
Cell value 1-6 (1-10%,2-20%,3-40%,4-60%,5-80%,6-100%)
Time calibration protocol in center for long standby time terminals:
Server receive V1 and NBR command, then reply with V4, time calibration
as GMT+0 time.
//*HQ,8856000065,V4,NBR,20150525102030#
//*HQ,0600097800,V4,V1,20150525102030#
20150525102030 It is GMT+0 2015-05-25 10 o’clock 20 minutes 30
seconds GMT+8 18 o’clock 20 minutes 30 seconds
Working time SMS setting(for LK330,LK330B,LK660)
DWaaa,bb,hhmm
aaa=999 means always work
bb,wake up interval,01~240,unit is hour,
hhmm,wake up time,bb should below 24
DW0005,12,0830
Wake up every 12 hours,wake up time8:30
Sever send command:
*HQ,000,S71,085902,31,aaa,bb,hhmm#
Same to sms command
Sever reply:
*HQ,0000000000,V4,S71,085902,31#
WIFI location:
*XX,YYYYYYYYYY,V5,HHMMSS,S,latitude,D,longitude,G,speed,direction,Wif
iNum,w1MacAddr,w1RxLev,w2MacAddr,w2RxLev,w3MacAddr,w3RxLev,..., MCC,
MNC,TA,NUM,LAC1,CID1,RXLEV1 ,LAC2,CID2,RXLEV2….,DDMMYY,vehicle_stat
us#
GPS data,same to V1
S,latitude,D,longitude,G,speed,direction
LBS(max 5),same to NBR
MCC,MNC,TA,NUM,LAC1,CID1,RXLEV1 ,LAC2,CID2,RXLEV2…
Wifi data(max 5),
WifiNum,w1MacAddr,w1RxLev,w2MacAddr,w2RxLev,w3MacAddr,w3RxLev,...
WifiNum,
w1MacAddr, the first WIFI mac address, 1c:fa:38:a1:c4:a0
w1RxLev,the first WIFI signal strength,-58
Upload SIM card iccid number:
*HQ,6600000105,V19,031749,V,2236.5079,N,11351.4801,E,000.00,000,170516,,,898602
B11115C0169789,FFFFFBFF#
Same to V1:
898602B11115C0169789 is the SIM card iccid number
Note: the device upload two type data to sever,one is heartbeat package which start
with *HQ end with #,another is GPS data which start with 24,the GPS data length fix.
Heartbeat package:
*HQ,4209809058,V1,064709,v,2233.9355,N,11351.7442,E,000.00,000,231215,FFFFFBFF,
460,00,0,0,6#
Sever reply:
*HQ,4209809058,V4,V1,20151223064711#
GPS data:
2442098090580647042312152233935006113517440E000000FFFFFBFFFF0015030000000001CC0
00000000004
LBS data:
*HQ,4106020669,NBR,081625,460,0,0,7,9360,3653,40,9360,4143,34,9346,3842,32,9360,
3651,30,9360,3643,24,9346,3843,23,9360,4142,23,281215,FFFFFBFF,5#
Sever reply:
*HQ,4106020669,V4,NBR,20151228081626#
WIFI data:
*HQ,4208134453,V5,112447,V,2234.0508,N,11351.8152,E,000.00,000,5,C4:B8:B5:E0:4E:
52,-59,80:89:17:73:F8:76,-86,8C:F2:28:7E:8B:5C,-80,88:25:93:A9:53:9A,-76,C4:04:
7B:4D:3C:24,-82,460,0,0,7,9346,3842,42,9360,3651,43,9360,3653,40,9360,4143,28,9
346,3843,27,9360,3652,26,9360,4831,24,010616,FFFFFBFF,6#