SkillAgentSearch skills...

Anjay

C implementation of the client-side OMA LwM2M protocol

Install / Use

/learn @AVSystem/Anjay
About this skill

Quality Score

0/100

Category

Operations

Supported Platforms

Universal

README

Anjay LwM2M library <img align="right" height="50px" src="https://avsystem.github.io/Anjay-doc/_images/avsystem_logo.png">

Build Status Coverity Status

Licensing Notice (from v3.10.0)

Starting from version 3.10.0, the Anjay LwM2M Client SDK is distributed under a new License.

Mandatory Registration for Commercial Use

If you intend to use Anjay in any commercial context, you must fill in a registration form to obtain a free commercial license for your product.

Register here: https://go.avsystem.com/anjay-registration

Why is registration required?

We introduced registration to:

  • Gain insight into usage patterns – so we can prioritize support, features, and enhancements relevant to real-world use cases.
  • Engage with users – allow us to notify you about important updates, security advisories, or licensing changes.
  • Offer tailored commercial plugins, professional services, and technical support to accelerate your product development.

For inquiries, please contact: sales@avsystem.com

What is Anjay?

Anjay is a C library that aims to be the reference implementation of the OMA Lightweight Machine-to-Machine (LwM2M) device management protocol. It eases development of fully-featured LwM2M client applications by taking care of protocol details, allowing the user to focus on device-specific aspects.

The project has been created and is actively maintained by AVSystem.

Quick links:

Table of contents:

<!-- toc --> <!-- /toc -->

Supported features

This version includes full support for OMA LwM2M TS 1.1 features. Some features, such as support for EST, SMS binding or HSM's are available commercially.

  • LwM2M Bootstrap Interface:

    • Request
    • Discover
    • Read
    • Write
    • Delete
    • Finish
  • LwM2M Client Registration Interface:

    • Register
    • Update
    • De-register
  • LwM2M Device Management and Service Enablement Interface:

    • Discover
    • Read
    • Read-Composite
    • Write
    • Write-Composite
    • Execute
    • Write-Attributes
    • Create
    • Delete
    • Send
  • LwM2M Information Reporting Interface:

    • Observe
    • Observe-Composite
    • Cancel Observation
    • Cancel Observation-Composite
    • Notify
  • LwM2M Security modes:

    • DTLS with Certificates (if supported by backend TLS library)
    • DTLS with PSK (if supported by backend TLS library)
    • NoSec mode
  • Supported TLS backends:

    • mbed TLS
    • OpenSSL
    • tinydtls
  • Supported platforms:

  • CoAP data formats:

    • Plain Text
    • Opaque
    • CBOR
    • TLV
    • SenML JSON
    • SenML CBOR
    • LwM2M JSON (output only)
  • CoAP BLOCK transfers (for transferring data that does not fit in a single UDP packet):

    • Block1 (sending / receiving requests)
    • Block2 (sending responses)
  • Pre-implemented LwM2M Objects:

    • Access Control
    • Security
    • Server
    • Firmware Update
    • IPSO single and three-axis sensor objects
    • LwM2M Gateway
  • Stream-oriented persistence API

  • LwM2M Gateway functionality

About OMA LwM2M

OMA LwM2M is a remote device management and telemetry protocol designed to conserve network resources. It is especially suitable for constrained wireless devices, where network communication is a major factor affecting battery life. LwM2M features secure (DTLS-encrypted) methods of remote bootstrapping, configuration and notifications over UDP or SMS.

For quick and simple protocol learning, visit LwM2M Crash Course

More details about OMA LwM2M: Brief introduction to LwM2M

Embedded operating systems ports

If you want to use Anjay on Zephyr OS, FreeRTOS, Azure RTOS, or RPI Pico W check our demo applications available in other repositories:

There are also archived, not actively maintained Anjay demos and integrations:

Quickstart guide

Dependencies

  • C compiler with C99 support,
  • avs_commons - included in the repository as a subproject,
  • If DTLS support is enabled, at least one of:
  • Optional dependencies (required for tests):
  • Optional dependencies (required for building documentation - more information in "Contributing" section):

Ubuntu 20.04 LTS / Raspbian Buster or later

<!-- deps_install_begin -->
sudo apt-get install git build-essential cmake libmbedtls-dev zlib1g-dev
<!-- deps_install_end -->

CentOS 7 or later

# EPEL is required for mbedtls-devel and cmake3
sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo yum install -y which git make cmake3 mbedtls-devel gcc gcc-c++ zlib-devel

macOS Sierra or later, with Homebrew

brew install cmake mbedtls openssl

Running the demo client

For initial development and testing of LwM2M clients, we recommend using the Coiote IoT Device Management where you can use the basic LwM2M server functionality for free. After registering and logging in Coiote, you can onboard your first device.

With a device added to the LwM2M Server, you can compile Anjay demo client and connect it to the platform by running:

<!-- compile_instruction_begin -->
git clone https://github.com/AVSystem/Anjay.git \
    && cd Anjay \
    && git submodule update --init \
    && cmake . \
    && make -j \
    && ./output/bin/demo --endpoint-name $(hostname) --server-uri coap://eu.iot.avsystem.cloud:5683
<!-- compile_instruction_end -->

NOTE: On some older systems like CentOS 7, you may need to use cmake3 instead of cmake.

NOTE: We strongly recommend replacing $(hostname) with some actual unique hostname. Please see the documentation for information on preferred endpoint name formats. Note that with the Coiote IoT Device Management platform, you will need to enter the endpoint name into the server UI first.

Detailed compilation guide

For a detailed guide on configuring and compiling the project (including cross-compiling), see Compiling client applications.

First, make sure all necessary submodules are downloaded a

View on GitHub
GitHub Stars211
CategoryOperations
Updated1mo ago
Forks78

Languages

C

Security Score

85/100

Audited on Feb 11, 2026

No findings