JT/T808 Protocol
General JT/T808 Protocol
                   V1.1
JT/T808 Protocol
1. Protocol Basis
  1.1 Communication Way
The communication method adopted by the protocol should comply with the relevant
regulations in JT/T 794. The communication protocol adopts TCP, the platform serves
as the server and the terminal serves as the client. The customized or extended part of
the content is marked in bold red in this agreement document.
  1.2 Data Type
The data types used in the protocol message are shown in Table 1:
Table 1 Data Type
       Data Type       Description and requirements
       BYTE            Unsigned single byte integer ( Byte,8 Digital )
       WORD            Unsigned double byte integer( Byte,16 Digital)
       DWORD           Unsigned four-byte integer( Double Byte,32 Digital)
       BYTE[n]         n byte
       BCD[n]          8421 Code,n byte
       STRING          GBK encoding, using 0 terminator, if there is no data,
                       put a 0 terminator
  1.3 Transmission rules
The protocol uses big-endian network byte order to transfer words and double words.
JT/T808 Protocol
The agreement is as follows:
—— Byte (BYTE) transmission convention: according to byte stream transmission;
——The transmission convention of WORD: first transfer the high eight bits, and then
transfer the low eight bits;
— — The transmission convention of DWORD: first transfer the high 24 bits, then
transfer the high 16 bits, then transfer the high eight bits, and finally transfer the low
eight bits.
  1.4 The composition of the message
1.4.1 Message Structure
Each message consists of identification bits, message header, message body and check
code. The message structure diagram is shown in Figure 1:
      identificati   message      message body       check code        identificati
      on bits        header                                            on bits
                               Figure 1 Message Structure
1.4.2 Identification Bits
    Using Ox7e means that if 0x7e appears in the check code, message header, and
message body, it must be escaped. The escape rules are defined as follows:
0x7e<——>0x7d is followed by a 0x02;
0x7d<——>0x7d is followed by a 0x01;
    The escaping process is as follows:
         When sending a message: message encapsulation -> calculate and fill in the
check code -> escape;
JT/T808 Protocol
          When receiving a message: Escape and restore——>Verify check code—
—>Analyze the message.
         Example:
    Send a data packet whose content is 0x30 0x7e 0x08 0x7d 0x55, and the package is
as follows: 0x7e 0x30 7d 0x02 0x08 0x7d 0x01 0x55 0x7e.
    1.4.3 Message Header
The content of the message header is shown in Table 2:
                                    Table 2
Start byte    Number Field     Data Type           Description & Requirements
    0          Message ID       WORD
    2               Message     WORD         The structure diagram of the message
                     body                    body attribute format is shown in
                attributes                   Figure 2
    4               Terminal    BCD[6]       This field is the terminal device number
                     phone                   affixed to the shell of the device, a total
                    number                   of 11 digits, and the device number is
                                             uploaded with 0 in front of it. For
                                             example: 138081234567, data upload
                                             0138081234567
    10              Message     WORD         Cyclically accumulate from 0 in the
              serial number                  sending order
    12              Message                  If the relevant flag in the message body
                    package                  attribute determines that the message
JT/T808 Protocol
              encapsulation                    is subpackaged, then this item has
                    item                       content, otherwise there is no item
The structure diagram of the message body attribute format is shown in Figure 2:
15    14      13    12      11    10   9   8   7     6    5      4   3     2     1     0
Reserve      Subc          Data                    Message body length
             ontr     encryption
             act         method
     Data encryption method:
     —— bit10-bit12 is the data encryption identification bit;
     ——When these three bits are all 0, it means that the message body is not
encrypted;
     ——When the 10th bit is 1, it means that the message body is encrypted by RSA
algorithm;
     ——Other reservations.
     Subcontract:
     When the 13th bit in the message body attribute is 1, it means that the message
body is a long message, and the packet is sent. The specific subpackage information is
determined by the message package encapsulation item; if the 13th bit is 0, there is no
message package encapsulation in the message header Item field.
     The contents of the message package encapsulation items are shown in Table 3
Table 3
JT/T808 Protocol
  Start         Number             Data Type              Description & Requirements
  Byte            Field
    0             Total             WORD             The total number of packets after the
                number of                                   message is subpackaged
                message
                  packs
    2            Packet             WORD                           Start from 1
                sequence
                 number
1.4.4 Check code
    The check code refers to the XOR from the beginning of the message to the next
