Giter VIP home page Giter VIP logo

relay-gateway's Introduction

Creator logo

Relay gateway application

Overview

Relay gateway application runs on Ci40 board with Relay click inserted in click interface. It acts as AwaL2MWM client and connects to Creator Device Server.

The device server is a LWM2M management server designed to be implemented alongside third party cloud services to integrate M2M capability into an IoT application. The device server exposes two secure interfaces; REST API/HTTPs and LWM2M/CoAP.

Relay gateway app defines IPSO 3201 (DigitalOutput) object and subscribes to it's resource 5550 (DigitalOutputState) change. Mobile app can control that resource by sending request to Device Server using REST API. Upon message receipt Ci40 app is changing relay state according to current IPSO resource value.

Relay gateway application serves the purpose of:

  • It acts as Awalwm2m client
  • It communicates with device server
Object Name Object ID Resource Name Resource ID
RelayDevice 3201 DigitalOutputState 5550

Prerequisites

Hardware

Relay click should be inserted on Ci40 in Mikrobus slot 1.

App provisioning

Application needs valid certificate to communicate with Creator Device Server. Process of providing certificate for the app is called provisioning.

You can obtain certificate by logging to creator developer console and selecting Identities > Certificates > Get Certificate. Then copy this certificate on Ci40 under /etc/config/relay_gateway.crt


This process is shown on image below

image

Bootstrap URL

App needs to know where your bootstrap server is. Put your bootstrap URL in application config file that can be found under /etc/config/relay_gateway.cfg

Application flow diagram

Relay-Gateway Controller Sequence Diagram

Using OpenWrt SDK to build standalone package

Please refer OpenWrt-SDK-build-instructions for exact build instructions.

Running Application on Ci40 board

Relay gateway application can be started from the command line as:

$ relay_gateway_appd

Output looks something similar to this :

Relay Gateway Application

------------------------

Looking for certificate file under : /etc/config/relay_gateway.crt

Certificate found.


Observing IPSO object on path /3201/0/5550


Value of resource /3201/0/5550 changed to: 1

Changed relay state on Ci40 board to 1


Value of resource /3201/0/5550 changed to: 0

Changed relay state on Ci40 board to 0

relay-gateway's People

Contributors

nikhil-zinjurde-imgtec avatar rafcio2k 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.