tencent cloud

Feedback

Device Connection Preparations

Last updated: 2021-09-08 12:23:10

    Overview

    Before connecting a device to IoT Hub, you need to create a virtual product and device in the IoT Hub console and match them with the real device. IoT Hub will assign each device a unique authentication identifier for connection. This document describes how to make preparations for connection to the platform.

    Directions

    Creating product

    1. Log in to the IoT Hub console and click Products on the left sidebar.
    2. On the product list page, click Create Product and enter the following information as needed.
      • Region: it is Guangzhou by default.
      • Product Type:
        • General: it communicates over 2G/3G/4G/Wi-Fi or wired connection. You can further develop its communication module for creation.
        • Gateway: it is used to proxy communication between subdevices and the backend.
      • Product Name: it can contain 1–32 letters, digits, and underscores and can be modified.
      • Authentication Method:
        • Certificate: when you create a device, the platform will generate a certificate and a private key for authentication before the device can communicate with IoT Hub.
        • Key: when creating a device, you can use a custom PSK or the random PSK generated by the platform for the device.
        • TID: when creating a device, you can purchase the IoT TID authentication service to authenticate the device.
      • Data Format:
        • JSON: you can match the rules and extract the content based on the data.
        • Custom: no data parsing is performed.
      • Product Description: it can contain up to 500 characters.
    3. Click Confirm (a product is a collection of devices of a certain type. You can manage all devices through the product).
    4. After the product is created, you can enable dynamic registration to generate a product key (ProductSecret).
      Note:

      Unified product information can be burned for all devices under it in the production process, i.e., product ID (ProductId) and product key (ProductSecret). After the devices are shipped, the device identity information can be obtained through dynamic registration and then saved, and then obtained three or four pieces of information can be used for device authentication. If you enable dynamic registration and select automatic device creation, device names can be generated automatically, which are generally IMEIs or MAC addresses but must be unique under the same product ID (ProductId). For more information on the dynamic registration feature, please see SDK for C Connection Description.

    Deleting product

    1. After a product is created, you can view its basic information on the Product Settings page.
    2. When you no longer need the product, you can click Delete on the right of the Products page.

    Creating device

    After creating a product, you can add one device or batch add devices under it:

    Adding one device

    1. Click the Devices tab of the corresponding product.
    2. Click Add Device and enter the relevant device information.
      • Device Name: it can contain up to 48 letters, digits, underscores, and hyphens.
      • Remarks: it can contain up to 16 letters, digits, underscores, and hyphens.
    Note:

    • The device name cannot be modified once confirmed.
    • The device name must be unique under the same product.
    • The key option appears only when the authentication method is key authentication. A custom key must be a Base64-encoded string. You can enter an ordinary string in the input box and then click Convert to Base64 to Base64-encode it.
    • Specific parameters that need to be entered during device creation vary by product type.

    If the selected authentication method is certificate authentication, after the device is created, the device private key will be the unique identifier used by it to connect to the IoT Hub backend, which does not store the device private key. Therefore, please keep it secure and confidential.

    If the selected authentication method is IoT TID authentication, you can configure an allowlist to specify whether to support device precreation.

    Note:

    After allowlist authentication is enabled, the device must carry the DeviceName in the precreation allowlist for IoT TID authentication; otherwise, the authentication will fail. If the allowlist is not enabled, the platform will automatically create a device according to the DeviceName carried for device authentication but will not create the device again if it has already been created. Allowlist authentication is disabled by default.

    Batch adding

    1. Click Batch Add on the Devices tab.
    2. There are two batch adding methods: Auto-generate and Upload.
      • Auto-generate: set the desired number of devices, and the console will generate the same number of devices. In this case, a device name is a combination of 18 uppercase and lowercase letters and digits.
      • Upload: upload a CSV file of device names, and IoT Hub will create devices according to the device names in the CSV file.
    3. After the devices are added successfully, you can view the execution status on the Result page and download the device certificate/key file. You can also view and download the corresponding information and file in Batch Management.
    Note:

    • If the selected authentication method is key authentication, the file available on the Result and Batch Management pages for download is a CSV file, which contains the device names, device keys, error codes, and error messages.
    • If the selected authentication method is certificate authentication, the file available on the Result and Batch Management pages for download is a ZIP package file, which contains folders of the same number as that of devices as well as a CSV file. The name of each folder is the corresponding device name, and the content of the folder is the certificate and private key files. The CSV file contains the device names, error codes, error messages, and the relative paths of the device certificate and private key files.

    Device details

    Certificate-authenticated device
    Device details include all the content of the device: device name, device remarks, connection status, version information, device certificate (click to download), device private key (click to download), device log configuration, etc.

    Key-authenticated device
    Device details include all the content of the device: device name, device remarks, connection status, version information, device key (click to view), device log configuration, etc.

    IoT TID-authenticated device
    Device details include all the content of the device: device name, device remarks, connection status, version information, device log configuration, etc.

    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support