byte until the previous byte of the check code, which occupies one byte.
2. Data Format
  2.1 Terminal general response【0001】
    Message ID: 0x0001。
    The data format of the terminal general response message body is shown in Table 4.
        Start        Number           Data            Description & Requirements
         Byte             Field       Type
          0         Reply serial     WORD      The serial number of the corresponding
                     number                    platform message
JT/T808 Protocol
        2           Reply ID       WORD        The ID of the corresponding platform
                                               message
        4            Result         BYTE       0:Success/confirmation;1:Fail;2:
                                               Error;
                                               3:not support
  2.2 Platform general response【8001】
    Message ID:0X8001。
   The data format of the platform general response message body is shown in Table 5.
      Start         Number          Data             Description & Requirements
       Byte           Field         Type
        0          Reply serial    WORD        The serial number of the corresponding
                    number                     terminal message
        2           Reply ID       WORD        The ID of the corresponding terminal
                                               message
        4            Result         BYTE       0:Success/confirmation;1:Fail;2:
                                               Error;
                                               3:not support 4:Alarm processing
                                               confirmation
  2.3 Terminal heartbeat【0002】
    Message ID:0X0002.
    The terminal heartbeat data message body is empty.
JT/T808 Protocol
    The platform replies to a general response
  2.4 Terminal registration【0100】
    Message ID:0X0100。
    The data format of the terminal registration message body is shown in Table 6.
      Start         Number       Data            Description & Requirements
       Byte           Field      Type
        0           State ID    WORD      Indicate the province where the vehicle
                                          is installed on the terminal, 0 is
                                          reserved, and the default value is taken
                                          by the platform. The provincial ID
                                          adopts the first two of the six
                                          administrative division codes specified
                                          in GB/T 2260.
        2            City ID    WORD      Indicate the city and county where the
                                          vehicle is installed on the terminal, 0 is
                                          reserved, and the platform takes the
                                          default value. The city/county area ID
                                          adopts the six last four digits of the
                                          administrative division code specified in
                                          GB/T 2260.
        4          Manufactur   BYTE[5]   Five bytes, terminal manufacturer code.
                     er ID
JT/T808 Protocol
        9           Terminal       BYTE[8]     Eight bytes, this terminal model is
                     Model                     defined by the manufacturer, the
                                               number of digits is not eight, and the
                                               space is filled.
        17         Terminal ID     BYTE[7]     Seven bytes, composed of uppercase
                                               letters and numbers, this terminal ID is
                                               defined by the manufacturer.
        21         Color of Car     BYTE       The color of the license plate, in
                      Plate                    accordance with 5.4.12 of JT/T 415-2006,
                                               the value is 0 when it is not on the
                                               license plate
        25          Car Plate      STRING      Motor vehicle license plate issued by
                                               the public security traffic management
                                               department
  2.5 Terminal registration response【8100】
    Message ID:0x8100。
   The data format of the terminal registration response message body is shown in Table 7.
      Start         Number          Data              Description & Requirements
      Byte            Field         Type
        0          Reply serial    WORD        The serial number of the corresponding
                     number                    terminal registration message
        2            Result         BYTE       0:Success;1:Vehicle has been
JT/T808 Protocol
                                               registered;2:No such vehicle in the
                                               database;3:The terminal has been
                                               registered;4:No such terminal in the
                                               database
        3          Authenticati    STRING      This field is only available after success
                     on code
  The terminal will go through the registration process again every time it is reset, and
the platform needs to respond to the registration message at any time.
  2.7 Terminal authentication【0102】
    Message ID:0x0102.
   The data format of the terminal authentication message body is shown in Table 8-1.
      Start         Number          Data              Description & Requirements
      Byte            Filed         Type
        0          Authenticati    STRING      Report the authentication code after the
                     on code                               terminal reconnects
   Table 8-2 Platform response terminal authentication message body data format
      Start          Number          Data             Description & Requirements
      Byte            Field         Type
        0          Reply serial    WORD         The serial number of the corresponding
                     number                                 terminal message
        2           Reply ID       WORD             0x0102:Terminal authentication
                                                                message ID
JT/T808 Protocol
        4           Result          BYTE             0:Success/confirmation;1:Fail
2.8 Set terminal parameters【8103】
    Message ID:0x8103
   The data format of the message body for setting terminal parameters is shown in Table 9.
       Start Byte            Number Field             Data Type           Description &
                                                                          Requirements
             0            Total number of               BYTE
                              parameters
              1           List of parameter                               The parameter
                                items                                     item format is
                                                                        shown in Table 10
   Table 10 Data format of terminal parameter item
     Number Field             Data Type                           描述及要求
     Parameter ID              DWORD                    Parameter ID definition and
                                                     description are shown in Table 11
       Parameter                BYTE
         Length
       Parameter                                      If it is a multi-value parameter,
            value                                    multiple parameter items with the
                                                 same ID are used in the message, such
