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
- Upload your CA certificate to Device Management Portal.
- Deploy the Device Management Client example on your computer.
- Configure the Device Management Client example to connect to Device Management Portal.
- Build the Device Management Client example on your computer.
- Flash the Device Management Client example binary from your computer to your device.
- Verify your device's connection using the device's terminal.
- 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.
-
Log in to Device Management Portal for your region:
-
Select Device identity > Certificates.
-
Click New certificate and select Upload a certificate.
-
Populate the Name and Description fields.
-
Click Choose File and select
factory_configurator_utility/keystore/fcu.crt
-
From the How will devices use this certificate? dropdown, select:
- Credentials or Factory configurator utility - I can prove ownership of these credentials.
-
From the Which service will these devices use? dropdown, select:
- Bootstrap.
-
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
-
Disable developer mode feature:
In the
mbed_app.json
file, change the value ofdeveloper-mode
from1
tonull
. -
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 beGCC_ARM
orARM
.<toolchain path>
may beGCC_ARM_PATH
orARM_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
- Connect your device to your computer using USB. Your computer lists your device as a mass storage device.
- To flash the binary to your device, copy
BUILD/<target>/<toolchain>/mbed-cloud-client-example-example.hex
from your computer to your device. - 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:
<Endpoint name>
is the name you gave to your device while setting up the factory environment.<Device ID>
is a globally unique ID generated by Device Management.
7. Verify your connection using Device Management Portal
To verify the connection with Device Management Portal:
-
Log in to Device Management Portal for your region:
-
Select Device directory from the menu on the left.
-
When the Devices page lists your device, the device is connected and available.
Your device is now connected and ready for the firmware update.