Name: iot-edge-predictive-models-dsx
Owner: International Business Machines
Description: Advanced analytics can be applied in various areas of IoT like "Change Point detection using IoT Sensor data" and "Predictive Analytics using IoT Sensor data". Once a Descriptive or Prescriptive model outcome is arrived, it needs to be translated into action. This journey demonstrates how such a communication to the Edge layer can be implemented.
Created: 2017-12-19 15:56:06.0
Updated: 2018-05-11 10:40:50.0
Pushed: 2018-05-11 10:40:49.0
Size: 2275
Language: null
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Internet of Things (IoT) have evolved tremendously in all spheres of our lives like Industrial
applications, Social interactions, Remote management of facilities and equipment to name a few.
In general application areas, IoT data collected by Sensors can be used for monitoring as
well as predicting the outcomes. If any deviation from the norm is detected, corrective action can be
prescribed either manually or by an automated process. Such actions may come out of Rule based anomaly
detection or a Statistical Change point detection or a Predictive model that predicts a faulty
condition ahead of time.
The Process steps for applying Analytics on IoT data can be broadly classified as below
This IBM Code Pattern is a composite pattern that brings together the end to end flow of IoT Analytics systems.
Specifically focussing on points 2,3,4 above.
Image from blog Advanced Analytics Applications in IoT
While Rule based anomaly detection uses point in time data, which may be sudden spike in some parameters
with a possibility of getting back to normal ranges, statistical Change point detection can differentiate
and identify a Change in operating parameters that might not return to normal by itself. And so a more
reliable corrective action can be initiated.
The Statistical method and flow for detecting change points in IoT Sensor data and related steps are
covered in the IBM Code pattern below:
One step further, using Advanced Analytics, predictive models can be built that could predict a failure
condition in an equipment or a system like say a Compressor in a refrigeration unit well ahead of time.
This approach goes a long way in implementing Predictive maintenance which is more prudent approach
than Scheduled Preventive maintenance which is periodic in nature.
Predictive Analytics on IoT is covered in the journey below:
Also, by using multivariate data collected from different sensors mounted on an equipment, more
sophisticated Predictive models can be built that can pinpoint upcoming failure of a specific
equipment or subsystem.
Once an anomaly is detected, a prescriptive action needs to be taken.
This journey in specific covers, Detecting the need for any corrective action and then
communicating Decisions based on Analytics insights to the edge for Automated Action
Users who want to implement this IBM Code pattern are expected to have the below knowledge as
Pre-requisites. Before proceeding, it is strongly suggested to familiarize yourself with the
below pre-requisites.
Emitter
running on Raspberry Pi will collect the CPU temperature sensor data and dispatch it toCollector
flows in Raspberry Pi will also receive commands for action from IoT platformFollow this Video which will walk you through the below steps.
raspberrypi ip address:1880
. In the example shown below the IP address for Raspberry Pi is 192.168.1.26
.
You can check your WiFi router (or hotspot) configuration for the finding the Raspberry Pi IP address.Import ?Emitter? Node-RED flow ?Rpi2BMX? in Raspberry Pi from RPi2BMX.json
Leave the tab that shows this flow open.
Import ?Collector? Node-RED flow ?BMX2RPi? on Raspberry Pi from BMX2RPi.json
This will create a second flow “BMX2RPi” in a second tab. Leave this open as well.
In the flow ?Rpi2BMX?, set the Device ID in the ?event? IoT output node to ?kpedgetobmx20171207?
In ?BMX2RPi? flow, set the ?Device ID? in the ?Receive IBM IoT BMX command to Edge? node to ?kpbmxtoedge20171207?
Make a note of the above 2 Device IDs
You will need them later in Node?RED flow in IBM Cloud
Create
Cloud Foundry App
and the service will be started by default. Visit App URL
in the Service status page. Available Bluemix nodes
. node-red-contrib-ibm-wiotp-device-ops
and click Next
Go to Node-RED flow editor
. You will be presented with a blank Node-RED flow tab As a trial, drag and drop the input node that says ibmiot
into the blank tab Flow 1
.
You can see a description of the functions of this node. You can experiment further to get yourself comfortable with
the flow. Discard or Save any flow you might have created, we will be using from pre-built flows that are made available
in the git repo.
Note: Steps on how to Run the flow is not explained in detail as these are basics covered in the Pre-requisites.
On RPi: Inject in RPi2BMX
flow and see results in debug screen
You must be able to see the CPU temperature in 'C output in the debug section.
On BMX: Inject in BMXReceiveIoTTemp
flow and see results in debug screen
You must be able to see the CPU temperature values received from Raspberry Pi.
Also, the flow will analyze this temperature using rules and outputs a command fanon
or fanoff
depending on the temperature values received.
The logic for doing the same is coded in the flow, which you can explore yourself.
Note: This logic can be replaced with a complex algorithm that can predict an upcoming failure condition
The focus of this Code Pattern is to show the means for implementing the flow and not in the logic itself
and so the complexity of the flows are kept to a minimal.
Users are encouraged to experiment with coding their own logic that suits their specific requirements.
On RPi: Inject BMX2RPi
flow and see results in debug screen
In the debug window, you must be able to see the commands received from the IBM Cloud - Node-RED flow
Confirm the ouputs
See Debugging.md
See Apache 2.0
The following areas are suggested as further enhancement areas for a User to explore by self.
These are consciously been omitted from this IBM Code pattern as thse will require additional
hardware and knowledge of basic electronics