JT/T808 Protocol
                                                      as the telephone number of the
                                                               dispatch center
   Table 11: Definition and description of each parameter item of terminal parameter setting
    Paramete       Data Type                    Description & Requirements
       r ID
      0x0001       DWORD           Terminal heartbeat sending interval, in seconds(s)
      0x0010        STRING         Main server APN, wireless communication dial-up
                                                        access point.
      0x0013        STRING               Main server address, IP or domain name
      0x0017        STRING             Backup server address, IP or domain name
      0x0018       DWORD                               Server TCP port
      0x0020       DWORD           Location report strategy, 0: regular report; 1: fixed
                                  distance report; 2: regular and fixed distance report
      0x0027       DWORD            Reporting time interval during sleep, in seconds
                                                            (s), >0
      0x0029       DWORD         The default time reporting interval, in seconds (s), >0
     0x002C        DWORD         The default distance report interval, the unit is meter
                                                            (m),>0
      0x0030       DWORD          Inflection point supplementary transmission angle,
                                                             <180°
      0x0055       DWORD             Maximum speed in kilometers per hour (km/h)
JT/T808 Protocol
      0x0056       DWORD                   Overspeed duration in seconds (s)
      0x0080       DWORD                   Vehicle odometer reading, 1/10km
      0x0081       DWORD                Province ID where the vehicle is located
      0x0082       DWORD                   City ID where the vehicle is located
      0x0083        STRING          Motor vehicle license plate issued by the public
                                        security traffic management department
      0x0084         BYTE          The color of the license plate is in accordance with
                                                  5.4.12 of JT/T415-2006
2.9 Query terminal parameters【8104】
    Message ID:0x8104
The query terminal parameter message body is empty.
2.10 Query terminal parameter response【0104】
    Message ID:0x0104。
     The data format of the query terminal parameter response message body is shown in Table 12.
    Start Byte     Number Filed         Data            Description & Requirements
                                        Type
         0          Reply serial       WORD               The serial number of the
                      number                        corresponding terminal parameter
                                                               query message
         2          Number of           BYTE
                     response
JT/T808 Protocol
                    parameters
         3             List of                     The parameter format and definition
                    parameter                                are shown in Table 10
                       items
2.11 Terminal control【8105】
Message ID:0x 8105。
The data format of the terminal control message body is shown in Table 13.
                   Table 13 Terminal control message body data format
       Start       Number Field         Data              Description & Requirements
       Byte                             Type
         0          Command             BYTE        See Table 14 for the description of
                       word                         terminal control command words
         1          Command           STRING        The command parameter format is
                    parameters                            described later. Each field is
                                                    separated by a half-width ";", and
                                                         each STRING field is processed
                                                    according to GBK encoding before
                                                              forming a message
Table 14 Description of terminal control command words
     Comm           Command                       Description & Requirement
JT/T808 Protocol
      and           Parameter
      Byte
      0x04              No                         Terminal reset (restart)
      0x05              No               Restore the factory settings of the terminal
      0x17              No                        Turn on voice recording
      0x18           2 Bytes                   Turn on continuous recording
                                                 Recording time, in minutes
      0x19              No                            Stop all recording
      0x64              No                        Cut off oil and electricity
      0x65              No                        Restore oil and electricity
      0x66              No                          External fortification
      0x67              No                             External disarm
2.12 Location information report【0200】
    Message ID:0x0200。
    The location information report message body consists of a list of location basic
information and location additional information items. The message structure diagram
is shown in Figure 3:
            Basic location information          List of location additional information
                                                                 items
    The location additional information item list is composed of various location
JT/T808 Protocol
additional information items, or not, and is determined according to the length field in
the message header.
   The data format of basic position information is shown in Table 16.
      Start        Number Field          Data             Description & Requirements
      Byte                               Type
        0           Alarm sign         DWORD        Refer to Table 18 for the definition of
                                                    alarm flag bit
        1             Status           DWORD        The status bit definition is shown in
                                                    Table 17
        8            latitude          DWORD        The latitude value in degrees is
                                                    multiplied by 10 to the 6th power,
                                                    accurate to one millionth of a degree
        12          longitude          DWORD        The latitude value in degrees is
                                                    multiplied by 10 to the 6th power,
                                                    accurate to one millionth of a degree
       16             Height            WORD        Altitude above sea level, in meters
                                                    (m)
        18            Speed             WORD        1/10km/h
       20           Direction           WORD        0-359, true north is 0, clockwise
        21             Time            BCD[6]       YY-MM-DD-hh-mm-ss(GMT+8 time,
                                                    the time involved after this standard
                                                    adopts this time zone)
JT/T808 Protocol
   Table 17 Status bit definition
        Bit                                        Status
         0                                 0: ACC Off;1:ACC On
         1                             0: Un-Position;1: Positioned
         2                           0: north latitude;1: south latitude
         3                          0: East longitude;1: West longitude
        4-5                                       Reserve
         6                                  0: Disarm 1:Fortify
        7-9                                       Reserve
         10                     Oil circuit status:0: normal;1: Disconnected
         11               Power-off state:0: Main Power Normal:1: Main Power
                                               Disconnected
       12-31                                      Reserve
JT/T808 Protocol
   Table 18 Definition of alarm flag bit
      Bit                  Definition                Processing instructions
       0      1:Emergency alarm (SOS alarm)    Cleared after receiving the response
       1             1:Overspeed Alarm           The flag is maintained until the
                                                   alarm condition is removed
       2              1:Fatigue driving          The flag is maintained until the
                                                   alarm condition is removed
     3-6                    Reserve
       7      1:Terminal main power supply       The flag is maintained until the
                         undervoltage              alarm condition is removed
       8       1:Main power disconnection        The flag is maintained until the
                              alarm                alarm condition is removed
     9-14                   Reserve
      15        Low battery alarm (wireless    Cleared after receiving the response
                             device)
      16               Vibration Alarm         Cleared after receiving the response
     17-18                  Reserve
      19             1:Overtime parking          The flag is maintained until the
                                                   alarm condition is removed
    20-27                   Reserve
      28      1:Illegal vehicle displacement   Cleared after receiving the response
    29~31                   Reserve
JT/T808 Protocol
    See Table 19 for the format of location additional information items.
                      Table 19 Location Additional Information Item Format
         Number Field                      Data Type                     Description &
                                                                         Requirements
    Additional Information                    BYTE                           1-255
                 ID
    Additional Information                    BYTE
               Length
    Additional Information                                          Additional information
                                                                     is defined in Table 20
   Table 20 Definition of additional information
     Additional           Additional                    Description & Requirements
    Information       Information Length
         ID
        0x01                   4                       Mileage, DWORD, 1/10km, local
                                                    accumulated mileage of the terminal
       0x2B                    4                   The two-channel fuel consumption data
                                              adopts the reported data as the Changrun
                                                       fuel consumption protocol data
        0x30                   1                   Network signal strength CSQ value 0-31
        0x31                   1                   The number of GPS satellites, the signal
                                               value is greater than 25dB The number of
JT/T808 Protocol
                                               satellites
        0x51         16     16 bytes, 2 bytes for a group temperature,
                               a total of 8 channels of temperature
        0x52         1         Forward and reverse (0: unknown; 1:
                              forward (empty) 2: reverse (heavy); 3:
                                                 stop)
        0x53       1+n*8    2G base station data
                            0x53 1+n*8 Base station data: The first
                            byte is the number of base stations,
                            followed by n base station data;
                            Base station data: 0-1 MCC;
                            2 MNC; 3-4 LAC; 5-6 CELLID; 6 signal
                            strength
        0x54       1+n*7    Wifi data: the number of wifi in the first
                            byte, followed by n wifi data; WIFI data:
                            0-5 wifiMac; 6 signal strength
        0x56         2      Internal battery level
                            Byte 1, power level 0-10
                            Byte 2, reserved
       0x5D        1+n*10   4G base station data
                            The first byte is the number of base
                            stations, followed by n base station data;
JT/T808 Protocol
                                            0x5D 1+n*10 Base station data: 0-1 MCC; 2
                                            MNC; 3-4 LAC; 5-8 CELLID; 9 signal
                                            strength
        0x61                  2             Main power supply voltage value, unit
                                            0.01V
        0xF1                 20             ICCID, the terminal will report once every
                                            time the terminal completes the platform
                                            authentication.
        0xF3                  1             Armed/disarmed state, 0x00 is disarmed,
                                            0x01 is armed
2.13 Location information query【8201】
    Message ID: 0x8201。
    The location information query message body is empty.
