JT/T808 Protocol Gateway

    1. Terminal side: exchange data through the JT/T 808 protocol to report different types of data, or send downlink messages to the terminal.
    2. Platform side: emqx-jt808 decodes the message and performs registration/authentication, or PUBLISH the data message to a specific topic; the agent subscribes to the downstream topic, and converts the downstream PUBLISH message into a JT/T 808 protocol message The text structure is delivered to the terminal.

    Create module

    Open EMQX Dashboard (opens new window), click the “Modules” tab on the left, and choose to add:

    image-20200927213049265

    Select JT/T808 protocol to access the gateway:

    Configure related basic parameters:

    image-20200927213049265

    Add listening port:

    Configure monitoring parameters:

    image-20200927213049265

    After clicking Add, the module is added: image-20200927213049265

    emqx-jt808 implementation regulations:

    -In the system, the mobile phone number is used as the unique identification of a connection, namely ClientId

    The implementation of emqx-jt808 supports anonymous access authentication:

    The detailed format of the registration request is as follows:

    Registration request:

    1. Method: POST
    2. Body:
    3. {"province": 58,
    4. "city": 59,
    5. "manufacturer": "Infinity",
    6. "model": "Q2",
    7. "dev_id": "xx11344",
    8. "phone", "00123456789"
    9. }

    Registration Response:

    Authentication request:

    1. URL: http://127.0.0.1:8991/jt808/auth
    2. Method: POST
    3. {"code": "authcode",
    4. "phone", "00123456789"
    5. }

    Authentication response:

    The authentication request is only called when the system does not save the authentication code (that is, the terminal directly sends an authentication message to log in to the system)

    In emqx-jt808, you can send and receive terminal messages by configuring uplink and downlink topics:

    Upward

    For example: Manufacturer Id is ʻabcdeand **Terminal Id** is1234567`.

    First use the MQTT client to subscribe to the topic jt808/abcde1234567/up:

    1. $ mosquitto_sub -t jt808/abcde1234567/up

    For example, after the terminal reports a message of type , the subscriber will receive:

    Tip

    For transparent transmission, the content of the data field will be base64 encoded and reported once

    Similarly, take the ID in the above row as an example; after the terminal is successfully authenticated, use the MQTT client to send a message of the type’data downlink transparent transmission (0x8900)’ to the terminal:

      Tip

      In the downstream JSON, the content in the header only needs to have msg_id; the content in the body has different structures according to different msg_id