Syndication

Last week we organized IoT hackathone (+ workshop) with Intel. The idea was to show how to build real-life IoT solution on Intel’s Edison Board connected to Azure Event Hub.

We created a simple Node.js application running on Edison board, by using Intel’s XDK IoT Edition. The full tutorial, which describes how to start tithe board including installation of required tools can be found here.

In this project we used an analog temperature sensor, which periodically delivers a temperature and posts it as event stream to Azure EventHub, by using service bus JS sdk

From there, we redirected a stream to Azure Stream Analytics and evaluated runtime data. Finally result of evaluation delivered a hot-path events, which generate alerts when temperature exceeds 26 degree Celsius for more than 3 times in 2 minutes.

To be able to implement an IOT solution we used Intel’s ‘mraa’ Node.js library. Here is an example, which shows how to setup ‘mraa’. As next we define variable ‘button’ as GPIO input. Then we start blinking of LED on GPIO3 with period of 1 second.

Here is the source code of the Node.js application., which we used in hackathon to read temperature and push event stream of temperature values to Azure Event Hub.

---------------------------------------------------------------- -- Move all critical events to PowerBI -- Critical is when we get more than 5 hot events in 15 seconds ---------------------------------------------------------------- SELECT DateAdd(second,-300,System.TimeStamp) as WinStartTime, system.TimeStamp as WinEndTime, DeviceName, MAX(temperature) as MaxTemperature, Count(*) as EventCount

INTO criticaleventsbiout

FROM CriticalEvents

GROUP BY TumblingWindow(second, 300), DeviceName HAVING [EventCount] >=15