2.14 Location information query response【0201】
    Message ID: 0x0201。
    The data format of the location information query response message body is
shown in Table 24.
 Table 24: Data format of location information query response message body
       Start Byte          Number Field             Data Type            Description &
                                                                        Requirements
           0           Reply serial number            WORD            The serial number
JT/T808 Protocol
                                                                              of the
                                                                         corresponding
                                                                            location
                                                                       information query
                                                                            message
              2                 Location                                  For location
                         information report                           information report,
                                                                             see 8.12
2.16 Bulk upload of positioning data (refill data)【0704】
See Table 26 for the data format of the message body of the positioning data bulk
upload.
   Table 26 The data format of the message body of the positioning data bulk upload
    Start Byte     Number Field       Data Type           Description & Requirements
          0         Number of              WORD        The number of location report
                    data items                         data items included, >0
          1        Location data           BYTE        0: Normal position batch report;
                       type                            1: Blind spot supplementary
                                                       report
          2          Location                          For definition, see Table 27 of
                    report data                        Location Report Data Item
                       item
JT/T808 Protocol
   Table 27 Data format of location report data item
    Start Byte     Number Field        Data Type           Description & Requirements
        0            Location            WORD           Position data body length, n
                    report data
                      length
        2            Location           BYTE[n]         Report in the same position in
                    report data                         format, see 2.13 for definition
                       body
2.17 Text information issuance【8300】
    Message ID: 0x8300。
       The data format of the message body sent by the text information is shown in
                                           Table 28.
Table 28 Data format of the message body sent by the text information
    Start Byte     Number          Data Type              Description & Requirements
                     Field
        0            Sign             BYTE             The text information flag bit [fixed
                                                          to 0x02] see Table 29 for the
                                                                    meaning
         1           Text            STRING               The maximum length is 1024
                   Informat                                  bytes, encoded by GBK
                     ion
JT/T808 Protocol
    Table 29 Meaning of text information flags
                       Bit                                         Sign
                          0                                     1:Emergency
                          1                                       Reserve
                          2                       1:Transparent transmission of text
                          3                            1:Terminal TTS broadcast
                          4                          1:Advertising screen display
                      5-7                                         Reserve
2.18 Report text information【6006】
    Message ID: 0x6006。
    The data format of the text information report message body is shown in Table 30.
(8300 issued by the platform, 6006 answered by the terminal)
   Table 30: Text information report message body data format
    Start Byte     Number Field       Data Type             Description & Requirements
    0              Sign               BYTE                  Fixed as 0x00
    1              Text               STRING                The maximum       length   is
                   Information                              1024 bytes, encoded by GBK
JT/T808 Protocol
2.19 Recording related
The recording format currently uses the AMR file format, voice control and
continuous recording control through the 0x8105 command.
Multimedia data upload
    Message ID: 0x0801。
    The data format of the multimedia data upload message body is shown in the table
below.
Start Byte     Number      Data Type           Description & Requirements
                   Field
    0        Multimedi     DWORD       >0
                   a ID
    4        Multimedi       BYTE      0: image; 1: audio; 2: video
               a Type
    5        Multimedi       BYTE      0: JPEG; 1: TIF; 2: MP3; 3: WAV; 4: WMV;
              a format                 other reserved
              encoding
    6        Event item      BYTE      0: Command issued by the platform; 1:
               coding                  Timed action; 2: Robbery alarm triggered; 3:
                                       Collision rollover alarm triggered; other
                                       reserved
    7        Channel ID      BYTE
JT/T808 Protocol
      8       Multimedi
                   a data
                 packet
Only the first data packet contains the 8 bytes of "Multimedia ID — Channel ID", the
subsequent packets are directly multimedia data, and each packet carries a maximum
of 1000 bytes of multimedia data, and the last packet is subject to the actual file.
The platform uses a general response to reply to each multimedia data packet.
Multimedia data upload result
      Message ID: Ox8800。
      The data format of the multimedia data upload response message body is shown
in the table below.
    Start   Number Field        Data Type             Description & Requirements
    Byte
0           Multimedia       DWORD               >0
            ID
4           Total number     BYTE
            of
            retransmitted
            packets
5           Retransmissio                        No more than 125 items, no such field
JT/T808 Protocol
            n packet ID                         means that all data packets have been
            list                                received
After the platform has processed all media packages, it needs to send this message to
the terminal to report that the file has been received or the corresponding package
needs to be retransmitted.
If the terminal does not receive this message within 5 seconds, it will automatically exit
the current file upload process.