nCube Thyme Nodejs

Application Dedicated Node Device Platform based on Node.js

Node Device

IoT

v2.3.2
July 2, 2018

iyahn@keti.re.kr
Il Yeup, Ahn

Git Hub Project Link
nCube Thyme NodeJs

 

Gub Hub Release Direct DownLoad Link
Direct Link Revision Release Date
nCube-Thyme-Nodejs-2.3.2.zip v2.3.2 July 2018
nCube-Thyme-Nodejs-2.3.0.zip v2.3.0 Mar 2018
nCube-Thyme-Nodejs-2.2.0.zip v2.2.0 Feb 2018
nCube-Thyme-Nodejs-2.0.0.zip v2.0.0 July 2017

nCube-Thyme for Node.js


Introduction

nCube-Thyme is an open source IoT device application entity based on the oneM2M (http://www.oneM2M.org) standard. nCube-Thyme consists of three versions: Node.js version, Java version and Android version.

Connectivity stucture

nCube-Thyme implementation of oneM2M ADN-AE can be connected to MN-CSE or IN-CSE.

Installation

nCube-Thyme for Node.js is developed with javascript of node.js.

 

  • Node.js
    Node.js® is a JavaScript runtime built on Chrome’s V8 JavaScript engine. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient. Node.js’ package ecosystem, npm, is the largest ecosystem of open source libraries in the world. Node.js is very powerful in service impelementation because it provide a rich and free web service API. So, we use it to make RESTful API base on the oneM2M standard.
  • nCube-Thyme for Node.js
    nCube-Thyme for Node.js source codes are written in javascript. So they don’t need any compilation or installation before running.

Configuration

  • Open the nCube-Thyme for Node.js source home directory
  • Install dependent libraries as below
npm install
  • Modify configuration file “conf.js” per your setting
 
conf.useprotocol = 'http';              // select one for 'http' or 'mqtt' or 'coap' or 'ws'
 
// build cse 
cse.host        = '203.253.128.161';    //CSE host IP
cse.port        = '7579';               //CSE http hosting port
cse.name        = 'Mobius';
cse.id          = '/Mobius';
cse.mqttport    = '1883';               //CSE mqtt broaker port
cse.wsport      = '7577';
 
// build ae
ae.name         = 'edu4';               //AE name
ae.id           = 'S' + ae.name;        //AE-ID
 
ae.parent       = '/' + cse.name;
ae.appid        = 'education';
ae.port         = '9727';
ae.bodytype     = 'json'; // select 'json' or 'xml' or 'cbor'
ae.tasport      = '3105';
 
// build cnt 
var count = 0;
cnt_arr[count] = {}; 
cnt_arr[count].parent = '/' + cse.name + '/' + ae.name;
cnt_arr[count++].name = 'cnt-co2';      //CNT name
cnt_arr[count] = {}; 
cnt_arr[count].parent = '/' + cse.name + '/' + ae.name;
cnt_arr[count++].name = 'cnt-led';      //CNT name
 
// build sub 
count = 0;
sub_arr[count] = {}; 
sub_arr[count].parent = '/' + cse.name + '/' + ae.name + '/' + cnt_arr[1].name;
sub_arr[count].name = 'sub-ctrl2';      //Subsctiption name
sub_arr[count++].nu = 'mqtt://' + cse.host + '/' + ae.id + '?ct=' + ae.bodytype;

Running

Use node.js application execution command as below

node thyme.js

 

Dependency Libraries

This is the list of library dependencies for nCube:Thyme Node.js

  • body-parser
  • cbor
  • coap
  • express
  • fs
  • http
  • ip
  • js2xmlparser
  • morgan
  • mqtt
  • shortid
  • twitter
  • url
  • util
  • websocket
  • xml2js
  • xmlbuilder

Document

If you want more details please dowload the full installation guide document.

BSD 3-Clause License

Copyright (c) 2017, IoTKETI All rights reserved Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

* Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.