nRF9160: LwM2M carrier

The LwM2M carrier sample demonstrates how to run the LwM2M carrier library in an application in order to connect to the operator LwM2M network.

Requirements

The sample supports the following development kit:

Hardware platforms

PCA

Board name

Build target

nRF9160 DK

PCA10090

nrf9160dk_nrf9160

nrf9160dk_nrf9160ns

The sample is configured to compile and run as a non-secure application on nRF91’s Cortex-M33. Therefore, it automatically includes the Secure Partition Manager that prepares the required peripherals to be available for the application.

Building and running

This sample can be found under samples/nrf9160/lwm2m_carrier in the nRF Connect SDK folder structure.

The sample is built as a non-secure firmware image for the nrf9160dk_nrf9160ns build target. Because of this, it automatically includes the Secure Partition Manager.

See Building and programming a sample application for information about how to build and program the application.

Testing

After programming the sample and all prerequisites to the board, test it by performing the following steps:

  1. Connect the USB cable and power on or reset your nRF9160 DK.

  2. Open a terminal emulator and observe that the kit prints the following information:

    LWM2M Carrier library sample.
    
  3. Observe that the application receives events from the LwM2M carrier library via the registered event handler.

Troubleshooting

Bootstrapping can take several minutes. This is expected and dependent on the availability of the LTE link. During bootstrap, several LWM2M_CARRIER_EVENT_CONNECTED and LWM2M_CARRIER_EVENT_DISCONNECTED events are printed. This is expected and is part of the bootstrapping procedure. For more information, see the LwM2M carrier library events and Message sequence charts sections in the LwM2M carrier library documentation.

To completely restart and trigger a new bootstrap, the device must be erased and re-programmed, as mentioned in Application integration.

Dependencies

This sample uses the following libraries:

From nRF Connect SDK
  • nRF Connect SDK modules abstracted via the LwM2M carrier OS abstraction layer (lwm2m_os.h)

From nrfxlib

In addition, it uses the following samples:

From nRF Connect SDK