Sie sind auf Seite 1von 6

GPRS Transport Protocol

1. Communication between trackers and server


1) The communication flowchart:
V1 information with an effective positioning data

Control commands

Server

Terminal

V4 information correspond to control commands

Upload V1 information based on the time interval set


by D1 commands

2) Communication Protocol and Data Encoding method


1. The communication between the tracker and the server uses the TCP protocol.
2. The data transmission between the tracker and the server is encoded by the ASCII chars,
and can not use lowercase and spaces.
3Tracker login and logout
The trackers connect to server by TCP protocol, and then the trackers send V1 information
with effective position data to server after connection successed. Server accepts the tracker login
according to the serial number in V1 information.The tracker exit when the TCP network link
disconnected.
After the tracker login, the tracker sends V1 informations to server according to the time
interval set by the D1 command. Server sends control commands to tracker while TCP connected,
when receiving the control commands, tracker will reply to the Server by V4 information. The
Server can display the status of the Tracker in real time according to V1 and V4 information.
2. The structure of commands sent by the Server:
*XX,YYYYYYYYYY,CMD,HHMMSS,PARA1,PARA2,#
Explain:
*: Head of command
XX: Name of maker, consisted of two ASCII characters, for example: HQ.
The tracker will check the name of maker is right or not, if not, it will not accept as the servers
command.
,: Separator
YYYYYYYYYY: SN of the tracker, it is 10 characters in IMEI from 5 to 14 character.
CMD: Command
HHMMSS: Time: hour/minute/second
PARA: Parameters
#: End mark
3.The structure of commands send by tracker:
1) General information is also the login information if it contains the right position
information. (V1)
1

*XX,YYYYYYYYYY,V1,HHMMSS,S,latitude,D,longitude,G,speed,direction,DDMMYY,tracker_stat
us#
Confirmation information:
*XX,YYYYYYYYYY,V4,CMD,hhmmss,HHMMSS,S,latitude,D,longitude,G,speed,direction,DDMM
YY,tracker_status#
Explain:
*: Head of command
XX: Name of maker
,: Separator
YYYYYYYYYY: SN of the tracker
CMD : Confirmed command
hhmmss: Time value in confirmed command.
HHMMSS : Time
S : Effective mark of data, A means effective, V means invalid.
Latitude : Latitude, format : DDFF.FFFF, DD : Degree00 ~ 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 : Degree000 ~ 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 km/h, Keep two decimal places.
Speed maybe empty, as longitude,G,,direction, means speed is 0.
Direction: Direction angle, north is 0 degrees, resolution 1 degrees, clockwise direction.
Direction maybe empty, as longitude,G,speed,, MMDDYY, azimuth is zero.
DDMMYY: day/month/years
tracker status: Tracker status, 4 bytes, means the trackers status and alarm status, etc.
Hexadecimal values in ASCII characters. Below are the meaning of each byte, use negative logic,
bit=0 is effective.
Bit The first byte
The second
The third byte
The fourth byte
byte
0
0 Reserve 0 Reserved 0
Reserved
1
Theft alarm
d
1
0 Reserve 1
Low
0
Reserved
1
SOS alarm
d
battery
2
0 Reserve 0 Reserved 0
Reserved
1
over speed alarm
d
3
0 Reserve 0 Reserved 0
Reserved
0
Reserved
d
4
0 Reserve 0 Reserved 0
Reserved
1
Enter fence area alarm
d
5
0 Reserve 0 Reserved 0
Reserved
0
Reserved
d
6
0 Reserve 0 Reserved 0
Reserved
0
Reserved
d
7
0 Reserve 0 Reserved 0
Reserved
1
Out of fence area alarm
d
2) upload GSM base station data (BASE)
*XX,YYYYYYYYYY,BASE,HHMMSS,MCC,MNC,LAC,CID,DDMMYY,vehicle_status#
XXName of maker
YYYYYYYYYYID
HHMMSS :time
MCC: country code MCC(3 digital)
MNC: network code MNC(3 digital)
LAC: location area code LAC(5 )
CID: code of base station id CID(5 )
2

