Skip to content

MichaelFitzurka/IoT_Demo_AllInOne

 
 

Repository files navigation

IoT Demo - Gateway

Purpose

This repository is a combined version of the following three IoT Demo repositories:

these three are designed to run in three different places to represent a proper 3-Tier IoT Scenario.

For simpler demonstration and evaluation, this repo is build to run all on one system with all elements separeted in their own Docker-based container.

These capabilities needed implemented out of a set of Red Hat JBoss products, each taking over an important part in the IoT landscape

Overview

In addition, you can run another element of this IoT-Demo, a Dashboard, made with InfluxDB and Grafana

Overview with Dashboard

Hardware requirements

As this setup consists of 7 running containers, each hosting a full-blown version of a Red Hat JBoss product, you will want to run it on at least

  • 2 CPU ( physical or virtual )

  • 12 GB RAM

I personally am running it with amazing response times in a VM ( 2 vCPU, 12GM ) on a Macbook Pro

Software requirements

Your host server for this demo will need to have

  • git

  • Maven ( I’m on V 3.3.9 )

  • Ansible ( I’m on V 2.0.0.2 )

  • Docker ( I’m running docker-machine V1.9.1 )

  • docker-compose ( I’m running V1.5.2 )

Warning
If you run the Ansible script with something else then root ( which you can), please make sure, that your user is capable of running the docker commands.
Warning
In demo setups and to reduce complexity, you might want to consider to deactivate firewall on your system. If you don’t please to open up the following port: 1883 ( my default port for MQTT )

Build procedure

Clone Master Repo

To start with this All-In-One IoT Demo, you will have to clone this repo

Patricks-MacBook-Pro:Demos psteiner$ git clone https://github.com/PatrickSteiner/IoT_Demo_AllInOne.git
Cloning into 'IoT_Demo_AllInOne'...
remote: Counting objects: 27, done.
remote: Compressing objects: 100% (21/21), done.
remote: Total 27 (delta 6), reused 21 (delta 3), pack-reused 0
Unpacking objects: 100% (27/27), done.
Checking connectivity... done.

Provide Red Hat JBoss Products

You will have to copy the following products into their needed location

Building the All-In-One Demo

I have provided an Ansible playbook for your convenience, so all you need to run is

Patricks-MacBook-Pro:IoT_Demo_AllInOne psteiner$ cd Ansible/
Patricks-MacBook-Pro:Ansible psteiner$ ansible-playbook demo.yml

...

PLAY RECAP *********************************************************************
localhost                  : ok=17   changed=9    unreachable=0    failed=0
Caution
Fedora / RHEL Users

Fedora and RHEL for security reasons requires root privileges to run docker (your user must be a sudoer). So in those envs, you have to issue the following command and type in your credentials:

$ ansible-playbook demo_root.yml --ask-become-pass

Configure the environment

In general this demo is build so you do not need to do anything, unless you integrate the Dashboard. In this case you have to change the file IoT_Demo_AllInOne/docker-compose.yml.

In the section receiver, you will have to change the two values

  • INFLUXDASHBOARD=FALSE to INFLUXDASHBOARD=TRUE

  • INFLUXHOST=<your dashboard IP> to the IP address of your server running the Dashboard logic.

Note

Do not alter any other values, as this will break the demo!

Start Environment

Starting the IoT All-In-One demo is a manual step.

pi@gateway:~ $ cd IoT_Demo_AllInOne
pi@gateway:~/IoT_Demo_Gateway $ docker-compose up -d

To "monitor" the startup or runtime of the Smart Gateway you can use the command

pi@gateway:~/IoT_Demo_AllInOne $ docker-compose logs
bpm_1          | 12:28:55,900 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://0.0.0.0:9990
bpm_1          | 12:28:55,901 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015874: JBoss EAP 6.4.0.GA (AS 7.5.0.Final-redhat-21) started in 98012ms - Started 1106 of 1143 services (82 services are lazy, passive or on-demand)

Once you see the 100% you are good to go!

To access the various Web-UIs you can use the following links

Role URL uid / password

Fuse in Datacenter

http://localhost:8181/hawtio/login

admin / change12_me

Fuse on Gateway

http://localhost:8182/hawtio/login

admin / change12_me

BPM Suite

http://localhost:8080/business-central/kie-wb.html

psteiner / change12_me

phpPgAdmin for Postgres

http://localhost/phpPgAdmin/

psteiner / change12_me

Deploy BPM Process

Until now, I have not found an automated way to build and deploy the business process within JBoss BPM Suite. So to do that, you will have to

  1. Upload IoT_Demo_Datacenter/bpm/LightWorkItemHandler/target/lightWorkItemHandler-1.0.0-SNAPSHOT.jar to the repository of JBoss BPM Suite

  2. Build & Deploy the process from the Project Explorer of JBoss BPM Suite.

Generate Testdata

If you should not have a physical sensor who reports data out IoT Demo, then you can use the provided Software-Sensor, which is just a simple Java programm which produces testdata and sends it to the MQTT Broker of the Gateway.

Please take a look at the file ./run.sh which should be self-explanatory. As the rule to create an alert and with the alert a JBoss BPM process is expecting a temperature reading of >= 27, there is also a script ./runHigh.sh which will do just that.

About

All in one wrapper for the IoT_Demo_* repositories

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 60.5%
  • Shell 39.5%