|
1 | 1 | <h1 id="device-management">Device Management for Mbed OS</h1>
|
2 | 2 |
|
3 |
| -Pelion Client is an abstraction of Device Management Client, and lets Mbed OS devices use [Pelion Device Management services](https://www.pelion.com/docs/device-management/current/welcome/index.html). Pelion Client: |
| 3 | +To use Mbed OS with Pelion Device Management, please see our [Device Management Client example for Mbed OS](https://github.com/ARMmbed/mbed-os-example-pelion/blob/master/README.md). |
4 | 4 |
|
5 |
| -- Provides LwM2M Resources, which are variables that sync automatically through Device Management. Pelion Client makes it possible to expose sensors, actuators and other variables to a cloud service. |
6 |
| -- Supports firmware updates with just a few lines of code. |
7 |
| -- Runs separately from your main application; it does not take over your main loop. |
8 |
| -- Helps avoid blocking network operations in interrupt contexts, by automatically deferring actions to a separate thread. |
9 |
| -- Provides end-to-end Greentea tests for Device Management. |
| 5 | +For more details, please see: |
10 | 6 |
|
11 |
| -This guide builds on the [quick connect guide](https://os.mbed.com/guides/connect-device-to-pelion/), which creates a cloud-connected application for supported Mbed OS boards. The guide covers: |
12 |
| - |
13 |
| -- [Hardware requirements](#requirements). |
14 |
| -- [Adding the library to an application](#adding-device-management-connectivity-to-your-application). |
15 |
| -- A list of [example applications for different boards](#example-applications). |
16 |
| -- [Configuring the application and bootloader](../mbed-os-pelion/device-management-configuration.html). |
17 |
| -- [Validation and testing](../mbed-os-pelion/device-management-test.html). |
18 |
| -- [Troubleshooting](../mbed-os-pelion/device-management-test.html#troubleshooting). |
19 |
| - |
20 |
| -<span class="tips">**Tip**: To learn more about Device Management Client, see the [API documentation](https://www.pelion.com/docs/device-management/current/client-api-references/index.html) and the [tutorials](https://www.pelion.com/docs/device-management/current/connecting/device-management-client-tutorials.html).</span> |
21 |
| - |
22 |
| -## Device Management for your Mbed OS application |
23 |
| - |
24 |
| -### Requirements |
25 |
| - |
26 |
| -Not every device (microcontroller, module or board) is capable of running device management features. You can add or extend some hardware capabilities, such as connectivity, storage and TRNG. Others are impossible or inconvenient to extend (for example, RAM or flash). |
27 |
| - |
28 |
| -The minimum requirements to add device management feature to your application are: |
29 |
| - |
30 |
| -- RAM: 128 KiB or more. |
31 |
| -- Flash: 512 KiB or more. |
32 |
| -- Real Time Clock (RTC). |
33 |
| -- (Optional but recommended) True Random Number Generator (TRNG). |
34 |
| -- A storage device: SD card, SPI flash, QSPI flash or data flash. |
35 |
| -- IP connectivity: Ethernet, Wi-Fi, cellular, Mesh (6LoWPAN-ND, Wi-SUN or Thread). |
36 |
| - |
37 |
| -Additionally, we recommend the latest version of Mbed OS supports the device and any additional complementary hardware components, or that they have support for the APIs provided in the latest releases of Mbed OS. |
38 |
| - |
39 |
| -Useful references: |
40 |
| - |
41 |
| -- [Supported Mbed OS platforms](https://cloud.mbed.com/quick-start). |
42 |
| -- [Storage options](../reference/storage.html). |
43 |
| -- [Network options](../reference/networking.html). |
44 |
| - |
45 |
| -### Adding Device Management connectivity to your application |
46 |
| - |
47 |
| -1. Add Pelion Client to your Mbed OS project: |
48 |
| - |
49 |
| - <span class="notes">**Note**: the library is called `simple-mbed-cloud-client`.</span> |
50 |
| - |
51 |
| - ``` |
52 |
| - $ mbed add https://github.com/ARMmbed/simple-mbed-cloud-client |
53 |
| - ``` |
54 |
| - |
55 |
| - If you do not have an Mbed OS project to add, you can create one with `mbed new <your_application_name>` and then run `mbed add`. |
56 |
| - |
57 |
| -1. Reference the library from the `main.cpp` file, and add network and storage drivers. |
58 |
| - |
59 |
| -1. Initialize the `simple-mbed-cloud-client` library: |
60 |
| - |
61 |
| - ```cpp NOCI |
62 |
| - #include "simple-mbed-cloud-client.h" |
63 |
| - #include <Block device> |
64 |
| - #include <Filesystem> |
65 |
| - #include <Network> |
66 |
| - |
67 |
| - int main() { |
68 |
| - |
69 |
| - /* Initialize connectivity */ |
70 |
| - NetworkInterface *net = NetworkInterface::get_default_instance(); |
71 |
| - net->connect(); |
72 |
| - |
73 |
| - /* Initialize storage */ |
74 |
| - BlockDevice *bd = BlockDevice::get_default_instance(); |
75 |
| - <Filesystem> fs("fs", &bd); |
76 |
| - |
77 |
| - /* Initialize SimpleMbedCloudClient */ |
78 |
| - SimpleMbedCloudClient client(net, &bd, &fs); |
79 |
| - client.init(); |
80 |
| - |
81 |
| - /* Create resource */ |
82 |
| - MbedCloudClientResource *variable; |
83 |
| - variable = client.create_resource("3201/0/5853", "variable"); |
84 |
| - variable->set_value("assign new value"); |
85 |
| - variable->methods(M2MMethod::GET | M2MMethod::PUT); |
86 |
| - |
87 |
| - } |
88 |
| - ``` |
89 |
| - |
90 |
| -1. Configure the API key for your Device Management account by specifying the API key as the global `mbed` configuration: |
91 |
| - |
92 |
| - ``` |
93 |
| - $ mbed config -G CLOUD_SDK_API_KEY <your-api-key> |
94 |
| - ``` |
95 |
| -
|
96 |
| - <span class="tips">**Tip**: If you don't have an API key available, log in to [Device Management Portal](https://portal.mbedcloud.com/), navigate to `Access Management` and `API keys`, and create a new one.</span> |
97 |
| -
|
98 |
| -1. Install the Device Management certificate: |
99 |
| -
|
100 |
| - ``` |
101 |
| - $ mbed dm init -d "<your company name.com>" --model-name "<product model identifier>" |
102 |
| - ``` |
103 |
| -
|
104 |
| -This creates your private and public key pair and also initializes various `.c` files with these credentials, so you can use Connect and (firmware) Update device management features. |
105 |
| -
|
106 |
| -### Example applications |
107 |
| -
|
108 |
| -To help you start quickly, refer to the [application example](https://github.com/ARMmbed/pelion-ready-example). It demonstrates how to connect to the Device Management service, register Resources and get ready to receive a firmware update. |
109 |
| -
|
110 |
| -There are also several board-specific applications that focus on providing more elaborate hardware features with Mbed OS and Device Management. These are available in the [Device Management quick start](https://cloud.mbed.com/quick-start). See the reference table, organized by vendor name, for details: |
111 |
| -
|
112 |
| -Platform | Connectivity | Storage | Example URL |
113 |
| -----------------------------------| -------------------| --------- | -------------------- |
114 |
| -Nuvoton NuMaker IOT-M487 | Wi-Fi | SD card | https://os.mbed.com/teams/Nuvoton/code/pelion-example-common/ |
115 |
| -Nuvoton NuMaker PFM-M487 | Ethernet | SD card | https://os.mbed.com/teams/Nuvoton/code/pelion-example-common/ |
116 |
| -Nuvoton NuMaker PFM-NUC472 | Ethernet | SD card | https://os.mbed.com/teams/Nuvoton/code/pelion-example-common/ |
117 |
| -NXP FRDM-K64F | Ethernet | SD card | https://os.mbed.com/teams/NXP/code/mbed-cloud-connect-example-ethernet |
118 |
| -NXP FRDM-K66F | Ethernet | SD card | https://os.mbed.com/teams/NXP/code/mbed-cloud-connect-example-ethernet |
119 |
| -Renesas GR-LYCHEE | Wi-Fi | SD card | https://os.mbed.com/teams/Renesas/code/pelion-example-common/ |
120 |
| -Renesas GR-PEACH | Ethernet | SD card | https://os.mbed.com/teams/Renesas/code/pelion-example-common/ |
121 |
| -RHOMBIO_L476DMW1K | Wi-Fi | QSPI | https://os.mbed.com/teams/Rhombio/code/pelion-example-rhombio-l476dmw1k/ |
122 |
| -Seeed WIO 3G | Cellular 3G | SD card | https://os.mbed.com/teams/Seeed/code/pelion-example-common/ |
123 |
| -Sigma Delta Technologies SDT64B | Ethernet | SD card | https://os.mbed.com/teams/Sigma-Delta-Technologies/code/pelion-example-common |
124 |
| -ST DISCO-L475E_IOT01A | Wi-Fi | QSPI | https://os.mbed.com/teams/ST/code/pelion-example-disco-iot01/ |
125 |
| -ST DISCO-F413H | Wi-Fi | QSPI | https://os.mbed.com/teams/ST/code/pelion-example-common/ |
126 |
| -ST DISCO-F746NG | Ethernet | QSPI | https://os.mbed.com/teams/ST/code/pelion-example-common/ |
127 |
| -ST NUCLEO-F429ZI | Ethernet | SD card | https://os.mbed.com/teams/ST/code/pelion-example-common/ |
128 |
| -ST NUCLEO-F767ZI | Ethernet | SD card | https://os.mbed.com/teams/ST/code/pelion-example-common/ |
129 |
| -ST NUCLEO_F746ZG | Ethernet | SD card | https://os.mbed.com/teams/ST/code/pelion-example-common/ |
130 |
| -ST NUCLEO-F207ZG | Ethernet | SD card | https://os.mbed.com/teams/ST/code/pelion-example-common/ |
131 |
| -Silicon Labs Thunderboard Sense 2 | 15.4 | SPI | https://os.mbed.com/teams/SiliconLabs/code/pelion-example-tbsense2/ |
132 |
| -Silicon Labs EFM32 Giant Gecko 11 | Ethernet | QSPI | https://os.mbed.com/teams/SiliconLabs/code/pelion-example-common/ |
133 |
| -u-blox EVK-ODIN-W2 | Wi-Fi | SD card | https://os.mbed.com/teams/ublox/code/pelion-example-common/ |
134 |
| -u-blox C030-U201 | Cellular | SD card | https://os.mbed.com/teams/ublox/code/pelion-example-common/ |
| 7 | +- The example's [developer guide](https://www.pelion.com/docs/device-management/latest/connecting/tutorial-pelion-mbedos.html). |
| 8 | +- The example's [porting guide](https://www.pelion.com/docs/device-management/latest/porting/index.html). |
0 commit comments