Envronmental Monitoring with Azure and PowerBI

In the following tutorial, we'll explore how to collect environmental data (humidity, ambient pressure, temperature, and illumination) with multiple Tibbo Project System devices, process it with Azure Stream Analytics and visualize using Power BI in real time.

What you need:

Step 0: Configure and Assemble the TPS

  • Open LTPS Web Interface, select the "Tibbits Layout" tab, and push the "Launch TPS Configurator..." button
  • Setup Tibbits Layout as shown in the screenshot below and click File/Save
    Note: TPS needs to be rebooted to take new Tibbits Layout into effect.
  • Assemble TPS according to the Tibbits Layout
    Attention: it's strongly recommended to shut down TPS before placing/removing Tibbits.

Step 1: First application

Note: Node.JS, Python, and Git are present on every TPS by default, but NPM is not. Install it as descibed here.

Login to the Device with SSH and do:

# Create folder for application
cd /opt/node-apps/
mkdir environment
cd environment

# Install required modules
npm install @tibbo-tps/tibbit-28
npm install @tibbo-tps/tibbit-30
npm install @tibbo-tps/tibbit-35

Create azure-app-0.js file with you application:

var tibbit28 = require("@tibbo-tps/tibbit-28").init("S11");
var tibbit35 = require("@tibbo-tps/tibbit-35").init("S13");
var tibbit30 = require("@tibbo-tps/tibbit-30").init("S15");

setInterval(function(){
    var illuminationData = tibbit28.getData();
    var humidityData = tibbit30.getData();
    var pressureData = tibbit35.getData();
    var dateTime = new Date();

    console.log("Date/Time: "+dateTime);
    console.log("Illumination: "+illuminationData.illumination);
    console.log("Humidity: "+humidityData.humidity);
    console.log("Temperature: "+humidityData.temperature);
    console.log("Pressure: "+pressureData.pressure);
},1000);

Upload it to /environment folder and run:

node azure-app-0.js

Proposed output:

Date/Time: Tue Jul 19 2016 13:50:54 GMT+0000 (UTC)
Illumination: 115
Humidity: 43.755340576171875
Temperature: 28.05670928955078
Pressure: 738.7398681640625