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

MT4 Protocol

The document describes a GPRS communication protocol. It details the format and contents of heartbeat packages and normal data packets sent from vehicle tracking devices, including fields for vehicle ID, timestamp, location, speed, and status information. It also covers commands from and responses back to the server.

Uploaded by

Maur Manz
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)
55 views8 pages

MT4 Protocol

The document describes a GPRS communication protocol. It details the format and contents of heartbeat packages and normal data packets sent from vehicle tracking devices, including fields for vehicle ID, timestamp, location, speed, and status information. It also covers commands from and responses back to the server.

Uploaded by

Maur Manz
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

GPRS communication protocol

1. Heartbeat package:
*XX,YYYYYYYYYY,V5,HHMMSS,S,latitude,D,longitude,G,speed,direction,DDMM
YY,vehicle_status, net_mcc,net_mnc,net_lac,net_cellid, mile#

Among them: * command header


XX manufacturer name, such as TH, DC, XY, etc.
, Separator
YYYYYYYYYY serial number of vehicle-mounted device. 10 digits
V1 data type, V1 heartbeat packet V2 address request V5 with mileage data
V6 with ICCID
HHMMSS time: hour/minute/second upload time is 0 time zone time, that is,
GPS chip data output time
S: Data valid bit (A/V), A means GPS data is valid positioning data, V means
GPS data is invalid positioning data.

latitude: latitude,
Format DDFF.FFFF,
DD: Degree of latitude (00 ~ 90),
FF.FFFF: The minutes of latitude (00.0000 ~ 59.9999), with four decimal
places.

D: latitude mark (N: north latitude, S: south latitude).

longitude: longitude,
Format DDDFF.FFFF,
DDD: degrees of longitude (000 ~ 180),
FF.FFFF: minutes of longitude (00.0000 ~ 59.9999), with four decimal
places.
(WGS84 geographic coordinate system)

G: Longitude sign (E: East longitude, W: West longitude).

speed: speed, range 000.00 ~ 999.99 knots, with two decimal places.
1 knot=1 nautical mile/hour=1.852km/hour=0.514444m/s

direction: azimuth angle 0-359 degrees, true north is 0 degrees, resolution


1 degree, clockwise direction.

DDMMYY: day/month/year

vehicle_status: Vehicle status, a total of four bytes, indicating the


status of vehicle components, vehicle components, and alarm status.
Use ASCII characters to represent the hexadecimal value, the following is
the specific meaning of each byte in the variable, bit means negative logic,
that is, bit=0 is valid. See appendix 1 table at the back of the document
net_mcc: mobile country code
net_mnc: mobile network code
net_lac: base station area code
net_cellid: base station code
mile: Mileage in meters
# Terminator

Examples are as follows:


*HQ,8168000008,V1,043602,A,2234.9273,N,11354.3980,E,000.06,000,100715,
FBFFBBFF,460,00,10342,4283#
Examples with mileage data are as follows:
*HQ,8168000008,V5,043602,A,2234.9273,N,11354.3980,E,000.06,000,100715,
FBFFBBFF,460,00,10342,4283,1000#
The example with ICCID data is as follows:
*HQ,8168000008,V6,043602,A,2234.9273,N,11354.3980,E,000.06,000,100715,
FBFFBBFF,460,00,10342,4283,898602A2091508006821#

2. Normal data packet


Examples are as follows:
24 8168000008 043602 100715 22349273 06 113543980E 000000
FBFFBBFF 00000000 00000000 01CC 00 2866 10BB XX
Encoding format HEX:

2. Normal data packet


Examples are as follows:
24 8168000008 043602 100715 22349273 06 113543980E 000000
FBFFBBFF 00000000 00000000 01CC 00 2866 10BB XX
Encoding format HEX:

24 8168000008 043602 100715 22349273 06 113543980E 000000


FBFFBBFF 00000000 00000000 01CC 00 2866 10BB XX
编码格式 HEX:
Serial 00 01 02 03 04 05 06 07 08 09 0A 0B

Content $ 8168000008 043204 100715

Meaning Head Device ID Time Date

1
Serial 0C 0D 0E 0F 10 12 13 14 15 16 17 18
1

2
Content 22349273 06 113543980E 014028

Back up
Longtitude、N、E、 Speed、
Meaning Latitude battery
AV Direction
level

Serial 19~1C 1D~20 21~24 25~26 27 28~29 2A~2B 2C

0xFFF 0x00989 0x00000


Content 0x01cc 0x00 0x2688 0x10bb XX
FFBFF 680 000