DDMMYYday/month/year
tracker status: Tracker status, 4 bytes, means the trackers status and alarm status, etc. Same as
V1 .
*HQ,7893267560,BASE,081606,460,0,9338,3692,220513,FFFFFBFF#
3) tracker request Chinese address instruction
(VI1)
*XX,YYYYYYYYYY,VI1,HHMMSS,S,latitude,D,longitude,G,speed,direction,DDMMYY,vehicle_stat
us#
*: Head of command
XX: Name of maker
,: Separator
YYYYYYYYYY: SN of the tracker
CMD : Confirmed command
hhmmss: Time value in confirmed command.
HHMMSS : Time
S : Effective mark of data, A means effective, V means invalid.
Latitude : Latitude, format : DDFF.FFFF, DD : Degree00 ~ 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 : Degree000 ~ 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 km/h, Keep two decimal places.
Speed maybe empty, as longitude,G,,direction, means speed is 0.
Direction: Direction angle, north is 0 degrees, resolution 1 degrees, clockwise direction.
Direction maybe empty, as longitude,G,speed,, MMDDYY, azimuth is zero.
DDMMYY: day/month/years
tracker status: Tracker status, 4 bytes, means the trackers status and alarm status, etc. Same as
V1
*HQ,7893267561,VI1,071047,V,2230.7021,N,11355.1445,E,0.00,000,271112,FFFFFBFF#
Server reply information I1
*XX,YYYYYYYYYY,I1,HHMMSS,Display_Time,Code,Info_lenHQ,Information
Display_Timetime, value range from 5 to 65535 secondsDisplay_Time=0 means 65536
seconds
CodeEncoding0GB23121unicode.
Info_lenHQInfo length0-2550=256
InformationDisplay information , the length does not exceed 256 bytes ( 128 chinese words ) ,
are ASCII character encoding before Information .
Which only supports unicode encoding ,length and time information can be wrong.
*HQ,7893267561,I1,130305,10,1,26,5e7f4e1c77016df157335e02002c767b826f8def002c8d358d
b3504765e5
897f5357003400377c73002c4e2d56fd79fb52a84e1c6ee88def670d52a15385897f531700370039
7c73,22.51170
16666667,N,113.919075,E,150626#
,, 47 , 79
4Tracker request address with other language instruction (V8)
*XX,YYYYYYYYYY,V8,LAG,HHMMSS,S,latitude,D,longitude,G,speed,direction,DDMMYY,vehic
le_status#
*HQ,3533518241,V8,en,094949,A,2234.3017,N,11351.6856,E,000.0,351,200713,FFFFFFFF#
reply: *XX,YYYYYYYYYY,I2,LAG,HHMMSS,Display_Time,Code,Info_lenHQ,Information#
Information: same as VI1.
*HQ,3533518241,I2,en,174953,10,1,26,China ,Guangdong,shenzhen,hongli road .#
5)Tracker request address with cell id code (VI2)
3

*XX,YYYYYYYYYY,VI2,MCC,MNC,LAC,CID,LAC2,CID2,2,00,cn#
MCC,MNC,LAC,CID,LAC2,CID2,
2: means have 2 cell id
10frist digital as 0,means relpy address, the 2nd digital as 0, means reply http :// map link
cn:languagecn is Chinese , en is English, fr is French.
Reply:reply: *XX,YYYYYYYYYY,I3,LAG,HHMMSS,Display_Time,Code,Info_lenHQ,Information#
Information: same as VI1.

4. Commands send by server


1) Positioning monitoring command
(D1)
*XX,YYYYYYYYYY,D1,HHMMSS,interval,batch#
Explain:
Interval: The interval time of upload data to server, value range:1 ~ 65535 second.
Batch: The number of transferred batch, range from 1 to16, outside the range as 1.
When batch=1 as the real-time mode, when produce a record upload it, only support batch=1.
For example:
Server sends:
*HQ,7893267561,D1,130305,5,1#
Tracker reply V1 information when received the command.
*HQ,7893267561,V1,050316,A,2212.8745,N,11346.6574,E,14.28,028,220902,FFFFFFFF#
2) Set the monitor mobile number command for SMS
(S2)
*XX,YYYYYYYYYY,S2,HHMMSS, mc_address#
Explain:
mc_address: Monitor mobile number.
For example:
Server sends:
*HQ,7893267561,S2,130305,13823714888# ;
Reply :
*HQ,7893267561,V4,S2,130305,050315,A,2212.8745,N,11346.6574,E,14.28,028,220902,FFFF
FFFF#
After received the command, the tracker will transmit confirmation information to the new
monitoring server immediately, the original monitor mobile number will not be recognized.
3) Set GPRS servers IP address, port number command
(S23)
*XX,YYYYYYYYYY,S23,HHMMSS,IP_addr,Port, Reconnect _Times #
IP_addr: GPRS servers IP address
Port: GPRS servers port number
Reconnect_Times: Reconnect times to GPRS server when connected fail. Value range form 5 to
254, if the value is less than 5, the value will be set to 5 automatically, if it exceeded 255, the value
will be equal to mod 256.
For example:*HQ,7893267561,S23,130305,165,165,33,250,8800,5#
Tracker reply:
*HQ,7893267561,V4,S23,165.165.33.250:8800,130305,050316,A,2212.8745,N,11346.6574,E,1
4.28,028,220902,FFFFFFFF#
Note: the IP address separator must be a comma, cannot use the dot, IP address and port
number must separated by comma. If the IP address is 0.0.0.0, it means disables the IP settings.
4) Restore factory settings command
(S25)
*XX,YYYYYYYYYY,S25,HHMMSS#
For example:
Server sends:
*HQ,7893267561,S25,130305#
Tracker returns:
*HQ,7893267561,V4,S25,130305,050316,A,2212.8745,N,11346.6574,E,14.28,028,220902,FFF
4

