Skip to content

Cookie preferences

We use cookies for our own analytics and to see how our campaigns perform. We never sell your data. Necessary cookies keep the site working and cannot be switched off. See our Cookie Policy for details.

Security, load balancing and remembering your cookie choice.

Show us which pages people read and how they find the site, so we can improve it (Google Analytics).

Show us which of our ad campaigns bring visitors to the site (Google Ads).

© 2026 The ThingsBoard Authors
Try for free

ThingsBoard Cloud

Choose your data region

Your data stays in the region you choose, for residency and compliance. No credit card required.

Rather run it yourself? Install on your own servers

LwM2M API

ThingsBoard Edge supports the OMA LwM2M 1.0 and 1.1 specifications. Edge acts as the LwM2M server — devices register with Edge over the local network, and Edge relays telemetry and alarms to the ThingsBoard server over gRPC.

Default ports:

Role Plain Secured
LwM2M server 5685 UDP (NoSec) 5686 UDP (DTLS)
LwM2M bootstrap server 5687 UDP (NoSec) 5688 UDP (DTLS)

LwM2M devices require a device profile configured with:

  • Transport type: LwM2M
  • LwM2M server URI: pointing to the Edge node (e.g., coap://192.168.1.10:5685)
  • Security mode: NoSec, PSK, RPK, or X.509

To configure a LwM2M device profile: go to Profiles → Device profiles → Add device profile, select LwM2M as the transport type.

LwM2M supports four security modes. Configure the matching credentials on both the device and the device profile in Edge:

Mode Description
NoSec No security — for development and trusted networks only
PSK Pre-shared key — identity and key defined per device
RPK Raw public key — asymmetric, no certificate authority required
X.509 Certificate-based — requires a CA chain

To set credentials: go to Entities → Devices, open the device, click Manage credentials, select the LwM2M security mode.

LwM2M resources are mapped to ThingsBoard attributes and telemetry in the device profile. Each object/resource ID maps to a ThingsBoard key.

For example, Object 3306 (Presence), Resource 5500 maps to a boolean telemetry key digital_input_state.

Edge stores and processes these values locally and syncs them to the server when the gRPC connection is available.

Edge supports OTA firmware and software updates for LwM2M devices using:

  • Object 5 (/5) — Firmware Update
  • Object 9 (/9) — Software Management

Assign an OTA package to the device via Entities → Devices → OTA updates on the Edge node. Edge pushes the firmware to the device using the LwM2M PUSH or PULL delivery method defined in the device profile.

Send commands to LwM2M devices via the ThingsBoard RPC API. Supported operations:

RPC method LwM2M operation
Read Read object or resource value
Write Write a resource value
Execute Execute a resource (e.g., reboot)
Observe Start observing a resource
Cancel Observe Stop observing a resource
Discover List available resources on the device