Mistake on this page? Email us

Connect your device to Device Management Portal

Device Management expects devices to have a certificate proving their right to connect to your Device Management account. In this section you set up the certificates and credentials needed for you device to connect to Device Management Portal.

This involves uploading your certificate authority (CA) certificate to Device Management Portal and configuring the Device Management client running on your device to connect to Device Management Portal. Finally, you will verify your device's connection using the device's terminal and Device Management Portal.

In this tutorial FCU is acting as the CA and, you use an example Device Management client provided by us.

In this section

  1. Upload your CA certificate to Device Management Portal.
  2. Deploy the Device Management Client example on your computer.
  3. Configure the Device Management Client example to connect to Device Management Portal.
  4. Build the Device Management Client example on your computer.
  5. Flash the Device Management Client example binary from your computer to your device.
  6. Verify your device's connection using the device's terminal.
  7. Verify your device's connection using Device Management Portal.

1. Upload factory CA certificate to Device Management Portal

For more information, see the Managing trusted certificates in Device Management section.

  1. Log in to Device Management Portal for your region:

  2. Select Device identity > Certificates.

  3. Click New certificate and select Upload a certificate.

  4. Populate the Name and Description fields.

  5. Click Choose File and select factory_configurator_utility/keystore/fcu.crt

  6. From the How will devices use this certificate? dropdown, select:

    • Credentials or Factory configurator utility - I can prove ownership of these credentials.
  7. From the Which service will these devices use? dropdown, select:

    • Bootstrap.
  8. Click Upload certificate.

2. Deploy the Device Management Client example

In this tutorial you use the Device Management Client example to connect your device to your Device Management account.

Clone the application's GitHub repository to your local computer and go to the new folder:

mbed import https://github.com/PelionIoT/mbed-cloud-client-example
cd mbed-cloud-client-example

3. Configure the Device Management Client example

  1. Disable developer mode feature:

    In the mbed_app.json file, change the value of developer-mode from 1 to null.

  2. Change the build format output to .hex:

    In the mbed_app.json file, under "*" section, add "target.OUTPUT_EXT" : "hex".

4. Build the Device Management Client example

On your computer, run:

mbed toolchain <toolchain>
mbed config <toolchain path> <path to the toolchain binaries>
mbed target <target>
mbed compile

Where:

  • <toolchain> may be GCC_ARMor ARM.
  • <toolchain path> may be GCC_ARM_PATH or ARM_PATH. Needed only if toolchain binaries are not in path.
  • <target> is your device target name, for example, K64F.

5. Flash the binary to your device

  1. Connect your device to your computer using USB. Your computer lists your device as a mass storage device.
  2. To flash the binary to your device, copy BUILD/<target>/<toolchain>/mbed-cloud-client-example-example.hex from your computer to your device.
  3. To indicate the flash is in progress, your device's LED will blink rapidly. Once the LED stops blinking, the flash is complete.

6. Verify your connection using the device's terminal

When the client has successfully connected, the device's serial terminal displays:

Client registered
Endpoint Name: <Endpoint name>
Device ID: <Device ID>

Where:

7. Verify your connection using Device Management Portal

To verify the connection with Device Management Portal:

  1. Log in to Device Management Portal for your region:

  2. Select Device directory from the menu on the left.

  3. When the Devices page lists your device, the device is connected and available.

Your device is now connected and ready for the firmware update.