Data Handling

Sending, Reporting and Viewing data using the 1NCE LwM2M Service.

In general, there are two options how data from a LwM2M client device can be transmitted towards the LwM2M Server. The Send Operation represents the push-orientated communication, where as Passive Reporting reflects the pull-based data exchange. In the following section, both these data exchange methods are outlined. Further an outline to viewing and accessing the LwM2M data and further references are provided.

Send Operation

A active LwM2M client that is registered on the LwM2M server can send data by executing a simple send operation. This send is used by the LwM2M client to "push" data to the LwM2M Server without an explicit request by this server. This operation is used by the client to report values for Resources and Resource Instances of known and existing LwM2M Object Instance(s) (OMA LwM2M Registry.) to the LwM2M Server.

Passive Reporting

Passive Reporting provides a pull-based data collection method, where data is requested from a LwM2M device. By enabling passive reports, the 1NCE LwM2M server tries to read all known readable Objects of the LwM2M client. This read is timed based on the Registration and Registration Update Events. The read out data is also provided via the 1NCE Data Broker. An Object is considered readable if at least one of its resources is readable. LwM2M Object IDs 1, 2, and 3 are excluded from this read operation.

Enable Reporting

To use Passive Reporting with the 1NCE LwM2M Service, the LWM2M_PASSIVE_REPORTING setting needs to be enabled. The setting can be easily enabled with a Management API call:

curl --data '{"state": "ENABLED"}' --request PATCH

For more information about using 1NCE Management API, use the 1NCE API Explorer.

Reporting Example

Suppose the used device support LwM2M Object IDs 6 (Connectivity Status) and 7 (Location). Based on the Registration and Registration Update, the LwM2M server would read all Resources from Objects 6 and 7 of the given client device.

Reporting Interval

By default, the registration lifetime and thus the update proposed by the LwM2M bootstrap server is ONE day. This would result in infrequent data updates when using Passive Reporting. To change this parameter to a higher registration update frequency, the LwM2M client needs to update the Registration Update frequency, though it should not exceed 1 day. Please see the Client Examples for further details.

Accessing & Reading Data

As all messages received and processed by the LwM2M Service are forwarded through and stored in the Data Broker, there are multiple ways how to access and read the data from LwM2M devices. Any send message received by the 1NCE LwM2M Service is processed and stored by the 1NCE Data Broker. These messages can be accessed in the 1NCE Portal in the Connectivity Suite Devices section (by selecting a specific device and going to the Device State).