This repository houses the historymod module used in the 2st release of the FIWARE Live Demo. This is an adhoc component created for storing historical information about the lamppost sensors making possible the visualization of that data using the "Linear Graph" widget used in this Demo. Take into account that this component can be avoided using current FIWARE capabilities.
See the main FIWARE Live Demo repo for detailed information.
This module is implemented using Node.js and the ngsijs Javascript library.
Download it from github either by:
- downloading the zip file generated by github
- or by cloning the git repository: $ git clone https://github.com/wirecloud-fiware/historymod.git
This component need to store the historical information on a database. Currently, historymod only supports MySQL.
Once installed mysql, you must create an empty database and populate it using the provided historymod.sql file. e.g.:
$ mysql -u db_user -p database_name < path_to_historymod.sql;
Next step is to update the historymod.config
file. At least you'll have to
change the preferences related to the database configuration and about the
NGSI server the historymod is going to use as datasource. This is an example
of a possible setup:
// mysql DB config
GLOBAL.DB_USER = 'mysql_user';
GLOBAL.DB_PASSWORD = 'mysql_user_pass';
GLOBAL.DB_NAME = 'mysql_database_name';
// NGSI SERVER
GLOBAL.NGSI_URL = 'http://orion.ld.testbed.fi-ware.org:1026';
// Service config
//GLOBAL.SERVICE_URL = null; // Auto detect
GLOBAL.SERVICE_URL = 'http://historymod.ld.testbed.fi-ware.org';
GLOBAL.SERVICE_PORT = '80';
The default GLOBAL.SERVECE_URL
and GLOBAL.SERVICE_PORT
values are usually
valid without requiring any modification. Anyway, this information is used for
registering the historymod component into the configured NGSI server.
The best way for installing the historymod depdencencies is running the following command on the historymod's root folder:
$ npm install
$ npm run start
For any question, bug report, suggestion or feedback in general, please contact with Álvaro Arranz (aarranz at conwet dot com).
This code is licensed under GNU Affero General Public License v3 with linking exception. You can find the license text in the LICENSE file in the repository root.