Skip to content

Mobius_v2.0.0_EN_Windows

IoTKETI edited this page Feb 18, 2018 · 9 revisions

Installation Guide for Mobius_v2.0.0 with Windows (English)

Mobius Server Platform Installation

Introduction

Mobius Yellow Turtle server platform deploys MySQL DBMS as a database so MySQL is required to be installed as a basic and then MQTT server and Mobius server have to install one by one. Note that it is unnecessary to install MQTT server if MQTT protocol and MQTT related functions are not supported.

2018-02-14 16:53

Pre-requisites Installation (Windows)

MySQL Installation

2018-02-14 16:53

Mobius server platform stores the data uploaded from devices into MySQL database. MySQL is an open source RDBMS and the installation procedures are introduced as follows:

2018-02-14 16:53

Different versions of MySQL are provided for downloading at below link:

http://dev.mysql.com/downloads/mysql.

2018-02-14 16:53

There is a MySQL community server version for free downloading. Users could also select to download MySQL Enterprise Edition or MySQL Cluster CGE version which need to buy licenses before starting use. User can choose to install a light MSI installer which installs all required MySQL packages online or a standalone version that contains all required packages. If users prefer to install using zip archive, you can download and install as shown as Figure.

2018-02-14 16:53

Here we demonstrate downloading the free version MySQL community server and you can find it from the top ‘Downloads’ menu tab and we select to install a Windows 64bit version MySQL through MySQL installer as shown as Figure.

The MySQL can be easily installed following the procedures as depicted as Figure.

① Read and accept the license agreement, then

② Choose a Setup type: A list of setup types “Developer Default, Server only, Client only, Full or Custom” are available to install. Here we recommend to select “Custom” and then select only two packages “MySQL Server” and “MySQL Workbench” to install.

③Install automatically the selected packages and after successful installation, then

④Configure the MySQL runtime environment shown as Figure.

i. Configure the machine type to either ‘Development Machine’, ‘Server Machine’, or ‘Dedicated Machine’. Here we select option ‘Development Machine’ to configure.

ii. Set ‘root’ account passwords and optionally create users with different privileges to access to the MySQL.

iii. Configure MySQL server as a Window Service and finally apply the user configurations to MySQL server.

iv. Input the root password and check the connection status to the configured MySQL as shown as Figure.

2018-02-14 16:53

2018-02-14 16:53

2018-02-14 16:53

Run MySQL workbench and create a MySQL connection and then connect to MySQL server with root password as shown as Figure.

2018-02-14 16:53

MySQL workbench provides both a graphical user interface (GUI) and command line to manage the database, data tables, import and output existing database as well as execution of queries. If users are familiar with MySQL commands, you can choose command line to input commands to control MySQL database. Here we demonstrate how to configure MySQL database through workbench GUI.

Until this step, we have installed MySQL successfully and then we have to configure the MySQL in terms of creation of a database for Mobius. In OCEAN alliance website download page, a MySQL database file can be downloaded to use. How to download and import that file will be explained later.

Step 1: Create a Mobiusdb Schema

After the MySQL is connected properly, right click the mouse at the workbench GUI as depicted as Figure and create a schema using popped tab. Name the new schema as mobiusdb and apply the schema creation. Then you can see the new created mobiusdb schema at the SCHEMA column at the left down side of GUI, select the mobiusdb schema and right click to select Set as Default Schema to set the current schema as default.

2018-02-14 16:53

Step 2: Import Mobiusdb database

All we need regarding for configuring Mobius database are bundled into a sql script file (mobiusdb.sql). Users can download freely the .sql scipt file from OCEAN alliance website Mobius page. As depicted as Figure, import the downloaded .sql script file through Data Import popped window. In Import from Disk tab, select option Import from Self-Contained File and browse to the downloaded .sql script and select the default schema to be imported to as created mobiusdb schema. Finally click the Start Import to apply the change. After the .sql file is imported, refresh the mobiusdb schema and you can see the mobiusdb schema is updated with empty tables are updated.

2018-02-14 16:53

MQTT Server Installation

