If you want to use a JT/T 808 cloud gateway to connect a device to IoT Platform, you must add a cloud gateway in the IoT Platform console. This topic describes how to create a JT/T 808 cloud gateway.
Prerequisites
An Exclusive Enterprise Edition instance is purchased. For information about how to purchase an instance, see Purchase Enterprise Edition instances.
Background information
For information about how to use a JT/T 808 cloud gateway to connect a device to IoT Platform, see JT/T 808 gateways.
Add a cloud gateway
Log on to the IoT Platform console.
On the Overview tab, click the Exclusive Enterprise Edition instance that you want to manage.
In the left-side navigation pane, choose . On the page that appears, click Add Gateway.
Configure the parameters based on the on-screen instructions and click Next. The following table describes the parameters.
Parameter
Description
Gateway Name
The name of the gateway. The name must be unique in the instance. The name must be 4 to 30 characters in length and can contain letters, digits, and underscores (_).
Protocol
Select JT/T 808.
Custom Port Number
Valid values: 1024 to 65535. Default value: 7999.
Authentication Type
One-party verification
If you select this option, you must import the verification information of a device to IoT Platform. The verification information includes the Manufacturer ID, Terminal Model, and Terminal ID of the device. IoT Platform verifies the device based on the verification information.
Third-party Certification
Alibaba Cloud Function Compute: If you select this option, you must configure the Device-verified FC Service, Device-verified FC Function, and Authorize parameters. You can select an existing Function Compute function or create a new function for device verification. The input and output parameters of the function that you create must meet specific requirements. You can specify a custom function name. For information about the requirements on the input and output parameters of the device verification function, see Table 1 Device registration parameters, Table 2 Device verification parameters, and Table 3 Device deregistration parameters.
Click Create Service to go to the Function Compute console and create a service. For information about Function Compute services, see Manage services.
Click Create Function to go to the Function Compute console and create a function. For information about Function Compute functions, see Manage functions.
If the
AliyunIOTAccessingFCRole
role is not available, click Create RAM Role to go to the RAM console and create the role. For information about how to create a RAM role and grant permissions to the role, see Create a RAM role.
Transmission Protocol
TCP
If you use Transmission Control Protocol (TCP) to connect a device, we recommend that you do not connect the device over the Internet. To ensure security, establish a connection over a leased line.
ImportantIf you use TCP to connect a device, you do not need to configure certificates. After you complete all configurations in the Basic Information step, click OK to create the gateway.
TLS
If you connect devices to IoT Platform over Transport Layer Security (TLS), you can enable server-side one-way verification, Online Certificate Status Protocol (OCSP) for devices, two-way secure connections between devices and servers, and other features.
Enable X.509 certificate-based device verification. Valid values of the Enable OCSP parameter:
Disabled
OCSP Verification for Server Certificate
OCSP Verification for Client Certificate
Client and Server-side OCSP Verification
Disable X.509 certificate-based device verification. Valid values of the Enable OCSP parameter:
Disabled
OCSP Verification for Server Certificate
NoteOnline Certificate Status Protocol (OCSP) is an Internet protocol that is used by a certificate authority (CA) to check the revocation status of a certificate.
When a client sends a message to a server, the server performs OCSP verification on the client certificate. If the client certificate is revoked, the server closes the connection.
The default time to live (TTL) of cached OCSP information ranges from 5 minutes to 1 hour. After the cached OCSP information expires, server-side OCSP stapling does not take effect until the OCSP information is re-obtained.
Table 1 Device registration parameters
Parameter type
Parameter name
Data type
Description
Example
Request parameters
manufacturer
String
The ID of the device manufacturer.
The ID must be 4 to 11 characters in length and can contain letters, digits, and hyphens (-).
{ "manufacturer":"mf0001", "deviceModel":"dm0001", "deviceId":"di0001", "licensePlateColour":"1", "licensePlateNumber":"ZhejiangA****", "phone":"1**********", "action":"register" }
deviceModel
String
The model of the device.
The device model must be 4 to 30 characters in length and can contain letters, digits, and hyphens (-).
deviceId
String
The ID of the device.
The ID must be 4 to 30 characters in length and can contain letters, digits, and hyphens (-).
licensePlateColour
String
The color of the license plate. The value must meet the requirements of the JT/T 808 protocol. For more information, see JT/T 808-2019.
licensePlateNumber
String
The license plate number.
phone
String
The mobile phone number.
action
String
Set the value to
register
, which specifies device registration.Response parameters
result
String
Indicates whether the registration was successful. Valid values:
true
false
Sample success response
{ "result":"true", "message":"", "authCode":"****" }
Sample failure response
{ "result":"false", "message":"4" }
message
String
The error message that is returned if the registration failed. Valid values:
1
: The vehicle is registered.2
: The vehicle is not found.3
: The device is registered.4
: The device is not found.
authCode
String
The authentication code that is returned if the registration was successful.
Table 2 Device verification parameters
Parameter type
Parameter name
Data type
Description
Example
Request parameters
phone
String
The mobile phone number.
{ "phone":"1**********", "authCode":"****", "protocol":"TCP", "action":"auth", }
authCode
String
The verification code that is returned if the registration was successful.
protocol
String
The transmission protocol.
action
String
Set the value to
auth
, which specifies device verification.Response parameters
result
String
Indicates whether the verification was successful. Valid values:
true
false
{ "result":"true", "message":"" "manufacturer":"mf0001" "deviceModel":"dm0001" "deviceId":"di0001" }
message
String
The error message that is returned if the verification failed.
manufacturer
String
The device manufacturer ID that is returned if the verification was successful.
deviceModel
String
The device model that is returned if the verification was successful.
deviceId
String
The device ID that is returned if the verification was successful.
Table 3 Device deregistration parameters
Parameter type
Parameter name
Data type
Description
Example
Request parameters
manufacturer
String
The ID of the device manufacturer.
{ "phone":"1**********", "manufacturer":"mf0001", "deviceModel":"dm0001", "deviceId":"di0001", "action":"unregister", }
deviceModel
String
The model of the device.
deviceId
String
The ID of the device.
phone
String
The mobile phone number.
action
String
Set the value to
unregister
, which specifies device deregistration.Response parameters
result
String
Indicates whether the deregistration was successful. Valid values:
true
false
{ "result":"true", "message":"" }
message
String
The error message that is returned if the deregistration failed.
Complete the Certificate Configuration step and click OK.
Configure certificates
ImportantIf you select TCP as the transmission protocol, you do not need to configure certificates.
The certificates that are configured in this step are Privacy Enhanced Mail (PEM) files.
You must configure the Server Certificate and Private Key of Server Certificate parameters.
If you enable X.509 certificate-based device verification, you must configure the Device Root Certificate parameter.
If you set the Enable OCSP parameter in the previous step to OCSP Verification for Server Certificate or Client and Server-side OCSP Verification, you must set the Trusted Certificate parameter to the server root certificate in this step.
View the information about the gateway that you created on the Gateway page, including the name, ID, gateway URL, status, and associated product.
ImportantYou must record the gateway URL. When you connect a device to IoT Platform over JT/T 808, you must replace the JT/T 808 endpoint with the gateway URL. You can specify the gateway URL as the JT/T 808 endpoint or configure a CNAME record to resolve the JT/T 808 endpoint to the gateway URL.
(Optional) Modify a cloud gateway
After you create a gateway, find the gateway on the Gateway page and click Edit in the Actions column. You can modify the name, certificate information, and Function Compute function of the gateway.
Result
After you create a cloud gateway, IoT Platform creates and associates a product with the gateway. The product name is in the Cloud gateway+${Cloud gateway ID}
format. To view the new product, choose . The new product is displayed on the Products page.
Click View in the Actions column of the product. On the product details page, you can view the details of the product, as shown in the following figure.
What to do next
The first time you use the cloud gateway whose Authentication Type parameter is set to Third-party Certification to connect a device to IoT Platform, IoT Platform automatically combines the values of the manufacturer, deviceModel, and deviceId parameters in the
${manufacturer}_${deviceModel}_${deviceId}
format as the DeviceName to create a device.After you create a cloud gateway whose Authentication Type parameter is set to One-party Verification, you must import the verification information of devices to add the devices to the related gateway product. For more information, see Add multiple devices.