vehic
Undefin Cell Record
Meaning le_st Mileage mcc mnc lac
ed id Number
atus

Description: "$" (0x24): Record header, used for the center to identify
the starting position of the record, and the data packet length is fixed
at 45 bytes;
Time: 043204, standard time 4:32:4, which is equivalent to 12:32:4, Beijing
time;
Date: 100715, July 10, 2015;

Latitude value: 22349273, 22 degrees 34.9373 minutes

Power: Two levels can be compatible


Level 1: 06 means 100% 05 means: 80% 04:60% 03:20% 02:10% 01:5% 00:0%
Level 2: 0x64 means that when 100% is less than 7%, the front is filled
with F, and the actual value is greater than or equal to 7%, and one byte
is fixed

Longitude value: 113543980E, 113 degrees 54.3980 minutes,

The meaning of the last byte (serial number 0x15):


bit3, 1: east longitude, 0: west longitude
bit2, 1: north latitude, 0: south latitude
bit1, 1: A (GPS positioning), 0: V (GPS without positioning)
bit0, undefined

Speed, direction:
0x014028:
Speed ​ ​ 014 knots (1 knot=1 nautical mile/hour=1.852

3
km/hour=0.514444m/s)

Direction 028 0 is true north decimal

vehicle_status: Vehicle status and user-defined alarm status expressed in


binary. The meaning is the same as the heartbeat packet.
Mileage statistics: 0x00989680, 0x00989680 = 10000000 meters = 10000
kilometers

Reserved space:
mcc: mobile country code
mnc: mobile network code
lac: base station area code
cell id: base station code
Record No.: The record serial number in binary format, which is
automatically incremented by 1 each time a record is sent.

4
Appendix 1 Table

N Vehicle tracker Vehicle


Undefined Alarm
o status Status
. First byte second byte third byte fourth byte
Car door
0 1 Undefined 1 Undefined 0 1 Undefined
Open
Vehicle
Displacement
1 0 0 Shock Alarm 0 fortifica 0 Robber
alarm
tion
Supplementary
2 0 1 Undefined 0 ACC off 0 Speeding alarm
data
Disconnect
The vehicle is Illegal ignition
3 0 0 with vehicle 0 Undefined 0
cut off alarm
battery
Battery removal Illegal opening
4 0 1 Undefined 0 Undefined 0
alarm alarm
5 1 Undefined 1 Undefined 0 Undefined 0 Low battery alarm
6 1 Undefined 1 Undefined 1 Undefined 0 Low battery alarm
7 1 Undefined 1 Undefined 1 Undefined 1 Undefined
1. Server issued command part
1. The command structure sent by the center:
*XX,YYYYYYYYYY,CMD,HHMMSS,PARA1,PARA2,…#
Among them: * command header
XX manufacturer name, two fixed ASCII characters, such as: TH, DC, XY,
etc.
The in-vehicle device will check whether the manufacturer's name matches, if
it does not match, it will not be considered as a central command. You can press
the emergency button to make the vehicle-mounted device send an alarm message,
and get the manufacturer's name from the alarm information (you need to set
up the vehicle-mounted device first).
, Separator
YYYYYYYYYY serial number of the vehicle-mounted machine, which is ignored by
the vehicle-mounted machine, and can be filled with ASCII characters within
10 digits such as: 000.
CMD command number
HHMMSS time: hour/minute/second,
PARA command parameters
# Terminator
All English letters in the command characters are capitalized, and spaces
cannot be inserted.

2. The structure of the information returned by the vehicle:


*XX,YYYYYYYYYY,V4,CMD,hhmmss,HHMMSS,S,latitude,D,longitude,G,speed,directi

5
on,DDMMYY, vehicle_status, net_mcc,net_mnc,net_lac,net_cellid #
Among them: * command header
XX manufacturer name, such as TH, DC, XY, etc.
, Separator
YYYYYYYYYY serial number of vehicle-mounted device.
V4 packet type
CMD is confirmed by the central command.
hhmmss is the time value in the confirmed command
The time of the HHMMSS vehicle-mounted machine, UTC standard time, is 8 hours
away from Beijing time.
S: Data valid bit (A/V), A means GPS data is valid positioning data, V means
GPS data is invalid positioning data.
latitude: latitude, format DDFF.FFFF, DD: degrees of latitude (00 ~ 90),
FF.FFFF: minutes of latitude (00.0000 ~ 59.9999), with four decimal places.
D: latitude mark (N: north latitude, S: south latitude).
longitude: longitude, format DDDFF.FFFF, DDD: longitude degrees (000 ~ 180),
FF.FFFF: longitude minutes (00.0000 ~ 59.9999), with four decimal places.
G: Longitude sign (E: East longitude, W: West longitude).
speed: speed, range 000.00 ~ 999.99 knots, with two decimal places.
The information field may be empty, namely longitude,G,,direction,, indicating
that the speed is 0.
direction: azimuth angle, true north is 0 degrees, resolution is 1 degree,
clockwise.
The information field may be empty, such as longitude, G, speed,, MMDDYY,,
indicating that the angle is 0.
DDMMYY: day/month/year
vehicle_status: vehicle status
net_mcc: mobile country code
net_mnc: mobile network code
net_lac: base station area code
net_cellid: base station code
# Terminator

