Getting Started with LwM2M

Last modified: Nov 2, 2018 @ 15:42

This page describes the step-by-step procedure for connecting a LwM2M client to DDM.

Create a LwM2M Gateway

This section describes how to create a new Gateway of LwM2M Gateway Type in DDM.

Prerequisites

  • The Device Network must be defined in DDM.
  • A Gateway Type that supports LwM2M Gateways must be defined in DDM.
  • If the Gateway configuration is done using the DDM GUI, a Location for the Gateway must exist.

Configuration

For generic instructions on how to create a Gateway in DDM, see Register Gateway.

Note: The LwM2M Gateway name must be unique within the Azure region.

The following configuration steps are specific to creating a LwM2M Gateway:

  1. In the Gateway Type field, select the Gateway Type that supports LwM2M Gateways.
  2. Use the Send to Gateway Provisioning Manager slider button to indicate whether Provisioning Manager will be used to deploy the Gateway:
    • Enable this option if you want the Gateway to be automatically created.
    • If this option is not used, the Gateway must be manually deployed and provisioned on the Cloud service.

Selecting the Provisioning Manager to deploy the LwM2M Gateway triggers the deployment, and at the end of the process a LwM2M Gateway is up and running.

Note: The Gateway creation and hardening takes about 5 minutes, so please be patient.

The object model for the corresponding device network is automatically downloaded to the LwM2M Gateway.

Create the LwM2M Device Type

The LwM2M Device Type is a logical representation of a real LwM2M device.
This page describes the configuration needed to add a new LwM2M Device Type to DDM.

Prerequisites

  • IPSO objects must have been imported into DDM.

Configuration

For generic instructions on how to create a Device Type, see Create/Edit Device Types.

The following configuration steps are specific to creating a LwM2M Device Type.

  1. While creating the Device Type, click the Discover at Registration slider button to turn this option On or Off. The Discover operation is used to discover which Resources are instantiated in a Device.
  2. Add the Device Smart Object Type (Type ID=3, Object URN=urn:oma:lwm2m:oma:3 ) to the LwM2M Device Type. This Smart Object Type details resources on the LwM2M Device related to Device-specific information.
    Note: To add a Smart Object Type to a Device Type, see instructions in Create/Edit Smart Object Types.
  3. Add other Smart Object Types as needed, based on the physical device and its sensors.

A Smart Object Template is a configuration defining the operations to be performed on a device’s smart object every time the device registers with LWM2M server. These operations are limited to:

  • Observe Readable Resources
  • Write values to Writable Resources
  • Write values to Resource Attributes (Notification class attributes)

A Default Smart Object Template is created automatically when a Smart Object Type is created, but in case other operations are required, a new template for relevant smart objects needs to be created. To create Smart Object Templates, see instructions in Create/Edit Smart Object Templates.

When creating a Device Type in the platform, a Default Device Template is created along with it. In the Device Template for the specific device type, ensure that the correct Smart Object Templates are in use.

The Device Template is a configuration defining which Smart Object Templates a device of a certain Device Type uses.

Create Custom IPSO Objects

Custom IPSO objects are objects that are not standardized. A custom IPSO object is created by creating a Smart Object Type with the needed resources. To create a Smart Object Type, see the instructions in Create/Edit Smart Object Type.

The model information is automatically downloaded to all LwM2M gateways in the device network, without explicit action by the administrator.

Create a LwM2M Device

This section describes the configuration procedure to add a new LwM2M Device to DDM.

Prerequisites

  • If the Device will use client-initiated bootstrapping, the Bootstrap Server must exist and be running.
  • A suitable LwM2M Gateway must be defined and deployed, as described above.
  • The LwM2M Device Type must be defined, as described above.

Configuration

For generic instructions on how to create a new Device, see instructions in Register Device.

Note: The process of creating a new device in DDM is called “Register Device”.

The following configuration steps are specific to creating a LwM2M Device:

  1. In the Device Type field, select the LwM2M Device Type.
  2. In the Gateway field, select the desired LwM2M Gateway from the list.
  3. If the device supports client initiated bootstrapping, select the correct bootstrap server from the list.
    Note: Client-initiated bootstrapping requires that the bootstrap server selected for the Device in the GUI must match the bootstrap server information that is hard-coded or configured in the device.
  4. If secure client mode is required, add PSK Setting Category with identity and pre-shared key to the Device.

In the DDM dashboard, each Device has an indicator that can display the following colors:

  • Green: The device is registered.
  • Red: The device is de-registered.
  • Gray: The Device is unregistered.

Verify that the indicator of a new Device displays in gray after creation of the Device, but before the Device powers on.

The indicator displays in green after the Device is powered on and has successfully registered.

In the DDM dashboard, each Smart Object has an indicator that can display the following colors:

  • Green: The Smart Object is available on the Device.
  • Red: The Smart Object is unavailable on the Device.