Provision Sidewalk devices in bulk - AWS IoT Wireless

Provision Sidewalk devices in bulk

This section shows how you can provision Sidewalk devices in bulk to AWS IoT Core for Amazon Sidewalk using the AWS IoT console and the AWS CLI.

Provision Sidewalk devices in bulk (console)

To add your Sidewalk device using the AWS IoT console, go to the Sidewalk tab of the Devices hub, choose Bulk provision devices, and then perform the following steps.

Use the AWS IoT console to bulk provision Sidewalk devices.
  1. Choose import method

    Specify how you want to import the devices to be onboarded in bulk to AWS IoT Core for Amazon Sidewalk.

    • To provision individual devices using their SMSN, choose Provision individual factory supported device.

    • To provision devices in bulk by providing a CSV file that contains a list of devices and their SMS, choose Use S3 bucket.

  2. Specify devices to be onboarded

    Depending on the method that you chose to onboard your devices, add the device information and their serial numbers.

    1. If you chose Provision individual factory supported device, specify the following information:

      1. A Name for each device to be onboarded. The name must be unique in your AWS account and AWS Region.

      2. Their Sidewalk manufacturing serial number (SMSN) in the Enter SMSN field.

      3. A Destination that describes the IoT rule to route messages from the device to other AWS services.

    2. If you chose Use S3 bucket:

      1. Provide the S3 Bucket destination information, which consists of the S3 URL information. To provide your CSV file, choose Browse S3, and then choose the CSV file you want to use.

        AWS IoT Core for Amazon Sidewalk automatically populates the S3 URL, which is the path to your CSV file in the S3 bucket. The format of the path is s3://bucket_name/file_name. To view the file in the Amazon Simple Storage Service console, choose View.

      2. Provide the S3 Provisioning role, which allows AWS IoT Core for Amazon Sidewalk to access the CSV file in the S3 bucket on your behalf. You can either create a new service role or choose an existing role.

        To create a new role, you can either provide a Role name or leave it blank to generate a random name automatically.

      3. Provide a Destination that describes the IoT rule to route messages from the device to other AWS servicess.

  3. Start import task

    Provide any optional tags as name-value pairs and choose Submit to start your wireless device import task.

Provision Sidewalk devices in bulk (CLI)

To onboard your Sidewalk devices to your account for AWS IoT Core for Amazon Sidewalk, use any of the following API operations depending on whether you want to add devices individually or by providing the CSV file contained in an S3 bucket.

  • Upload devices in bulk using an S3 CSV file

    To upload devices in bulk by providing the CSV file in an S3 bucket, use the StartWirelessDeviceImportTask API operation, or the start-wireless-device-import-task AWS CLI command. When creating the task, specify the path to the CSV file in the Amazon S3 bucket and the IAM role that grants AWS IoT Core for Amazon Sidewalk permissions to access the CSV file.

    Once the task starts to run, AWS IoT Core for Amazon Sidewalk will start reading the CSV file and compare the serial numbers (SMSN) in the file with the corresponding information in the control log received from Amazon Sidewalk. When the serial numbers match, it will start creating wireless device records corresponding to these serial numbers.

    The following command shows an example of creating an import task:

    aws iotwireless start-wireless-device-import-task \ --cli-input-json "file://task.json"

    The following shows the contents of the file task.json.

    Contents of task.json

    { "DestinationName": "Sidewalk_Destination", "Sidewalk": { "DeviceCreationFile": "s3://import_task_bucket/import_file1", "Role": "arn:aws:iam::123456789012:role/service-role/ACF1zBEI" } }

    Running this command returns an ID and ARN for the import task.

    { "Arn": "arn:aws:iotwireless:us-east-1:123456789012:ImportTask/a1b234c5-67ef-21a2-a1b2-3cd4e5f6789a" "Id": "a1b234c5-67ef-21a2-a1b2-3cd4e5f6789a" }
  • Provision devices individually using their SMSN

    To provision devices individually using their SMSN, use the StartSingleWirelessDeviceImportTask API operation, or the start-single-wireless-device-import-task AWS CLI command. When creating the task, specify the Sidewalk destination and the serial number of the device that you want to onboard.

    When the serial number matches the corresponding information in the control log received from Amazon Sidewalk, the task will run and create the wireless device record.

    The following command shows an example of creating an import task:

    aws iotwireless start-single-wireless-device-import-task \ --destination-name sidewalk_destination \ --sidewalk '{"SidewalkManufacturingSn": "82B83C8B35E856F43CE9C3D59B418CC96B996071016DB1C3BE5901F0F3071A4A"}'

    Running this command returns an ID and ARN for the import task.

    { "Arn": "arn:aws:iotwireless:us-east-1:123456789012:ImportTask/e2a5995e-743b-41f2-a1e4-3ca6a5c5249f" "Id": "e2a5995e-743b-41f2-a1e4-3ca6a5c5249f" }

Update or delete import tasks

If you want to add additional devices to an import task, you can update the task. You can also delete a task if you no longer require the task or if it failed. For information about when to update or delete a task, see How to use Sidewalk bulk provisioning.

Warning

Deletion actions are permanent and can't be undone. Deleting an import task that has already completed successfully will not remove the end devices that have already been onboarded using the task.

To update or delete import tasks:

  • Using the AWS IoT console

    The following steps explain how to update or delete your import tasks using the AWS IoT console.

    To update an import task:
    1. Go to the Sidewalk devices hub of the AWS IoT console.

    2. Choose the import task that you want to update and then choose Edit.

    3. Provide another S3 file that contains the serial numbers of devices that you want to add to the task and then choose Submit.

    To delete an import task:
    1. Go to the Sidewalk devices hub of the AWS IoT console.

    2. Choose the task that you want to delete and then choose Delete.

  • Using the AWS IoT Wireless API or AWS CLI

    Use the following AWS IoT Wireless API operations or CLI commands to update or delete your import task.