Mobius enables IoT devices to communicate with MQTT server through MQTT protocol. To this end, a MQTT broker needs to be installed. We prefer to use open source MQTT broker Mosquitto server. Note: MQTT protocol can optionally be supported, if users will not implement MQTT functionalities, step “installation of MQTT server” can be ignored. The Mosquitto server can be freely downloaded from Mosquitto Downloads page as shown as Figure. You can see the source and binary versions of Mosquitto with latest and older versions in the download page. Here we prefer to download an older version as highlighted in Figure. If users prefer to use latest functionalities of Mosquitto broker, latest version is recommended.

We download a Mosquitto from http://mosquitto.org/files/ as shown as Figure 21 and install it just following set up wizard as shown as Figure.

2018-02-14 16:53

2018-02-14 16:53

After installed Mosquitto broker, we can test whether the Mosquitto broker works properly or not as following:

Step -1: Subscription test

⑤ Open a Windows Command Prompt (window-A), go to Mosquitto installation directory (default installation directory is C:\Program Files (x86)\mosquitto) and input command as below

mosquitto_sub.exe -h localhost -t /mytopic/1

Step -2: Notification test

⑥Open a new Windows Command Prompt (window-B), go to Mosquitto installation directory (default installation directory is C:\Program Files (x86)\mosquitto) and input command as below

mosquitto_pub.exe -h localhost -t /mytopic/1 -m "Hello MQTT test"

Step -3: Check whether there is ‘Hello MQTT test’ received in window-B as shown as Figure.

2018-02-14 16:53

Node JS Installation

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. In contrast to multi-thread based servers, node.js operating on a single thread using non-blocking I/O calls allows it to support tens of thousands of concurrent connections. With node.js, users don’t need worry about the dead-locking of processes because almost no function in node.js directly performs I/O so there is no locks problem at all and therefore, scalable systems can be reasonably developed through node.js.

Node.js was originally written by developer Ryan Dahl in 2009 and distributed as an open source and currently a diverse of modules developed from contributors are included covering file system I/O, networking, binary data (buffers), cryptography and data streams etc.

For more details about Node.js, please visit Node.js homepage as show as Figure.

2018-02-14 16:53

A number of versions (binary/source) support for different platforms are provided in NodeJs Downloads page as shown as Figure. Users can download a preferred version from here and install it following set up wizard.

2018-02-14 16:53

After installation of Node.js, check the system environment variables table (here taking Windows system as an example) to ensure that the installation path of node.js (default is C:\Program File\nodejs) is already added automatically in PATH environment variable and if there is no node.js path, update the PATH with node.js path as shown as Figure.

To test whether Node.js is installed properly, open a Windows Command Prompt window and under the user directory, run node command to enable node.js mode. In the node.js mode, input console.log("hello node.js"); if receives response hello node.js then it indicates the Node.JS are installed and works properly.

2018-02-14 16:53

2018-02-14 16:53

Mobius Installation

Mobius server platform is distributed with the source code package in OCEAN alliance website (http://www.iotocean.org) or the Mobius GitHub (https://github.com/IoTKETI/Mobius ).

User can download the zipped package and configure the Mobius server in terms of communication port and CSE name etc. following this Mobius user guide.

2018-02-14 16:53

After downloading, unzip the package and you will see the included folders and files as Figure 30. The roles of files are introduced in Table.

2018-02-14 16:53

The unzipped node.js files can be directly executed without any additional compiling operation. But there are several node.js modules are not yet installed. To installed the required additional node.js modules, open a Windows command prompt window and go to the directory where the unzipped package and run npm install command as shown as Figure Run npm install command to install additional node.js modules. <.br>

2018-02-14 16:53

After running the npm install command, all additional required node.js modules will be generated and stores in node_modules folder as shown as Figure 32 Installation of additional node.js modules You can see there is a node_modules folder in the unzipped mobius source folder as shown as Figure.

2018-02-14 16:53

2018-02-14 16:53

Until this step, we have installed all required software and modules to run Mobius server. Users can run node mobius.js in the command line to activate the Mobius server. The installation of Mobius server is almost done and only a few configurations are left.

Clone this wiki locally