Provisioning development devices
Device Management offers a developer mode to speed up the development process. The mode relies on a developer certificate, which you add to your software binary to allow test devices to connect to your Device Management account.
You can use the same certificate on up to 100 devices. To test additional devices, generate a second certificate by repeating the process detailed below. You can use up to 10 developer certificates at a time.
Note: The credentials of all test devices in a single account are identical. In production, you provision unique credentials to each device. For information about the production provisioning process, please see the Factory Provisioning documentation site.
Creating and downloading a developer certificate
To use FCC in developer mode, you need to get connection credentials from Device Management. To do this:
-
Log in to Device Management Portal for your region with your developer account:
-
Select Device identity > Certificates.
-
Click New certificate > Create a developer certificate.
-
Enter a certificate file name.
-
Click Create certificate.
Device Management creates a credentials C file called
mbed_cloud_dev_credentials.c
. This file contains the credentials you need to connect your device to Device Management. -
Select Device identity > Certificates again.
-
Click your new certificate.
-
Download the credentials file and add it to your build configuration.
Note: The downloaded developer certificate is confidential to your account. Store it securely in a place where unauthorized users cannot access or use it.
Adding the developer certificate to your application
To enable development mode in FCC and use the development certificate in your software image:
-
Initialize FCC:
#include "factory_configurator_client.h" #include "fcc_status.h" int main() { ... fcc_status_e fcc_status; fcc_status = fcc_init(); if(fcc_status != FCC_STATUS_SUCCESS) { return 1; } ... }
-
Enable development mode:
... fcc_status_e fcc_status; // Running developer flow fcc_status = fcc_developer_flow(); if(fcc_status != FCC_STATUS_SUCCESS) { return 1; } ... }
-
Verify the configuration:
fcc_status = fcc_verify_device_configured_4mbed_cloud(); if(fcc_status != FCC_STATUS_SUCCESS) { return 1; }
-
Finalize FCC (which also finalizes the KCM module):
fcc_status = fcc_finalize(); if(fcc_status != FCC_STATUS_SUCCESS) { return 1; } ... }
For detailed instructions on adding FCC to your application, see the Factory Provisioning documentation site.