This is a fun game you can play with your colleagues during a coffee break. Every participant will have a IoT sensor simulation running on his phone and the one able to the most interesting signal (based on anomaly detection) wins.
Here is how to start
1. Create an account on IBM Bluemix using http://ibm.biz/joinIBMCloud
2. Create an Instance of NodeRED and dashDB
a) Login to your Bluemix Account on www.bluemix.net
b) Click on "DashBoard"
c) Click on "Create App"
d) Click on "Web"
e) Click on "Browse Boilerplates"
f) Click on "Browse Boilerplates" again
g) Select "Node Red Starter"
h) Select a unique name (this will be part of the final URL of your app) and click on "Create"
i) Click on "Overview"
j) Click on "Add Service or API"
k) In the search field on top enter "dashdb" and then click on the icon in the bottom
l) Click on "Create"
m) When asked, click on "Restage"
n) Again click on "Overview" and then on the dashDB symbol (you might have to scroll down=
o) Click on "Launch" and keep this tab open, we need it later
p) Once restaging finished, click on the link of your application (based on the name you chose in step h) - in my case it is http://thisisauniquename123.mybluemix.net
q) Click on the red button
Congratulations, the hard work is done!
3. Create the necessary Node-RED flow
b) Copy the JSON contents to your clipboard
c) In the Node-RED flow editor you've opened in step 2 q) select the menu symbol top right, import, clipboard and past the contents of your clipboard, then place the flow in your panel
d) double-click on the TEMPERATURE node and ensure that "SERVICE" contains a valid value (this is all needed to ingest a stream of IoT sensor data into a relational database)
4) Setup dashDB
a) Open your browser tab containing dashDB
b) Click on Table
c) Click on "Add Table"
d) Paste the following DDL and click on "Run DDL"
CREATE TABLE "TEMPERATURE"
e) A "DDL ran successfully" message should apear
f) Now paste the following DDL and click on "Run DDL"
CREATE TABLE "ALERT"
f) Click on "cancel"
g) Click on Analytics
h) Click on "R Script"
i) Click on the "Plus" Symbol
j) Note down the schema name starting with "DASHXXX" and close the popup
k) Copy the contents of this URL to your clipboard https://raw.githubusercontent.com/romeokienzler/developerWorks/master/iotGame.r
l) Replace the contents of the R-Script in your dashDB editor with your clipboard contents
m) Replace DASH105608 in line 5 with the schema name you've noted down in step j) (DASH100164 in my case)
n) Click on "Save"
o) Click on "OK"
p) Click on "Submit", now the script runs on top of your database tables and you should see " NA 0" as Console output
Congratulations, you have setup the whole environment, so let's play the game!
5. Play the game
a) Search some colleges to play with (up to five) and ask them to open the following URL http://bit.ly/iotquickstart
b) Note down the sensor ID you can see top right
c) Return to the Node-RED flow editor of step 2. q) and double-click on one of the five blue IBM IoT symbols, paste the sensor ID from the previous step to the "device ID" field
d) Repeat step a) - c) for each participant and choose always another of the five different IBM IoT symbols
e) Click on deploy and then open the debug pane, you should see sensor data flowing in
f) Now the game can start, ask all participants to create a very abnormal temperature pattern, the most abnormal time series wins!
g) return to your R script in dashDB and click submit - the sensor showing the most abnormal pattern within a sliding window of the last 10 seconds wins