A product is a collection of devices that share the same features. After creating a product, you must add devices and obtain their certificates. You can create multiple devices at a time in the IoT Platform console.
Prerequisites
A product is created. For more information, see Create a product.
Procedure
-
Log on to the IoT Platform console.
On the Overview page, find the instance that you want to manage and click the instance ID or instance name.
-
In the left-side navigation pane, choose .
-
On the Devices page, click Batch Add.
-
Select a product. The new devices inherit the features of this product.
ImportantIf the product is associated with other platforms, make sure that your account has a sufficient quota of activation codes to create devices.
Set Add Method to Auto Generate, set Device Quantity to
100, then click OK. -
Select a method to specify DeviceNames.
-
Auto Generate: Enter the number of devices. IoT Platform generates a random DeviceName that consists of letters and digits for each device.
-
Batch Upload: Specify a name for each device. Click Download .csv Template, enter the DeviceName and Nickname for each device in the template, and then upload the file to the IoT Platform console.
Important-
Do not modify the first row. Start entering data from cell A2.
-
A DeviceName must be 4 to 32 characters long and can contain letters, digits, hyphens (-), underscores (_), at signs (@), periods (.), and colons (:). A DeviceName must be unique within a product.
-
Nickname is an optional alias for the device. An alias must be 4 to 64 characters long and can contain Chinese characters, Japanese characters, letters, digits, and underscores (_). A Chinese or Japanese character counts as two characters.
-
A file can contain up to 10,000 records and must not exceed 2 MB.
-
-
-
Click OK.
If the uploaded list contains invalid device names, an error message appears. Click Download Invalid Device Name List to view the invalid names, correct them, and upload the file again.
-
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 requires this credential to communicate with IoT Platform. Store the certificate 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.
Result
After the devices are created, go to the Batch Management tab on the Devices page. Find the corresponding product and click one of the following:
-
Details: View the Number of Added Devices and the device list for the batch. The list includes information such as device certificates and status.
If some devices failed to be created, the error codes and causes are displayed in the device list. The following table describes the error codes.
Error code
Message
Description
460
duplicated deviceName
The device name is duplicated.
invalid deviceName
The device name is invalid.
6251
device exist
The device already exists.
6760
insufficient activation code
You do not have enough activation codes.
64003
device creation failed
The device was not created due to concurrent operations.
6293
device has been distributed
The device has been distributed.
-
DownloadCSV: Download the certificates of the devices in this batch.
What to do next
You can view the device information. For more information, see View device information.
After you create a device, the device is in the Inactive state. To activate the device, you must use a device SDK to connect the device to IoT Platform. For more information, see Use a device SDK to connect a device to IoT Platform.
For more information about how to connect a device to IoT Platform, see the following topics:
Related API operations
BatchRegisterDevice: Registers multiple devices at a time.