kutluo / PEMS

Portable Energy Management (and Monitoring) System

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Portable Energy Management (and Monitoring) System

CircleCI codecov

"The Portable Energy Management System is designed to maintain human life in rough terrain for an unlimited amounts of time." - Dr. David Davis

This repository contains the source for running the PEMS server and user interface. It allows the continuous monitoring and management of systems contained in a Pod, alerting its consumers of environmental and power concerns.

Getting Started

Starting development on PEMS is very simple. All prerequisites freely available, and you don't require a web server such as TomCat to run it.

Prerequisites

  • Java JDK 8 (OpenJDK or Oracle)
  • MongoDB ≥ 3.4
  • Yarn ≥ 1.0.0

Get the Source

git clone https://github.com/ICTD-Maroubra/PEMS

Server

NOTE: The server requires a Linux environment with BlueZ ≥ 5.37 installed if you wish to make use of the bluetooth monitoring module.

cd pems-server
./gradlew build
./gradlew run

For more documentation on the server's API, you can navigate to http://HOST:PORT/api-browser when running the server.

Configuration

The following table lists environment variables that can be set to configure the server.

Option Default Description
PEMS_HOST 0.0.0.0 The pems server host IP
PEMS_PORT 9005 The pems server port
PEMS_MONGODB_CONNECTION mongodb://0.0.0.0:27017 MongoDB connection string
PEMS_MONGODB_DATABASE pems MongoDB database to use
PEMS_BLE_ENABLED false Bluetooth connections enabled (requires Linux w/ Bluez)

Interface

cd pems-interface
yarn install && yarn start

Running Tests

Server

cd pems-server
./gradlew test

Interface

cd pems-interface
yarn install && yarn test

Deployment

Deploying PEMS is a multi stage process:

  • API/Monitoring Server
  • Interface Application

Server

PEMS server requires a Linux environment with BlueZ ≥ 5.37 installed. An easy way to deploy has been provided through a Docker image.

NOTE: Due to issues with device sharing in both MacOS xhyve and Windows Hyper-V virtualization layers, Docker for Mac and Docker for Windows will not be able to make use of the bluetooth devices for monitoring.

First build the image:

cd pems-server
./gradlew build
cd ../
docker build -t pems-server .

Then run the container:

docker run pems-server

Interface

To build installers:

cd pems-interface
yarn install && yarn dist

Contributing

TBC

License

MIT License

Copyright (c) 2017

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Acknowledgement

This project would not be possible without the contributions made by following individuals:

About

Portable Energy Management (and Monitoring) System


Languages

Language:Java 95.3%Language:HTML 3.6%Language:JavaScript 0.7%Language:Shell 0.4%