Gprs Protocol
Gprs Protocol
*XX,YYYYYYYYYY,CMD,HHMMSS,PARA1,PARA2,…#
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
PARA : Parameters
General information is also the login information if it contains the right position information.
*XX,YYYYYYYYYY,V1,HHMMSS,S,latitude,D,longitude,G,speed,direction,DDMMYY,
vehicle_status#
The reply to center commands.
*XX,YYYYYYYYYY,V4,CMD,hhmmss,HHMMSS,S,latitude,D,longitude,G,speed,directi
on,DDMMYY,vehicle_status#
In which:
* : Head of command
XX : Name of maker
, : Separator
YYYYYYYYYY : SN of terminal
CMD : Confirmed command
Hhmmss : Time value in confirmed command.
HHMMSS : Time
S : Effective mark of data, ‘A’ stand of effective, ‘V’ stand of 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)
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: 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
ofeach byte, use negative logic, bit=0 is effective. The table below:
Example:
*HQ,4103000861,V1,092853,A,2234.2029,N,11351.4197,E,000.40,000,270215,FFFFFBFF,460,00,0,0,6#
Range 1-6,6 stand for battery full
*XX,YYYYYYYYYY,D1,HHMMSS,interval,batch#
In which:
Interval: The interval produce upload records, value range of 1 ~ 65535, unit is the second.
Batch: The recording number of transferred batch , ranging from 1 to16, outside the range as1.
batch = 1 as the real-time mode, when produce a record upload it, other value upload multiple
records at the same time.
Reply V1 information when received the command.
*HQ,2020916012,V4,S28,13823714888,130305,050315,A,2212.8745,N,11346.6574,E,14.28
,028,220902,FFFFFBFF#
Terminal accepts the number issued commands, but the results will only return to the main
center.
Slave monitoring center SMS number can also be used to upgrade main center number.
4) Monitor command R8
*XX,YYYYYYYYYY,R8,HHMMSS,listen_address #
In which:
listen_address: Monitor number terminal calling.
In the monitoring is prohibited terminal return information:
*HQ,2020916012,V4,R8,ERROR,130305,050316,A,2212.8745,N,11346.6574,E,14.28,028,
220902,FFFFFBFF#
Otherwise the terminal receives the command, automatic dial listen_address, center can be
mounted a automatic recording device for recording monitoring content.
5) Set monitoring center GPRS server IP address, port number, network congestion
alarm S23
IP_addr: GPRS server IP address
Port: GPRS server port number
Redial_Times: Redial times to GPRS server. value range of 5-254, if the value is less than 5,
the
value is automatically set to 5, if exceeded 255 the value mod 256.
For example:*HQ,0000000000,S23,130305,165,165,33,250,8800,5# ;
Terminal return:
*HQ,2020916012,V4,S23,165.165.33.250:8800,130305,050316,A,2212.8745,N,11346.6574
,E,14.28,028,220902,FFFFFBFF#
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 for all 0, disables the IP settings.
7) Clear alarm R7
For example:
Center sends:
Terminal received the order 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.
For example:*HQ,0000000000,S17,130305,165,165,33,250,8800,5# ;
Restore the cutting of oil set the the time1 on S20 command as the “0” , It will reply :
*TH,2020916012,V4,S20,OK,130305,050316,A,2212.8745,N,11346.6574,E,14.28,028,220902,F
FFFFBFF#
Standard mode upload data to increase the base station location information:
Encoding format:
0
No. 00 02 03 04 05 06 07 08 09 0A 0B
1
Content $ 0x1030731001 0x050316 0x220902
Recording Automotive Machine Serial
Meaning Time Date
Head Number
1
No. 0C 0D 0E 0F 10 11 12 13 14 15 17 18
6
Content 0x22128745 0x00 0x113466574C 0x014028
battery Speed,
Meaning Latitude Longitude values、N、E、AV
voltage direction
No. 27 28 29 2A 2B
Content 0x8763 0x5B9C 0x00
Record
Meaning Station No. Cell ID
number
Remark:“$”(0x24):Head :For center recognition record starting position;
Time:0x050316,GMT 5 o'clock 3 minute 16 second,equal to GMT+8 Beijing Time 13 o'clock
3minute 16 second;
Date:0x220902,September 22th 2002;
Latitude value:0x22128745,22 Degree 12.8745
Longitude value:0x113466574C,113 Degree 46.6574,last byte after longitude
value(Number 0x15)need exchange from hexadecimal to binary which means the logic
value of the coordinate:
bit3,1:East,0:West(Longitude)
bit2,1:North,0:South(Latitude)
bit1,1:A,0:V
bit0,undefined
speed、direction:0x014028:speed 014 knot(unit:nm),direction 028(Straight
North, 360 degrees clockwise)
vehicle_status、 Usr_alarm_flag:Vehicle status and user-defined alarm status in binary. The
meaning is the same as that of SMS(ASCII representation).
Record number: The number of the record represented in binary. Each record
sent is automatically added 1.
*XX,YYYYYYYYYY,V1,HHMMSS,S,latitude,D,longitude,G,speed,direction,DDMMYY,vehicle_st
atus#
Including: * Command head
XX manufacturer names, such as: TH, DC, XY and so on.
Delimiter
YYYYYYYYYY automotive machine serial number.
CMD command center confirmed.
hhmmss time value is recognized in the command
HHMMSS automotive machine time, standard time, an 8-hour time difference with Beijing.
S: the data valid bit (A / V), A indicates that the GPS positioning data is valid data, V data
indicates that the GPS positioning data is not valid.
latitude: degrees latitude (00 ~ 90), FF.FFFF:: Latitude, format DDFF.FFFF, DD latitude
(00.0000 - 59.9999), retained four decimal places.
D: Latitude flag (N: latitude, S: latitude).
longitude: longitude format DDDFF.FFFF, DDD: degrees longitude (000 ~ 180), FF.FFFF:
Longitude (00.0000 - 59.9999), retained four decimal places.
G: longitude mark (E: E, W: W).
speed: speed, range of 000.00 - 999.99, to two decimal places.
The information field may be empty ie longitude, G,, direction,, indicates the speed is zero.
direction: azimuth, true north as 0 degrees, 1 degree resolution, clockwise.
The information field may be empty, such as longitude, G, speed,, MMDDYY,, represents the angle
is 0.
DDMMYY: Day / Month / Year
vehicle_status: vehicle condition, a total of four bytes, which means that the state of automotive
machine parts, vehicle parts status and alarm status. Hexadecimal values represent ASCII
characters, the following is the specific meaning of each bit of each byte of the variable, bit
representation using negative logic that bit = 0 is valid. As follows:
Automotive
State vehicle
Retention machine Alarm status
Rank parts
components status
First Byte Second Byte Third Byte Fourth Byte
Door open
0 0 Temple 0 0 Door open 0
alarm
1 0 Move alarm 0 Keep 0 0 Panic
Speed
2 0 Panic button 0 Keep 0 ACC off 0
alarm
3 1 Keep 0 0 0
4 0 1 Keep 0 1 Keep
5 1 Keep 1 Keep 0 1 Keep
6 1 Retention 1 Keep 1 1 Keep
7 1 Need not 1 Need not 1 Need not 1 Need not
Remark: The device mainly upload two types of data to the platform, heartbeat
packet and GPS packet. The heartbeat packet begins with * HQ end with #, and the
GPS packet begins with 24($) and is fixed at 47 bytes in length.