0% found this document useful (0 votes)
104 views8 pages

Gprs Protocol

1. The TQ GPRS transport protocol defines the structure for commands sent between monitoring centers and terminals. Commands sent by centers include the header, sender ID, command name, time, and parameters. Replies from terminals mirror this structure. 2. The protocol supports various command types from centers including positioning monitoring, setting monitoring center numbers, querying mileage, restoring factory settings, and cutting off fuel/electricity. Terminals reply with confirmation messages including location, speed, and other data. 3. Additional location data may be included in standard uploads, including the mobile network MCC, MNC, LAC, and cell ID to help determine location. English and Chinese address lookup commands are also defined to return addresses based

Uploaded by

Aurélio Faria
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
104 views8 pages

Gprs Protocol

1. The TQ GPRS transport protocol defines the structure for commands sent between monitoring centers and terminals. Commands sent by centers include the header, sender ID, command name, time, and parameters. Replies from terminals mirror this structure. 2. The protocol supports various command types from centers including positioning monitoring, setting monitoring center numbers, querying mileage, restoring factory settings, and cutting off fuel/electricity. Terminals reply with confirmation messages including location, speed, and other data. 3. Additional location data may be included in standard uploads, including the mobile network MCC, MNC, LAC, and cell ID to help determine location. English and Chinese address lookup commands are also defined to return addresses based

Uploaded by

Aurélio Faria
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

TQ GPRS transport protocol

Letters in command can't be lowercase and Spaces.

1.The structure of commands send by center:

*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

2.The structure of commands send by terminal:

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

3.commands send by center

1) Positioning monitoring command D1

*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.

2) Set the monitoring center SMS number S2


In which:
mc_address: Monitoring center SMS number.
Send:
*HQ,0000000000,S2,130305,13823714888# ;
Reply :
*HQ,2020916012,V4,S2,130305,050315,A,2212.8745,N,11346.6574,E,14.28,028,220902,
FFFFFBFF#
Terminal after receiving the instruction will immediately transmits confirmation information
to the
new monitoring center, the original monitoring center number no longer recognized. The
monitoring center can not add 86 before the number.

3)Set the slave monitoring center SMS number S28


Return the following information to master monitoring:

*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.

6) Set access point APN S24


M: Effective mode
M=0: Virtual query
M=1 or other: setting the access point APN.
For example:
Center sends:
*HQ,0000000000,S24,130305,0,ABCD.BJ#
Terminal returns:
*HQ,2020916012,V4,S24,CMNET,130305,050316,A,2212.8745,N,11346.6574,E,14.28,028,
2209
For example:
Center sends:
*HQ,0000000000,S24,130305,2,HQit.gd#
Terminal returns:
*HQ,2020916012,V4,S24,HQit.gd,130305,050316,A,2212.8745,N,11346.6574,E,14.28,028,
Received the order in the GPRS online state will hang up the connection and redial according
to
the new APN. Note: APN cannot be longer than 32 characters, characters can be " # ".

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.

8) Mileage query command S32


*XX,YYYYYYYYYY,S32,HHMMSS,M#
The command queries the mileage data.
M=0 : Mileage counter reset
M=1 or other: mileage enquiry
For example:
Center sends:
*HQ,000,S32,130305,1#
Terminal returns:
*HQ,2020916012,V4,S32,0000130502.35,130305,050316,A,2212.8745,N,11346.6574,E,14.
28,02
8,220902,FFFFFBFF#
Upload mileage unit is knots. The maximum value is 9999999999.99.

9) Restore factory settings S25


Center sends:
*HQ,0000000000,S25,130305#
Terminal returns:
*HQ,2020916012,V4,S25,130305,050316,A,2212.8745,N,11346.6574,E,14.28,028,2
20902,FFFFFBFF#

10)Remote fortification command S6


*XX,YYYYYYYYYY,S6,HHMMSS,flag1,flag2#
fag1: Fortification and disarming flag 1, ‘0’ express fortification ‘1’ express disarming.
fag2: Fortification and disarming flag 2, ‘0’ express fortification ‘1’ express disarming.
*HQ,7893267561,S6,181014,0,0# Fortification
*HQ,7893267561,S6,181114,1,1# disarming
11) set the transmission interval S17

For example:*HQ,0000000000,S17,130305,165,165,33,250,8800,5# ;

12. start cut off fuel and electric S20

* XX, YYYYYYYYYY, S20, HHMMSS, C, time1, time2,...Time30 #


C: the ultimate power
C = 0: dynamic cut off fuel and electric.detect the engine instantaneous operation, cut off the
circuit 5 seconds when the engine is running , forcing the engine stopped.
C = 1 or other digital: static cut off fuel and electric. Engine is not detected, the power relay a
lways suck close that Circuit is disconnected.
Dynamic cut off electric does not consume battery power, the engine must be connected to th
e signal (charge indicator) .
If you don’t want to connect the signal of engine can use the way of static cut off fuel and ele
ctric.
When the early warning alert, ban to start engine function way is only use dynamic cut off fu
el and electric, so if you want to support a fortification function (handle or fortify the remote
control)
must be connected to the engine signals.
Time: the duration of the action, scope 1 ~ 30, units are seconds, outside the range
as5Example:*TH,0000000000,S20,130305,1,3,10,3,5,5,3,5,3,5,3,5# ;
Car receiver first check set_flag after receiving the command , if it not support off the oil, wi
ll return information directly
*TH,2020916012,V4,S20,ERROR,130305,050316,A,2212.8745,N,11346.6574,E,14.28,028,
220902,FFFFFBFF#

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#

GPRS New Agreement 140108


English Address Request Protocol (terminal requests):
* XX, YYYYYYYYYY, VI1, HHMMSS, S, latitude, D, longitude, G, speed, direction, DDMMYY,
vehicle_status, net_mcc, net_mnc, net_lac, net_cellid #
English address returned protocol (server sends down):
* HQ, 4106000054, I1_2_EN, 130305,10,1,9, test12345

Chinese Address Request Protocol (terminal requests):


* XX, YYYYYYYYYY, V2, HHMMSS, S, latitude, D, longitude, G, speed, direction, DDMMYY,
vehicle_status, net_mcc, net_mnc, net_lac, net_cellid #
Chinese address returned protocol (server sends down):
* HQ, 4106000054, I1, 130305,10,1,4, 5e 7f 4e 1c

net_mcc, net_mnc, net_lac, net_cellid # 460,01,43559,344224 #

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. 19~1C 1D 1E 1F 20~23 24 25 26


Conte 0x00001
0Xfffffbff 0xff 0x01CC 0x01
nt 234
GSM
signa GPS GPS Operato
Meani vehicle_stat Usr_alar
ls (1 signa units km Country code rs
ng us m_flag
to l mileage Number
31)

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.

Base station information


Country code, 460 = 0x01CC
Operator number, 01 = 0x01
Station number, 34569 = 0x8763
Cell ID, 23452 = 0x5B9C

Upload V1 on-line information and data when the device or alarm

*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.

heartbeat packet example:


*HQ,4209809058,V1,064709,v,2233.9355,N,11351.7442,E,000.00,000,231215,FFFFFBFF,460,
00,0,0,6#

Center respond:(The heartbeat packet upload platform must be answered. No


response device will keep restart)

Respond data form:


*HQ,4209809058,V4,V1,20151223064711# Response time: according to the 0 time zone
of the server's current time

GPS data example:$G 咷 3"4U5?


2447100486470805331911182234025506113516922E000000FFFFFBFFFF001603000000000
1CC000000000000750B

You might also like