Skip to content

LwM2M Client Queue Mode Messages Not Delivered

DodaTech Updated 2026-06-26 1 min read

In this tutorial, you'll learn about LwM2M Client Queue Mode Messages Not Delivered. We cover key concepts, practical examples, and best practices.

The Problem

LwM2M Queue Mode messages queued by the server are not delivered to the client.

Quick Fix

Wrong

// Queue Mode not configured — server delivers real-time only```

Messages sent while client is offline are lost.


### Right

```cpp
#include <anjay/anjay.h>
#include <anjay/server.h>

int main(void) {
  anjay_t *anjay = anjay_new(&config);
  anjay_server_object_install(anjay);

  // Enable Queue Mode
  // Set Notification Storing (Resource 7) to true
  const int NOTIFICATION_STORING = 1;
  anjay_server_add_instance_ex(anjay, 0, 86400, NULL, NULL,
    NULL, NULL, NOTIFICATION_STORING, NULL);

  anjay_start(anjay);

  while (true) {
    // In Queue Mode: client must periodically poll the server
    anjay_sched_run(anjay);

    static uint32_t last_poll = 0;
    if (millis() - last_poll > 30000) {  // Every 30s
      // Enter awake state — server delivers queued messages
      anjay_queue_mode_enter_awake(anjay);
      last_poll = millis();
    }
  }
}```

Client offline. Server queues messages. Client wakes every 30s, receives queued commands.


## Prevention

LwM2M Queue Mode (Object 1/0/7 — Notification Storing) enables the server to queue messages for offline devices. The client periodically enters Awake state to receive queued messages. Use cases: battery-powered sensors that sleep most of the time. The server queues up to the maximum message size (typically 1 KB). Messages expire after the registration lifetime.

DodaTech engineers apply these same patterns across Doda Browser, DodaZIP, and Durga Antivirus Pro for production IoT reliability.

## FAQ

<details style="margin-bottom:12px;border:1px solid #e2e8f0;border-radius:10px;overflow:hidden"><summary style="cursor:pointer;padding:14px 18px;font-weight:600;font-size:1.05rem;background:#f8fafc;border-bottom:1px solid #e2e8f0;color:#1e293b">### What triggers Queue Mode?</summary><div style="padding:14px 18px;color:#475569;line-height:1.7;background:#fff"><p>Setting Notification Storing = true in Server Object. The client then marks itself as Awake or Sleeping via registration updates.</p>
<h3 id="how-long-are-messages-queued">How long are messages queued?</h3><p>Until the client's registration lifetime expires. After expiry, messages are discarded. The client must poll before lifetime ends.</p>
<h3 id="does-queue-mode-work-with-observe">Does Queue Mode work with Observe?</h3><p>Yes. Observations are also queued. The client receives the latest value when it wakes (not every intermediate change).</p>
</div></details>

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro