Mobius

IoT Server Platform based on Node.js.

Server

IoT

v2.4.36
March 13, 2020

iyahn@keti.re.kr
Il Yeup, Ahn

Git Hub Project Link
Mobius

 

Gub Hub Release Direct DownLoad Link
Direct Link Revision Release Date
Mobius-2.4.36.zip v2.4.36 Mar 2020
Mobius-2.4.35.zip v2.4.35 Fed 2020
Mobius-2.4.34.zip v2.4.34 Jan 2020
Mobius-2.4.20.zip v2.4.18 Mar 2019
Mobius-2.4.19.zip v2.4.18 Mar 2019
Mobius-2.4.18.zip v2.4.18 Mar 2019
Mobius-2.4.15.zip v2.4.15 Jun 2019
Mobius-2.4.10.zip v2.4.10 Dec 2018
Mobius-2.4.5.zip v2.4.5 Jun 2018
Mobius-2.4.0.zip v2.4.0 May 2018
Mobius-2.2.5.zip v2.2.5 Mar 2018
Mobius-2.2.4.zip v2.2.4 Mar 2018
Mobius-2.2.3.zip v2.2.3 Mar 2018
Mobius-2.2.2.zip v2.2.2 Mar 2018
Mobius-2.2.1.zip v2.2.1 Mar 2018
Mobius-2.2.0.zip v2.2.0 Mar 2018
Mobius-2.1.0.zip v2.1.0 Feb 2018
Mobius-2.0.0.zip v2.0.0 July 2017

Service Endpoint (URL):

http://portal.iotocean.org

Mobius Platfrom Functionalities

Mobius Platform works as the middle bridge to enable the communications and interactions between IoT devices and IoT applications as following:
① The Mobius server accepts the uploaded data from authenticated IoT devices and stores the data into the MySQL DB;
② The authenticated IoT applications can retrieve the data stored in Mobius server using Mobius open APIs for monitoring purpose;
③ The authenticated IoT applications are able to control remotely IoT devices that have already registered with Mobius server by sending control commands included in <contentInstance> resource. The Mobius server then executes control commands to the target devices

Mobius Platform Components

Mobius server consists of HTTP, CoAP, MQTT, WebSocket server and MySQL DBMS while IoT applications implement HTTP, CoAP and/or MQTT clients in order to communicate with Mobius server.

Mobius Platform S/W Architecture 

For protocol binding support, Mobius has MQTT broker, CoAP server, WebSocket server that is bound to HTTP server internally. For example, MQTT protocol binding is supported by implementing MQTT to HTTP proxy. CoAP and WebSocket are designed in the same way. Mainly it consists of requester and responder. The requester contains the DB access component. Every HTTP request is go through requester component, parser, actor and then create SQL query to data access (e.g. retrieval, discovery) with DB connector. When it gets access result, the responder creates the response in XML, JSON or CBOR serialization.

Mobius Platform Source Code Directory  

Source File Role and Function
mobius.js This file initiates Mobius server and helps loading main Node JS files. It also contains configuration parameters for Mobius server such as defaultbodytype indicating the serialization, usecsetype indicating CSE type (either IN-CSE, MN-CSE or ASN-CSE), usecsebase indicating CSEBase name, usecseid indicating CSEID, usedbhost indicating the host address, and usedbpass indicating the password for MySQL etc. Users can modify those configuration parameters.
app.js This file acts as role of flow router and it is the main code running Mobius-YT server.

① It handles initial processing of received packets.

② It initiates HTTP server with ‘listening’ mode to wait for HTTP requests target to the Mobius HTTP server.

③ It handles the parsing of URL of packets and evaluate the correctness of the request body resulted of parsing. It then sends the request to resource.js to continue the processing if the request is valid one, otherwise throws exceptions.

This file also implements the server clustering algorithms to improve the performance of HTTP server.

mobius/resource.js It is core file to process the CREATE, RETRIEVE, UPDATE, DELETE, NOTIFY and DISCOVERY operations for oneM2M resource primitives. This file undertakes the processing of parsed request URI and request body received from app.js according to corresponding operation. It converts the data into a format to process the data and connect to mysql database. The mysql database is initialized and handled by db_action.js and sql_action.js module.
mobius/responder.js It is responsible for handling the response process. It receives processing results from app.js and resource.js modules and generates responses from the processing results following format requested by originator either XML or JSON serialization.
mobius/db_action.js This file contains parameters used to connect and access to the database and parameters for returning response results from the database.
mobius/sql_action.js This file contains functions to receive data and parameters required for a series of database operations and functions to call db_action.js module to return data from database.
mobius/sgn.js This module file is responsible for checking the existence of <subscription> child resource under the requested target resource. If it exists, the module checks the event type and retrieves the field value of attribute notificationUril. Then it generates and sends a notification message to the address indicated by field value of attribute notificationUril.
mobius/security.js This file contains functions to check the access privileges of originators for a requested resource when the resource applies with <accessControlPolicy> resource. The originator ID is abstracted from request header field of X-M2MOrigin. The process checks the access right of current originator ID to a target resource and responds with ACESS_DENIED error when the originator ID has no privileges to access to the resource.
mobius/fopt.js
mobius/ts_agent.js This file contains functions to manage <timeSeriesInstance> resource. It monitors the mssing data in the <timeSeriesInstance> resource and then stores the missing data.
pxymqtt.js This file contains functions implementing mqtt proxying function to handle mqtt protocol messages in http protocol manner as following procedures:
① It creates a oneM2M mqtt topic with configuration information of Mobius server and then subscribe to the topic to receive mqtt requests targeted to this topic later.
② Whenever receiving mqtt protocol messages, it generates and sends a http request wrapping mqtt request message to Mobius server and waits for http response from Mobius server. It then abstracts http response and generates a mqtt response message correspondingly.
③ It responds with mqtt protocol message.
mobius/acp.js It contains functions to parse accessControlPolicy request. The accessControlPolicy resource is used to manage the access control privileges to resources that apply with access control policy.
mobius/ae.js It contains functions to parse AE request.
mobius/cb.js It contains functions to parse CSEBase request. The CSEBase resource contains configuration information of Mobius server.
mobius/cin.js It contains functions to parse contentInstance request.
mobius/cnt.js It contains functions to parse container request.
mobius/csr.js It contains functions to parse remoteCSE request.
mobius/grp.js It contains functions to parse group request.
mobius/lcp.js It contains functions to parse locationPolicy request.
mobius/mms.js It contains functions to parse multimediaSession request.
mobius/mn.js It contains functions to parse MN-CSE resource request including implementation of registration function with IN-CSE. It is used to drive nCube:rosemary.
mobius/sd.js It contains functions to parse semanticDescriptor request.
mobius/sub.js It contains functions to parse subscription request.
mobius/ts.js It contains functions to parse timeSeries request.
mobius/tsi.js It contains functions to parse timeSeriesInstance request.

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.

Introduction

Mobius is the open source IoT server platform based on the oneM2M (http://www.oneM2M.org) standard. As oneM2M specifies, Mobius provides common services functions (e.g. registration, data management, subscription/notification, security) as middleware to IoT applications of different service domains. Not just oneM2M devices, but also non-oneM2M devices (i.e. by oneM2M interworking specifications and KETI TAS) can connect to Mobius.

Certification

Mobius has been received certification of ‘oneM2M standard’ by TTA (Telecommunications Technology Association). oneM2M Certification guarantees that oneM2M products meet oneM2M Specification and Test requirements which ensure interoperability. As Mobius is certified, it will be used as a golden sample to validate test cases and testing system.

TRSL (Test Requirements Status List) is available on oneM2M certification website (http://www.onem2mcert.com/sub/sub05_01.php).

System Stucture

In oneM2M architecture, Mobius implements the IN-CSE which is the cloud server in the infrastructure domain. IoT applications communicate with field domain IoT gateways/devices via Mobius.

Connectivity Stucture

To enable Internet of Things, things are connected to &Cube via TAS (Thing Adaptation Software), then &Cube communicate with Mobius over oneM2M standard APIs. Also IoT applications use oneM2M standard APIs to retrieve thing data control things of Mobius.

Software Architecture

Supported Protocol Bindings

  • HTTP
  • CoAP
  • MQTT
  • WebSocket

Installation

The Mobius is based on Node.js framework and uses MySQL for database.

  • MySQL Server
    The MySQL is an open source RDB database so that it is free and ligth. And RDB is very suitable for storing tree data just like oneM2M resource stucture. Most of nCube-Rosemary will work in a restricted hardware environment and the MySQL can work in most of embeded devices.

  • 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.

  • Mosquitto
    Eclipse Mosquitto™ is an open source (EPL/EDL licensed) message broker that implements the MQTT protocol versions 3.1 and 3.1.1. MQTT provides a lightweight method of carrying out messaging using a publish/subscribe model. This makes it suitable for “Internet of Things” messaging such as with low power sensors or mobile devices such as phones, embedded computers or microcontrollers like the Arduino.

  • Mobius
    Mobius source codes are written in javascript. So they don’t need any compilation or installation before running.

Configuration

  • Import SQL script
    After installation of MySQL server, you need the DB Schema for storing oneM2M resources in Mobius. You can find this file in the following Mobius source directory.
[Mobius home]/mobius/mobiusdb.sql
  • Run Mosquitto MQTT broker
mosquitto -v
  • Open the Mobius source home directory
  • Install dependent libraries as below
npm install
  • Modify the configuration file “conf.json” per your setting
{
  "csebaseport": "7579", //Mobius HTTP hosting  port
  "dbpass": "*******"    //MySQL root password
}

Run

Use node.js application execution command as below

node mobius.js

Library Dependencies

This is the list of library dependencies for Mobius

  • body-parser
  • cbor
  • coap
  • crypto
  • events
  • express
  • file-stream-rotator
  • fs
  • http
  • https
  • ip
  • js2xmlparser
  • merge
  • morgan
  • mqtt
  • mysql
  • shortid
  • url
  • util
  • websocket
  • xml2js
  • xmlbuilder

Document

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

Author

Il Yeup Ahn (iyahn@keti.re.kr)