oneM2M IoT Server Platform
2.6.0
The next version of Mobius is available on Mobius4.
Mobius now runs on SQLite as well as MySQL. SQLite requires no separate database server and creates its schema automatically at startup, which makes it suitable for embedded gateways, development and small deployments. Select the backend at launch (node mobius.js sqlite) or through the usesqlite option in conf.json. See Configuration.
The SQLite backend currently covers six resource types — CSEBase, AE, accessControlPolicy, container, contentInstance and subscription. Creating any other type while running on SQLite is rejected with 501 Not Implemented (X-M2M-RSC: 5001) instead of being attempted, so the resource tree is never left in a partial state. Deployments that need group, flexContainer, node, remoteCSE, mgmtObj, semanticDescriptor or the transaction resources should run on MySQL.
oneM2M discovery query parameters were embedded into the WHERE clause by string concatenation, allowing SQL injection (reported by KETI, affects Mobius 2.5.15 and earlier). All discovery parameters are now normalised at a single entry point on both the MySQL and SQLite paths. Numeric parameters accept unsigned integers only, and string parameters are escaped. Upgrading is strongly recommended.
Mobius runs one worker per CPU core, and several operations were not safe against concurrent workers. This release addresses that:
- Parent container counters (
cni,cbs,st) are updated by relative increment instead of absolute overwrite, and multiple contentInstance creations are coalesced into a single debounced update. - Retention enforcement (
mni,mbs) no longer performs a full child scan, deletes the oldest instances rather than arbitrary ones, and removes exactly the amount over the limit. Each pass is bounded so a long deletion cannot hold the container row lock. - Concurrent retention passes across workers are serialised with a transaction, preventing over-deletion.
- Notification delivery is now fire-and-forget across HTTP, CoAP, MQTT and WebSocket.
- Excessive per-request logging was removed so that operational logs remain usable for incident analysis.
The timeSeries (ty=29) and timeSeriesInstance (ty=30) resource types and the accompanying time series agent have been removed, along with their database tables.
- MySQL schema change. The
cnttable columnsmni,mbs,cniandcbswere widened fromint unsignedtobigint unsigned. Existing installations must apply this change:
ALTER TABLE cnt
MODIFY mni bigint unsigned NOT NULL,
MODIFY mbs bigint unsigned NOT NULL,
MODIFY cni bigint unsigned NOT NULL,
MODIFY cbs bigint unsigned NOT NULL;- Applications relying on
timeSeries/timeSeriesInstancemust migrate tocontainer/contentInstance. - Applications relying on notification retry or on subscriptions being removed automatically after repeated delivery failures must handle delivery reliability on the application side.
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.
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).
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.
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.
- HTTP
- CoAP
- MQTT
- WebSocket
The Mobius is based on Node.js framework and uses MySQL or SQLite 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. -
SQLite
SQLite is an embedded database that needs no separate server process. It is installed with the Mobius dependencies (npm install), stores everything in a singlemobius.dbfile and builds its schema on the first run, so no manual import is required. Use it for development, embedded gateways and small deployments. See What's New for the supported resource types. -
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.
We deploy Mobius as a Docker image using the virtualization open source tool Docker.
- Import SQL script (MySQL only)
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
When using SQLite this step is not needed. The schema in [Mobius home]/mobius/mobiusdb_sqlite.sql is applied automatically at startup.
- 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
"usesqlite": "false" //"true" to use SQLite instead of MySQL
}
By default a container created without mni / mbs uses the Mobius defaults. If a deployment needs different defaults for particular container paths, they can be declared in conf.json as retentionPolicies. Omit the key to disable the feature entirely.
{
"retentionPolicies": [
{"match": "contains", "value": "/Simul_", "mni": "10000"},
{"match": "regex", "value": "/\\d{4}_\\d{2}_\\d{2}_T_\\d{2}_\\d{2}$",
"mni": "3153600000", "mbs": "1099511627776"},
{"match": "suffix", "value": "/archive", "mni": "100000"}
]
}
match—contains(default),prefix,suffixorregex, compared against the container resource identifiervalue— the string or JavaScript regular expression source to compare withmni/mbs— either may be omitted, in which case the Mobius default applies
The first matching rule wins, so array order is priority order. A rule that is malformed is reported on the console and skipped rather than blocking container creation. A value explicitly supplied by the client in the CREATE request always takes precedence over these defaults, as required by oneM2M.
Use node.js application execution command as below
node mobius.js
The database backend follows usesqlite in conf.json, and can be overridden on the command line:
node mobius.js sqlite // force SQLite
node mobius.js mysql // force MySQL
npm start is equivalent to node mobius.js. On Windows the run_sqlite.bat and run_mysql.bat helper scripts are also provided.
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
- sqlite3
- url
- util
- websocket
- xml2js
- xmlbuilder
The legacy installation guide PDFs were removed from this repository as they no longer matched the current version. The installation and configuration steps above are the up-to-date reference.
Jaeho Kim (jhkim@keti.re.kr) Il Yeup Ahn (iyahn@keti.re.kr)





