To connect a device to IoT Platform, you must create a product, add a device to the product, and then obtain the device certificate in the IoT Platform console. The certificate information includes the ProductKey, DeviceName, and DeviceSecret.
Prerequisites
An Enterprise Edition instance is purchased. For more information, see Purchase an Enterprise Edition instance.
Background information
A product is a collection of devices with the same features. You can manage the devices of a product in batches. For more information, see Define TSL models and Custom topics.
Each physical device must correspond to an IoT Platform device. You must burn a device certificate (ProductKey, DeviceName, and DeviceSecret) that is issued by IoT Platform to a device. When you connect the device to IoT Platform, you can then use the certificate to authenticate the device. For more information, see Obtain device certificates.
This topic describes how to create a product, define a Thing Specification Language (TSL) model, add a device, and obtain a device certificate for a home thermostat in the IoT Platform console.
Procedure
On the Overview tab in the IoT Platform console, click IoT_Test_Environment.
In the left-side navigation pane, choose . On the page that appears, click Create Product.
On the Create Product page, configure the parameters and click OK.
In this example, the Product Name parameter is set to Home_Thermostat and the default values are used for other parameters, as shown in the following figure.
On the page that appears after the product is created, click Create TSL.
IoT Platform allows you to define a Thing Specification Language (TSL) model for a product. You can abstract product features into a data model that consists of properties, services, and events. This facilitates cloud management and data interaction.
On the Define Feature tab, click Edit Draft. Perform the following steps to define the temperature and humidity properties for the home thermostat:
In the Default Module section, click Add Self-defined Feature and then define the temperature and humidity properties.
Choose Define Feature > Edit Draft. In the lower left corner of the page that appears, click Release online. The Release model online? dialog box appears.
Select Make sure that you have verified the differences between the current version and the online version.
Click OK to publish the TSL model.
On the Product Details page, click Manage.
On the Devices tab, click Add Device. In the dialog box that appears, enter a DeviceName such as Device1 and click OK.
In the The devices have been added. dialog box, click Copy Device Certificate to obtain the device certificate.
You can also click Learn More. On the Device Details page, click View next to DeviceSecret to obtain the device certificate.
A device certificate consists of a ProductKey, a DeviceName, and a DeviceSecret. A device certificate is the credential that a device uses to communicate with IoT Platform.
ImportantWe recommend that you copy the information of your device certificate and keep the information in a secure location. The device certificate is required when you connect the device to IoT Platform.
Parameter
Description
ProductKey
The ProductKey of the product to which the device belongs. The ProductKey is the GUID that is issued by IoT Platform to the product.
DeviceName
The DeviceName of the device, which is the unique identifier of the device within the product. A combination of the DeviceName and ProductKey is used as the device identifier. IoT Platform authenticates the device and communicates with the device based on the device identifier.
DeviceSecret
The DeviceSecret of the device, which is issued by IoT Platform for device authentication and encryption. The DeviceSecret must be used in combination with the DeviceName.