How can your product become an integral part of the IoT world?

Projects in the industrial and consumer IoT environment are exciting and diverse. Many disciplines are involved at the same time: hardware and antenna design, industrialisation, communication, low power, visualisation and control, cloud integration, firmware development and updates, and much more. The technology mix is constantly growing and many standards and alliances are fighting for market share. One protocol that is not yet well known is LwM2M – the lightweight machine-to-machine protocol.

City at night with lots of lights and communication network concept. Symbol of Smart City, IoT (Internet of Things)

If a project grows beyond the prototype phase, an IoT project raises questions that can have a significant impact on the overall design and costs.

How are the devices automatically initialised during production (bootstrapping)?
How is new firmware installed on the IoT device?
• How can the remote devices be controlled centrally, for example activated or deactivated?
• What happens to the data when an IoT device is in sleep mode?
• Are there standards for transmitting sensor data so that it can be easily exchanged or added to an existing server environment without adaptations?
• How can data be securely transmitted between the IoT device and the server?


Fortunately, there is no need to reinvent the wheel. LwM2M, a standard for M2M communication, provides answers to these questions and much more.

Machine-to-Machine - M2M

Machine-to-Machine, or M2M for short, is an automated exchange of information between different end devices. Sensors and actuators communicate with a server (control centre/SCADA, cloud, database, workflow engine) via various access networks (such as mobile communications, Bluetooth, WiFi, 802.15.4) with the help of the internet.

M2M communication is a point-to-point connection. A temperature sensor sends its data to a database via the mobile network, and thus communicates directly with the database server. However, IoT communication can also function directly in a network. For example, a light with an integrated motion sensor can send a control command to lights in the same light group and switch them on. M2M is a key topic in the industrial environment. Sophisticated processes and machine learning and visualisations run on a central infrastructure, to which IoT devices exchange data via M2M.

Lightweight M2M Protocol - LwM2M

LwM2M is an M2M protocol with a focus on IoT devices: secure, economical data transmission, low power and fault tolerance are central design requirements. Many of the current radio modules (WiFi / LTE / NB-IoT / Cat-M /..) already support LwM2M. This support means that a project with industrial requirements can be implemented very quickly. From the firmware developer's point of view, the integration of LwM2M is often reduced to a few lines of AT commands.
Modern cityscape with network hologram to show external network connectivity of office buildings

LwM2M uses UDP and COAP as transport protocols. Data encryption is carried out using DTLS. The LwM2M standard defines resources that are addressed in the style of an internet web address (REST) and operators (Read / Write / Execute / Observe /...) for handling these resources.

Example:
"Read /3/0/0" – The server wants to receive the "Manufacturer" information from the IoT device.
"Execute /3/0/4" – The server wants to restart (reboot) the IoT device.
"Observe /6/0" – The server wants to be informed of any changes in the location (GNSS).

Resources are addressed using the object ID / resource ID. In the first two examples, the object with ID 3 (/3/x/x), the "Device" object, was addressed. When an IoT device registers with the server, it reports which objects it supports.

The LwM2M standard defines many predefined objects. These predefined objects allow, for example, a tracking IoT device to report to the server with object 6, and the server recognises that this is tracking data and in which format it is to be sent.

Are there alternatives?

MQTT is certainly the best-known representative for IoT projects and M2M communication and is supported by many cloud platforms. However, MQTT only defines a communication channel and does not solve any of the questions posed at the beginning. LwM2M allows for much more comprehensive flexibility through its active control. It can be decided in real time when the server wants which data from which IoT device. The behaviour of an IoT device can be adapted at any time, even after it has been in operation for a long time.

Economical data transfer

In IoT projects, economical data transfer is usually a key issue. Every byte that has to be transferred due to protocol overhead puts a strain on the battery and is usually also directly proportional to the costs for the amount of data transferred. LwM2M has therefore designed the entire protocol definition with this goal in mind.

"IoT is on everyone's lips: the networking of things opens up a multitude of possibilities and markets. However, the real challenge around the topic of the Internet of Things is not the most sensitive sensor, but the intelligent linking of the various sensors and actuators via the cloud."

Marcel Graber, former hardware and firmware developer at STEINEL Solutions AG