Three, the center sends the command set

1) The server receives the data packet and issues the confirmation instruction
R12
Equipment transmission: *HQ data and 24 data, the server returns the following
confirmation data.
Service return: *HQ,8168000005,R12,062108#
8168000005: The actual ID code of the corresponding device
062108: UTC time

2) Set the device data upload interval command D1

6
Example: *HQ,8168000005,D1,062108,30,1#
Set the ignition upload time interval to 30 seconds

Equipment return:
*HQ,8168000005,V4,D1,30,65535,062108,062225,A,2235.0086,N,11354.3668,E,000.
00,000,160716,FFFFBBFF,460,00,10342,3721#

3) Cut off oil and electricity S20


Oil and electricity cut command: *HQ,8168000005,S20,061158,1,1#
Equipment return: *HQ,8168000005,V4,S20,OK,061158,061202,
A,2235.0086,N,11354.3668,E,000.00,000,160716F7FFBBFF,460,00,10342,3721#

Restoration of oil and electricity orders: *HQ,8168000005,S20,061713,0,0#


Equipment return: *HQ,8168000005,V4,S20,OK,061713,061730,
A,2235.0086,N,11354.3668,E,000.00,000,160716,FFFFB9FF,460,00,10342,3721#

4) Command SCF
Fortification: *HQ,8168000005,SCF,061837,0,0#
Equipment return: *HQ,8168000005,V4,SCF,061837,061955,
A,2235.0086,N,11354.3668,E,000.00,000,160716,FFFFB9FF,460,00,10342,3721#

Disarming: *HQ,8168000005,SCF,061939,1,1#
Equipment return: *HQ,8168000005,V4,SCF,061939,062057,
A,2235.0086,N,11354.3668,E,000.00,000,160716,FFFFBBFF,460,00,10342,3721#

5) Set the master control number command S71


Server issued: *HQ,8168000005,S71,062328,01,18688993050#
Equipment return: *HQ,8168000005,V4,S71,01,062328, 062355,
A,2235.0086,N,11354.3668,E,000.00,000,160716,FFFFB9FF,460,00,10342,3721#

6) Set SOS number instruction S71


Server issued: *HQ,8168000005,S71,063012,02,18600000001,18600000002#
Equipment return: *HQ,8168000005,V4,S71,02,063012, 063055,
A,2235.0086,N,11354.3668,E,000.00,000,160716,FFFFB9FF,460,00,10342,3721#

7) Clear alarm command R7


Server issued: *HQ,8168000005,R7,063012#

8) SMS command transparent transmission reply (ASCII code)


The server sends an SMS command: admin123456 13888888888
Device return: *HQ,8168000005,SMS,SET OK#

7
Server address request:
*HQ,8168000005,V2,064645,A,2235.0139,N,11354.3648,E,000.07,000,080316,FFF7
BBFF,460,00,10342,3721#

Server return address: Chinese address encoding: unicode


*HQ,8168000005,I1,064836,10,1,64,004700500053003a5e7f4e1c77016df157335e025
b9d5b89533a59275b9d8def0036003553f765b067ef57ce79d162805de54e1a56ed897f531
7003800377c73#

*HQ,8168000005,I1,064836,10,1,

64: length

004700500053003a5e7f4e1c77016df157335e025b9d5b89533a59275b9d8def0036003553
f765b067ef57ce79d162805de54e1a56ed897f5317003800377c73

Unicode encoding
GPS: 87 meters northwest of Xinkecheng Technology Industrial Park, No. 65 Dabao
Road, Baoan District, Shenzhen, Guangdong Province

Example: 004700500053003a is converted to Unicode encoding format


\u0047\u0050\u0053\u003a
Conversion: GPS:

Example: Convert 5e7f4e1c7701 to Unicode encoding format \u5e7f\u4e1c\u7701


Conversion: Guangdong Province

You might also like