Create a product and a device

更新时间:
复制 MD 格式

Before you connect a device to IoT Platform, you must create a product and a device for it in the IoT Platform console to obtain a device certificate. A device certificate includes a ProductKey, DeviceName, and DeviceSecret.

Background information

  • A product is a collection of devices that share the same features. You can manage devices by product, for example, to define a TSL model or customize topics.

  • Each physical device must have a device identity on IoT Platform. You must provision the physical device with the device certificate (ProductKey, DeviceName, and DeviceSecret) issued by IoT Platform. The certificate authenticates the device when it connects to the platform. For more information, see Obtain a device certificate.

This topic describes how to create a product and a device for a street lamp on IoT Platform and obtain its device certificate.

Procedure

  1. Log on to the IoT Platform console.

  2. In the upper-left corner of the console, select the region for your instance.

  3. On the Overview tab, click Public Instance.

  4. In the left-side navigation pane, choose Devices > Products. On the page that appears, click Create Product.

  5. On the Create Product page, configure the parameters and click OK.

    In this example, the Product Name is Streetlight, the Product Category is Custom Category, and other parameters use their default values, as shown below. In this example, Product Name is set to Streetlight, Product Category is set to Custom Category, Node Type is set to Directly Connected Device, Connectivity Method is set to Wi-Fi, Data Format is set to ICA standard data format (Alink JSON), Data Validation Level is set to Weak Validation, and Authentication Method is set to Device Secret.

  6. On the Create Product page, click Proceed to Add.

  7. On the Device List tab, click Add Device. Enter device1 for DeviceName and Device 1 for Alias, and then click OK.

    For more information, see Create a single device.

    After the device is created, the Added dialog box appears. Click Copy Device Certificate.

    Alternatively, click View to open the Device Details page. On this page, click View next to DeviceSecret.

    A device certificate contains the ProductKey, DeviceName, and DeviceSecret. The device uses this credential to communicate with IoT Platform.

    Important

    The device certificate is required to connect your device to IoT Platform. Copy the certificate information and store it securely.

    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.

Next steps

Define a TSL model for a product.