Using Pelion with the nRF Connect SDK¶
Pelion is an IoT cloud platform that offers services in the fields of connectivity, device management, and edge computing.
It allows you to remotely manage and update your IoT devices.
The nRF Connect SDK provides Pelion’s
mbed-cloud-client library (the Pelion Device Management library) as one of the external submodule repositories managed with West (Zephyr’s meta-tool).
This library is fetched into the
ncs/modules/lib/pelion-dm directory of the nRF Connect SDK.
Enabling the library allows you to connect your devices to Pelion Device Management and exchange data with it using either LTE or OpenThread.
An example of an application that is using the Pelion Device Management library in the nRF Connect SDK is the nRF Pelion Client.
For the library to work with your device, complete the following configuration steps:
Provision the device with credentials, required for the connection to Pelion Device Management Portal.
Provision the device with update resources for the firmware update procedure to work.
Create a dedicated partition on flash for the Pelion Device Management library
Configure dynamic allocation memory with sufficient space for heap.
See the following sections for details.
To use the Pelion Device Management library, you need a developer account on Pelion Device Management Portal.
The Pelion manifest tool simplifies the creation of update resources and manifests. You can also use them to run update campaigns directly from command line.
To download and install the tool, see Installing the manifest tool in the Pelion repository.
The Pelion Device Management library depends on a properly configured Mbed TLS library. To simplify the development within the nRF Connect SDK, you can use a predefined set of Mbed TLS configuration options.
Make sure to properly configure the memory region used by Mbed TLS library for dynamic allocations.
Memory for this library is allocated from either the libc heap or a dedicated buffer, depending on the configuration.
For more information about using the dedicated buffer for Mbed TLS heap, see help for the
CONFIG_MBEDTLS_HEAP_SIZE Kconfig options.
CONFIG_MBEDTLS_ENABLE_HEAP is disabled and Mbed TLS configuration files do not add any overrides, the libc heap is used.
You must provision the device before it can connect to Pelion Device Management Portal.
When using Pelion, you can complete the provisioning process using either a production tool (Factory Configurator Utility for factory provisioning) or the developer flow process. For more information about the provisioning process, see Provisioning devices for Pelion Device Management in the Pelion documentation.
For details about provisioning the device with update resources, see the Device Management Update guide in the Pelion documentation. You can also use the Pelion manifest tool to run the update process during development stage. See Using the manifest tool in the Pelion repository for details.
Zephyr’s port of Pelion might not support the most recent update client features. The Device Management Update link points to the documentation of the version compatible with the nRF Connect SDK. For details, refer to the Pelion Device Management documentation and Pelion Device Management release notes.
The Pelion Device Management library requires a partition named
pelion_storage to be defined on flash.
The partition is used to store the non-volatile data, such as credentials and identifiers.
Because this kind of data is sensitive, keep the partition on the SoC internal flash or make sure to secure the access to the memory.
The Pelion Device Management library depends on the new C standard library (newlib). In case of targets without the memory management unit (MMU), given that the application is not running in the Userspace, the portion of RAM that remains unallocated for any other purpose is used by the libc heap. Make sure to leave enough space for the heap, so that the Pelion Device Management library works correctly.
For more information about the new C standard library, see Zephyr’s C standard library.
The Pelion Device Management library uses standard POSIX sockets for the network communication. The library was tested with the following network backends:
Cellular (LTE, NB-IoT)
After initializing and setting up the Pelion object instance, it continuously retries to connect to Pelion’s Device Management server.
The cellular backend uses of the on-board modem that is part of the nRF9160 SiP. For more information about working with the modem, see the Working with nRF9160 DK documentation.
To simplify the connection setup, you can use the LTE link controller.
Thread is a low-power mesh networking technology. It allows a device to access the Internet if one of the mesh elements (boarder router) share the Internet connection.
To enable the Pelion Device Management library in the nRF Connect SDK, use the
CONFIG_PELION_CLIENT Kconfig option.
You can control the Pelion Device Management library features using Kconfig options that are defined within the Pelion Device Management library repository. The following options are among the most important ones:
CONFIG_PELION_UPDATE- This option enables the device firmware update (DFU) feature.
To see all options, check the Pelion Device Management library subtree in configuration system (menuconfig) or read the Zephyr integration tutorial in the Pelion documentation.