Skip to content

Latest commit

 

History

History
100 lines (67 loc) · 4.93 KB

running_aws_iot_core_device_advisor_tests.md

File metadata and controls

100 lines (67 loc) · 4.93 KB

Running AWS IoT Core Device Advisor tests

Device Advisor is a cloud-based, fully managed test capability for validating IoT devices during device software development. Follow the link to learn more about the device advisor.

Creating an IoT thing

Follow the instructions described in the section listed below to create an IoT thing for your device.

Creating roles and policies

Follow the instructions described in the page to create a policy for your IoT thing and then a device advisor role.

  • Create an IAM role to use as your device role.
    • As part of creating the policy, the topic and topic filter shall be assigned a value * and the clientId should match the IoT thing name.
  • Create a custom-managed policy for an IAM user to use Device Advisor
  • Create an IAM user to use Device Advisor (AWS recommendation)

Creating AWS IoT Core Qualification test suite

Follow the instructions described the page to create AWS IoT Core Qualification test suite.

The Trigger Topic property should be set to the value of deviceAdvisorTOPIC_FORMAT macro available at aws_device_advisor_task.h for TLS Receive Maximum Size Fragments test.

Configuring the application to connect to AWS IoT Core Device Advisor

Now that you have created an AWS Thing and attached the certificates and policies to it, the representative values must be added to your application to ensure connectivity with AWS IoT Core Device Advisor.

Set the macro appCONFIG_DEVICE_ADVISOR_TEST_ACTIVE in applications/<application_name>/configs/app_config/app_config.h to 1.

Within the application directory that you are using, edit the applications/<application_name>/configs/aws_configs/aws_clientcredential.h file and set values for specified user defines called out below.

clientcredentialMQTT_BROKER_ENDPOINT

  • Set this to the device advisor endpoint. You can get the device advisor end point either via AWS CLI or AWS IoT console:
    • AWS CLI
      • To get the device advisor end point via AWS CLI, run:
        aws iotdeviceadvisor get-endpoint
    • AWS IoT console
      • To get the device advisor end point via AWS IoT console, follow the instructions in the page. The device advisor end point is shown at the step 12.

clientcredentialIOT_THING_NAME

  • Set this to the name of the thing you set (e.g. MyThing).

Save and close the file.

Building the application

To build the application, run the following command:

./tools/scripts/build.sh ${APPLICATION_NAME} --certificate_path <certificate pem's path> --private_key_path <private key pem's path> --target <corstone300/corstone310/corstone315> --toolchain GNU
  • The certificate pem's path and private key pem's path should be the downloaded key's and certificate's paths during the Thing creation.

Or, run the command below to perform a clean build:

./tools/scripts/build.sh ${APPLICATION_NAME} --certificate_path <certificate pem's path> --private_key_path <private key pem's path> --target <corstone300/corstone310/corstone315> --toolchain GNU -c

Running the application

We need to start the device advisor tests before running the application. If not then, device advisor rejects the connection requests from the application.

Follow the instructions described in the page to start the previously created AWS IoT Core Qualification test suite.

Now run the application by running the following command:

./tools/scripts/run.sh ${APPLICATION_NAME} --target <corstone300/corstone310/corstone315>

Once the device advisor has completed all the tests, you can download the AWS IoT Core Qualification report by following the instructions in the page.

Note

AWS IoT Core Device Advisor Tests are supported on keyword-detection application using Arm GNU Toolchain (arm-none-eabi-gcc) only.