FFFFF#
5) Restart command
(R1)
*XX,YYYYYYYYYY,R1,HHMMSS #
For example:
*HQ,7893267561,R1,130305#
Tracker received the order will be restart.
6) Get trackers battery life,GSM and GPS Work status CK
*XX,YYYYYYYYYY,CK,HHMMSS#
tracker
reply
*HQ,2020916012,V4,CK,gsm,gps,bat,
130305,050315,A,2212.8745,N,11346.6574,E,14.28,028,220902,FFFFFBFF#
gsm 0-31
gps Number of GPS satellite
bat battery life Grade 1-6, 1 is low, 6 is highest

7) Set SOS contact number (S8)


Up to 3 sos number
*XX,YYYYYYYYYY,S8,HHMMSS,mc_address1,mc_address2,mc_address3#
For example:
*HQ,0000000000,S8,130305,13823714888,,#
Tracker reply
*HQ,2020916012,V4,S8,13823714888,,,130305,050315,A,2212.8745,N,11346.6574,E,14.28,02
8,220902,FFFFFBFF#
8) Set the work time before enter sleep (SLEEP)
*XX,YYYYYYYYYY,SLEEP, flag1,HHMMSS #
Explain:
flag1: The time into sleep, value range from 10 to 65535 minutes, if flag1<10 will automatically set
to 10.
For example:
Server sends:
*HQ,7893267561,SLEEP,65535,130305#
Tracker returns:
*HQ,7893267561,V4,SLEEP,130305,050316,A,2212.8745,N,11346.6574,E,14.28,028,220902,F
FFFFFFF#
9) Clear alarm command
(R7)
*XX,7893267561,R7,HHMMSS #
For example:
Server sends:
*HQ, 000000,R7,130305#
After received the command, tracker will clear all the alarm information, but does not send back
information, monitor server can send a monitoring command to confirm whether the alarm have
been cleared.
10) Forwarding Electronic fence alarm SMS
(SFW)
*XX,YYYYYYYYYY, SFW,HHMMSS,info#
info: alarm text, with Unicode
For example:
Server sends:
*HQ,7893267561,SFW,181014,8F668F860031FF0C8FDB516556F4680F201C56F4680F003120
1D62A58B6630#
Tracker reply
*HQ,8800000015,V4,SFW,181014,021119,A,2234.3025,N,11351.6843,E,000.3,000,251113,FFF
5

FFBFF#

11Remote upgrade
* XX,YYYYYYYYYY,,UP,URL, HHMMSS #
URL:download link
For example:
Server sends:
*HQ,0000000000,UP,http://www.gps123.org/g19_updata/g19_test/jt_ads.bin, 050305#
Tracker reply
*HQ,2020916012,V4,UP,http://www.gps123.org/g19_updata/g19_test/jt_ads.bin,130305,050315,
A,2212.8745,N,11346.6574,E,14.28,028,220902,FFFFFBFF#
12). Upload Multi Base Station Data.(NBR)
Format:
*XX,YYYYYYYYYY,NBR,HHMMSS,MCC,MNC,TA,NUM,LAC,CID,RXLEV ,LAC,CID,RXLEV.,
DDMMYY,vehicle_status#
XX: Name of maker
YYYYYYYYYY: ID
HHMMSS: time
MCC: Country code MCC(3 digital)
MNC: Network code MNC(3 digital)
NUM: The number of base station, max 6pcs.
TA: GSM time delay
LAC: Location area code LAC(5 digital)
CID: Code of base station id CID(5 digital)
RXLEV: Signal strength
DDMMYY: day/month/year
vehicle_status: like sos etc.
For example:
*HQ,7893267560,NBR,081606,460,0,1,4,9338,3692,150,9338,3691,145,9338,3690,140, 9338,3
692,139,220513,FFFFFBFF#

Das könnte Ihnen auch gefallen