A product indicates a set of devices that have the same features. After you create a product, you must create devices for the product and obtain the device certificates. You can create one or more devices at a time.This topic describes how to create multiple devices at a time.
Procedure
- Log on to the IoT Platform console.
- On the Overview page, select an environment, find the instance that you want to manage, and click the instance ID or instance name. Important This step is required only if Enterprise Edition instances are available. If the Enterprise Edition instances are unavailable in the region that you selected, skip this step. For information about supported regions and instances, see Overview.
- In the left-side navigation pane, choose .
- On the Devices page, click Batch Add.
- Select a product. Each new device derives the features and properties of the product. Important If a product is associated with other platforms, make sure that your account has a sufficient quota of activated devices.
- Select a method to specify DeviceNames.
- Auto Generate: You do not need to specify DeviceNames for devices. After you specify the number of devices, IoT Platform generates a DeviceName for each device. Each DeviceName consists of random letters and digits.
- Batch Upload: You must specify a DeviceName for each device. Click Download.csv Template to download a template, specify DeviceNames and aliases in the template, and then upload the template to the IoT Platform console. Important
- The first row cannot be modified. You must enter information from Cell A2.
- Each DeviceName must be 4 to 32 characters in length and can contain letters, digits, hyphens (-), underscores (_), at signs (@), periods (.),and colons (:).Each DeviceName must be unique within the product.
- The Nickname parameter specifies an alias. This parameter is optional.The name must be 4 to 64 characters in length, and can contain letters, digits, and underscores (_).
- Each template file can contain up to 10,000 device records. The maximum size of a template file is 2 MB.
- Click OK. If a template file contains one or more invalid DeviceNames or aliases, an error occurs. You can click Download Invalid Device Name List to download the file that contains invalid DeviceNames or aliases. Modify the invalid DeviceNames or aliases in the file based on the naming rules and then reupload the file.
- After the devices are created, click Download Device Certificate to download the certificates of the devices. You can burn the certificates on the devices.
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. We recommend that you keep your device certificates confidential.
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.
Result
The devices are created. You can view the information about the devices and download the certificates of the devices on the Batch Management tab of the Devices page.- To view the details of the devices, find the batch of the devices and click Details in the Actions column. The details include the number of devices that are created in the batch and the list of the devices. The device certificates and status are displayed in the device list.
If specific devices failed to be created in the batch, the error codes and failure causes are displayed in the device list. The following table describes the error codes.
Error code Error message Description 460 duplicated deviceName Duplicate DeviceNames exist. invalid deviceName The DeviceName is invalid. 6251 device exist The device already exists. 6760 insufficient activation code The activation code is invalid. 64003 device creation is failed Failed to create the device. 6293 device has been distributed The device is distributed. - To download the certificates of the devices, click DownloadCSV.
What to do next
You can view the device information. For more information, see View device information.
For information about how to connect a device to IoT Platform, see the following articles:
Related API operations
BatchRegisterDevice: registers multiple devices at a time.