EMQ X Enterprise now supports the IoV GB/T32960 protocol

In the past several years, IoV has developed from a concept into a trend, sweeping through major car manufacturers and related upstream and downstream industries. A series of guidance standards of relevant departments in China have emerged around the construction of the IoV industry standard system.

EMQ is committed to providing a high-quality Internet of Everything engine for enterprises and has not only established extensive cooperation with mainstream car manufacturers and industry chain-related companies but also provided additional capabilities and technical support from the national standard and industry-standard level. With the v4.2.3 release, EMQ X adds another IoV related GB/T32960 protocol access capability.

GB/T32960 is the guideline standard for communication between remote service platforms for new energy vehicles, based on the TCP transmission protocol, and can be used for the communication between the vehicular communication module and the remote service platform.

This article will introduce how EMQ X can access the GB/T32960 protocol devices from the user's perspective.

Working principle

EMQ X Enterprise provides the GB/T 32960 protocol gateway module. The whole process of message exchange can be divided into three parts according to its functional logic and the relationship to the whole system: the terminal side, the platform side, and the other side.

画板2x.png

  1. The terminal side: Data is exchanged via the GB/T 32960 protocol, implementing different types of data to be reported or sending downstream messages to the terminal.
  2. The platform side: The EMQ X GB/T 32960 gateway decodes the packets and converts them internally in EMQ X to the MQTT protocol for upstreaming and downstreaming data operations.
    • Data uplink: Publishing the uplink data packet as an MQTT PUBLISH to a specific topic.
    • Data downlink: Publishing the downlink data to a specific topic, and the message is transformed into the GB/T 32960 protocol packet structure and sent down to the terminal.
  3. The other side: The rules engine of EMQ X Enterprise allows the upstream data appearing in 2 to be stored/forwarded to enterprise databases, stream processing platforms (e.g. Kafka), and business systems; enterprise application platforms can issue control instructions to EMQ X in a variety of ways, ultimately sending the data to the terminal side.

How to enable

Download EMQ X Enterprise v4.2.3 onwards, open the Dashboard after launching and add and enable the GB/T 32960 gateway under the Modules menu.

  1. Click on Select to enter the module selection interface and select the GB/T 32960 Gateway in Protocols.
  2. Click on the Select button to enter the GB/T 32960 gateway configuration page for pre-launch configuration.
  3. After configuring parameters such as the retransmission, packet, and message length, configure the TCP listener parameters and click Add to enable the GB/T 32960 gateway.

WechatIMG46.png

WechatIMG48.png

WechatIMG47.png

Appendix: Example of data exchange format

The following is the format of the data exchange between GB/T 32960 and EMQ X. The data format has the following conventions:

  • Payload is assembled in JSON format
  • JSON Key is named using the Upper Camel Case

Due to space limitations, only some examples of the exchange format are provided here.

Uplink data

Data flow: Terminal -> GB/T 32960 gateway -> EMQ X.

Vehicle log-in

Topic: gbt32960/${vin}/upstream/vlogin

{
    "Cmd": 1,
    "Encrypt": 1,
    "Vin": "1G1BL52P7TR115520",
    "Data": {
        "ICCID": "12345678901234567890",
        "Id": "C",
        "Length": 1,
        "Num": 1,
        "Seq": 1,
        "Time": {
            "Day": 29,
            "Hour": 12,
            "Minute": 19,
            "Month": 12,
            "Second": 20,
            "Year": 12
        }
    }
}

Vehicle log-out

Topic: gbt32960/${vin}/upstream/vlogout

{
    "Cmd": 4,
    "Encrypt": 1,
    "Vin": "1G1BL52P7TR115520",
    "Data": {
        "Seq": 1,
        "Time": {
            "Day": 1,
            "Hour": 2,
            "Minute": 59,
            "Month": 1,
            "Second": 0,
            "Year": 16
        }
    }
}

Downlink data

GB/T 32960 The gateway controls the terminal in Request-Response mode, sending control data to the Topic used and the response will be returned from the Topic of the characteristic:

Request

Flow of requested data: EMQ X -> GB/T 32960 gateway -> Terminal

Downlink topic: gbt32960/${vin}/dnstream

Response

Flow of response data::Terminal -> GB/T 32960 gateway -> EMQ X

Uplink response topic: gbt32960/${vin}/upstream/response

Parameters enquiry

Req:

{
    "Action": "Query",
    "Total": 2,
    "Ids": ["0x01", "0x02"]
}

Response:

{
    "Cmd": 128,
    "Encrypt": 1,
    "Vin": "1G1BL52P7TR115520",
    "Data": {
        "Total": 2,
        "Params": [
            {"0x01": 6000},
            {"0x02": 10}
        ],
        "Time": {
            "Day": 2,
            "Hour": 11,
            "Minute": 12,
            "Month": 2,
            "Second": 12,
            "Year": 17
        }
    }
}

Parameter settings

Req:

{
    "Action": "Setting",
    "Total": 2,
    "Params": [{"0x01": 5000},
               {"0x02": 200}]
}

Response:

{
    "Cmd": 129,
    "Encrypt": 1,
    "Vin": "1G1BL52P7TR115520",
    "Data": {
        "Total": 2,
        "Params": [
            {"0x01": 5000},
            {"0x02": 200}
        ],
        "Time": {
            "Day": 2,
            "Hour": 11,
            "Minute": 12,
            "Month": 2,
            "Second": 12,
            "Year": 17
        }
    }
}

Terminal control

Remote upgrade: Req:

{
    "Action": "Control",
    "Command": "0x01",
    "Param": {
        "DialingName": "hz203",
        "Username": "user001",
        "Password": "password01",
        "Ip": "192.168.199.1",
        "Port": 8080,
        "ManufacturerId": "BMWA",
        "HardwareVer": "1.0.0",
        "SoftwareVer": "1.0.0",
        "UpgradeUrl": "ftp://emqx.io/ftp/server",
        "Timeout": 10
    }
}

Vehicular terminal shutdown:

{
    "Action": "Control",
    "Command": "0x02"
}

Vehicular terminal alarm:

{
    "Action": "Control",
    "Command": "0x06",
    "Param": {"Level": 0, "Message": "alarm message"}
}
Guowei Li

Guowei Li

EMQ X product manager, develop EMQ X with user experience and integration capabilities.

The streaming database built for IoT data storage and real-time processing.

Fully managed MQTT 5.0 IoT cloud, start a 180-day free trial.

Related Links

MQTT X v1.3.0 was officially released - Cross-platform MQTT 5.0 desktop test client

[MQTT X](https://mqttx.app) is a cross-platform MQTT 5.0 desktop test client provided by the world's leading open source IoT middleware provider [EMQ](https://emqx.io) , which supports macOS, Linux, Windows. The user interface of **MQTT X** simplifies the operation logic of the page with the pattern of chatting software. Users can quickly create multiple simultaneous-online MQTT clients to test the connection/publish/subscribe functions of MQTT/TCP, MQTT/TLS and other MQTT protocol features.

EMQ X Newsletter 202104

In April, EMQ X 4.3-beta.5 release summed up all the fixes has to be done before 4.3.0 release. This allowed us to gradually shift our focuses towards 5.0 development.

Retained message and message expiration interval of EMQ X MQTT 5.0 broker

The message retention function of [EMQ X MQTT Broker](https://emqx.io) is implemented by the `emqx_retainer` plugin, which is enabled by default. By modifying the configuration of the` emqx_retainer` plugin, you can adjust the EMQ X Broker's retention message Location, restrict the number of retained messages and maximum payload length, and adjust the expiration time of retained messages.