Giter Club home page Giter Club logo

fogml-zephyr-lwm2m's Introduction

FogML-Zephyr-LwM2M

The application is the result of research conducted jointly with the AVSystem company. It demonstrates how network connectivity can be provided for intelligent IoT devices incorporating TinyML algorithms running on resource limited microcontrollers. The resource constraints also apply to network communication which is often enabled by Low-Power WAN (LPWAN) networks such as NB-IoT. In order to use efficiently the properties of such a low-power communication channel in real large-scale systems, several requirements should be met including UDP instead of TCP transport and binary serialization of the data. These requirements are fulfilled by the LwM2M protocol. It enables also service enablement, device management and FOTA for the fleet of IoT devices.

In the application, we show how the Data Model of the LwM2M protocol can be used to expose the inference results of TinyML algorithms running on IoT devices connected to the network by NB-IoT technology.

The application is an extended version of the FogML example for ZephyrOS and is based on the following projects:

Therefore, the data preparation process is the same as in the first project and the steps necessary to connect to the LwM2M server as in the second one.

The demo application that uses EdgeImpulse SDK instead of FogML is in the LwM2M Anjay Client repository:

Supported hardware

The application is designed for Thingy:91 device:

Thingy:91 integrates an nRF9160 SiP that supports LTE-M and NB-IoT connectivity.

Pattern Detector Object

The general idea is presented in the figure.

Pattern Detection object

Pattern Detector (/33650) object definition is in file pattern_detector.xml. Application creates as many object instances as the number of classes it is able to identify. In the example, device is able to detect four movement patterns - idle, circle, snake and up-down. Whenever the movement pattern is detected, the appropriate object instance of the LwM2M Data Model on the device is updated.

Pattern Detection object

To sum up, the following LwM2M Objects are supported:

  • Security (/0)
  • Server (/1)
  • Device (/3)
  • Pattern Detector (/33650)

Firmware object is not implemented in the application, but is supported by the Anjay LwM2M client library.

Building the project

The project can be built as in the Anjay client description. Alternatively, the default SDK installed with the nRF Connect utility can be modified to use Anjay LwM2M client. To do this, edit the file [default_sdk_folder]/ncs/v2.0.0/nrf/west.yml by adding:

  - name: Anjay-zephyr
    submodules: true
    remote: anjay
    revision: 67fd6bfe7846d449ce9a881152bde3a88aa7af4a
    path: modules/lib/anjay

and

  - name: anjay
    url-base: https://github.com/AVSystem    

Then, according to https://nrfconnect.github.io/vscode-nrf-connect/connect/west.html :

To update a west workspace:

    Open the Command Palette and type nRF Connect: West Update
    Choose the location of your project repository and west begins to update.

Connecting to the LwM2M Server

To connect to Coiote IoT Device Management LwM2M Server follow the instructions in Anjay-Zephyr-Client.

NOTE: You may use any LwM2M Server compliant with LwM2M 1.0 TS, however the LwM2M Pattern Detector object definition is already deployed in the Coiote Server.

Summary

The application shows how network connectivity can be added to TinyML algorithms deployed on IoT devices. Moreover, the LwM2M protocol enables remote firmware updates for IoT devices, which can be used for updating machine learning algorithms. We are currently working on anomaly detection and MLOps LwM2M objects for scaling TinyML to millions of devices.

fogml-zephyr-lwm2m's People

Contributors

tszydlo avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 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.