Giter Site home page Giter Site logo

lwm2m's Introduction

lwm2m

build Go Report Card

A simple and lightweight ( but not full feature ) lwm2m server aim to run on edge router.

Features

  • Bootstrap Interface
  • Client Registration interface.
    • Register
    • Update
    • Deregister
  • Device Management and Service Enablement interface.
    • Read Operation, Read Resource, Read Object
    • Write Operation, Write Resource, Write Object Instance
    • Execute Operation
    • Discover Operation
    • Create Operation
    • Delete Operation
    • Write-Attributes Operation
    • Read-Composite Operation
    • Write-Composite Operation
  • Information Reporting interface.
    • Observe Operation, Observe Resource, Observe Object
    • Cancel Observation Operation
    • Observe-Composite Operation
    • Cancel Observation-Composite Operation
    • Send Operation
  • Data formats
    • Plain Text
    • Opaque
    • CBOR
    • TLV
    • SenML JSON
    • SenML CBOR
    • LwM2M JSON
  • Security
    • DTLS with Certificates
    • DTLS with PSK, only support DTLS 1.2
  • Transport
    • UDP transport support.
    • TCP transport support.(Some features may not work properly)
  • Tested with clients
    • Leshan client: coap, coaps + psk
    • Anjay client running on ESP32: coap
    • Anjay client running on Linux: coap, coaps + psk
    • Zephyr LWM2M client running on nrf52840 with w5500 ethernet: coap, coaps + psk
    • Zephyr LWM2M client running on nrf52840 with Openthread

Installation

You need a working Go environment.

go get github.com/yplam/lwm2m

Getting Started

package main

import (
  "github.com/yplam/lwm2m/core"
  "github.com/yplam/lwm2m/registration"
  "github.com/yplam/lwm2m/server"
  "log"
)

func main() {
  r := server.DefaultRouter()
  deviceManager := core.DefaultManager()
  registration.EnableHandler(r, deviceManager)
  err := server.ListenAndServe(r,
    server.EnableUDPListener("udp", ":5683"),
  )
  if err != nil {
    log.Printf("serve lwm2m with err: %v", err)
  }
}

Test Commands

leshan client

# coap 
java -jar leshan-client-demo.jar --server-url=localhost:5683

# coaps
java -jar leshan-client-demo.jar --server-url=localhost:5684 -i 123 --psk-key=000102030405060708090a0b0c0d0e0f

anjay client

# coap
./output/bin/demo --endpoint-name $(hostname) --server-uri coap://127.0.0.1:5683

# coap + tcp
./output/bin/demo --endpoint-name $(hostname) --server-uri coap+tcp://127.0.0.1:5685

# coaps
./output/bin/demo --endpoint-name $(hostname) --server-uri coaps://127.0.0.1:5684 --security-mode psk --identity 666f6f --key 000102030405060708090a0b0c0d0e0f --ciphersuites 49320 --tls-version TLSv1.2

License

Apache License Version 2.0. See the LICENSE file for details.

lwm2m's People

Contributors

yplam avatar shabunin avatar dan9k avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.