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.
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.
After creating a product, you can add one device or batch add devices under it:
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 theDeviceName
carried for device authentication but will not create the device again if it has already been created. Allowlist authentication is disabled by default.
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.
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.
Was this page helpful?