Overview

Skill Level: Intermediate

This article is intended for people who have basic skills in IBM Watson IoT Platform and Streaming Analytics service.

Recipes to enhance Analytics in IBM Watson IoT Platform Before you proceed, evaluate the following analytical recipes that suites your need. Introduction With IBM Streaming Analytics for Bluemix, you can perform real-time analysis on data in motion as part of your Bluemix application. The Streaming Analytics service is powered by IBM Streams, which is […]

Ingredients

Software Requirements:

Information

More than 256MB RAM might be required to deploy this application. If the memory usage exceeds 256MB in the free trial accounts (Bluemix Trial Account and Standard Account), the application might not work as expected.

We suggest that you upgrade to Pay-as-You-Go or Subscription account to enjoy the full-range Bluemix services.

Step-by-step

  1. Recipes to enhance Analytics in IBM Watson IoT Platform

    Note: Before you proceed, evaluate the analytical and cognitive recipes from the list that suites your need. Click on the respective image below,

    llist-of-analytical-recipes            llist-of-cognitive-recipes  

     

    Deploy Watson IoT Platform & Node-RED application on Bluemix

    Now that you have evaluated on your needs wrt Analytic & Cognitive recipes, let us continue on Integrating IBM Streaming Analytics Service with Watson IoT Platform.

    Click on the Create Toolchain button provided below, to quickly deploy the Watson IoT Platform – Node-RED Bluemix starter app. Post successful deployment, you shall have both the above mentioned services, up & running on Bluemix along with a Cloudant NoSQL DB at your disposal.

    Toolchain-8

    Note: If you are a User using the United Kingdom Region in your Bluemix environment, then please make use of the steps mentioned in the IoT Recipe Deploy Internet of Things Platform Starter service on Bluemix to deploy the setup. Alternatively, you can also try using the Deploy to Bluemix button, to deploy the setup under your United Kingdom Region, provided your Jazzhub account is validated. Users of US South Region can ignore this step.

    deploy

  2. Introduction

    With IBM Streaming Analytics for Bluemix, you can perform real-time analysis on data in motion as part of your Bluemix application. The Streaming Analytics service is powered by IBM Streams, which is an advanced analytic platform that custom applications use to quickly ingest, analyze, and correlate information as it is produced by real-time data sources. IBM Streams can handle very high data rates and perform its analysis with predictable low-latency, so your application can operate at the speed of data.

    In this recipe, we show how to use the Streaming Analytics service to analyze the events published by IoT devices, on the IBM Watson IoT Platform. IBM Watson Internet of Things Platform is a fully managed, cloud-hosted service that makes it simple to derive value from Internet of Things (IoT) devices. The platform provides simple, but powerful application access to IoT devices and data. The following diagram shows the components involved in the integration.

     

    As shown, the IoT devices “Washing Machines” will publish various sensor events to IBM Watson IoT Platform. In absence of an actual device, we have provided a simulator which keep pumping in the events. Following are the different events that the Washer will publish to Watson IoT Platform.

    • Fluid events having flowrate, hardness, fluidlevel and temperature.
    • Voltage events having voltage and frequency.
    • Mechanical events having the drum speed.

    The IBM Streaming Analytics service will consume these events in real-time and perform the following operation,

    • View Events – Displays the events in the Streaming Analytics dashboard.
    • Threshold Based Anomaly detection – Detects the threshold breach and sends a command back to the device to take corrective actions.
    • Anomaly detection – Detects the anomaly by comparing the current set of values with previous set and reports to device using the command.
    • Statistics calculation over a period of time – Aggregates the events for a specified time, computes the statistics and sends back to device as a command.
  3. Register your Device In Watson IoT Platform

    In order to receive the device events in Streaming Analytics service, we need to setup the IBM Watson IoT Platform and register the devices first. This section shows how you can setup the same.

    Open the Bluemix Dashboard and click on the Application service that you have currently deployed (using the Create Toolchain button), if you have already moved away from it. You should see the Watson IoT Platform listed under the Binded Services. Click on the WIoTP service and choose the click on Launch button to launch the WIoTP Dashboard.

    Carry out the steps present in this recipe to register your device in IBM Watson IoT Platform. When the device is registered, you will be provided with the registration details shown below. Make a note of them, we need these details to connect the device to Watson IoT Platform later.

    Generate API Key and Token of Watson IoT Platform

    In order to connect Node-RED application (the Washer device event simulator) and Streaming Analytics service to IBM Watson IoT Platform, we need to generate the API key and token of Watson IoT Platform. This can be achieved by carrying out the steps mentioned in this section – Steps to generate API Key in Watson IoT Platform.

    At this step, we have successfully registered a device in Watson IoT Platform and generated the necessary credentials.

  4. Publish Device data

    In this step, we will access the Node-RED application which will be used to simulate the Washing machine data (device data).

    Access Node-RED application

    Access the Node-RED application by clicking on the View App option available, post deploying your application and then choosing the option Go to you Node-RED flow editor, to access the editor.

    Parallelly, you can also access the Node-RED editor directly by accessing the following URL

     http://<your-application-name>.mybluemix.net/red

    The Node-RED editor opens up a default flow, when you access the editor for the first time. Click on the + sign to create a page and continue with the steps mentioned below:

    Create Node-RED flow

    1. Navigate to the menu at the top right of the screen and select Import from Clipboard. Copy the JSON string from the text area below and paste it into the dialog box in Node-RED and select OK. If there is any error, copy the contents from github.
      [{"id":"c789455c.cc271","type":"ibmiot","z":"c7aada7a.6beb4","name":"coi0nz"},{"id":"b29cc740.e038e8","type":"inject","z":"2c137dae.57f882","name":"Fluid Simulator","topic":"","payload":"{ "d": {"count":0, "hardness": 61, "temperature": 50, "flowrate": 11, "fluidlevel": "acceptable" } }","payloadType":"json","repeat":"1","crontab":"","once":false,"x":288,"y":191,"wires":[["60e09406.323e34"]]},{"id":"ac162366.492e68","type":"ibmiot out","z":"2c137dae.57f882","authentication":"apiKey","apiKey":"c789455c.cc271","outputType":"evt","deviceId":"Washer01","deviceType":"WashingMachine","eventCommandType":"status","format":"json","data":"msg.payload","name":"Washer01","service":"registered","x":794,"y":256.183349609375,"wires":[]},{"id":"dc773943.d36ea","type":"inject","z":"2c137dae.57f882","name":"Voltage Sensor Simulator","topic":"","payload":"{ "d": { "voltage": 240, "frequency": 50 } }","payloadType":"json","repeat":"3","crontab":"","once":false,"x":267.66668701171875,"y":266.1000061035156,"wires":[["635911fd.d2da9"]]},{"id":"f4d58de2.24b028","type":"inject","z":"2c137dae.57f882","name":"Mechanical Sensor Simulator","topic":"","payload":"{ "d": { "speed": 1200 } }","payloadType":"json","repeat":"5","crontab":"","once":false,"x":275.66668701171875,"y":350.1000061035156,"wires":[["f8c050ab.54cd7"]]},{"id":"60e09406.323e34","type":"function","z":"2c137dae.57f882","name":"Fluid data","func":"// initialise the counter to 0 if it doesn't exist alreadynvar count = context.get('count')||0;nvar hardness = context.get('hardness')||0;nvar randomness = context.get('randomness')||0;ncount += 1;n// store the value backncontext.set('count',count);n// make it part of the outgoing msg objectnmsg.payload.d.count = count;nif(count % 300 == 0) {n context.set('randomness',1);n context.set('hardness', 83);n} else if(count % 20 == 0) {n context.set('randomness',0);n} else if(count % 121 == 0) {n context.set('randomness',2);n context.set('hardness', 100);n}nnif(randomness == 0) {n // no variationn msg.payload.d.hardness = Math.floor(Math.random() * (80 - 70 + 1) + 70);n} else if(randomness == 1) {n // gradually increasen msg.payload.d.hardness = hardness + 1;n context.set('hardness', (hardness + 1));n} else {n msg.payload.d.hardness = hardness + 5;n context.set('hardness', (hardness + 5));n}nmsg.payload.d.temperature = Math.floor(Math.random() * (100 - 80 + 1) + 80);nnmsg.payload = JSON.stringify(msg.payload)nmsg.eventOrCommandType = "fluid"nreturn msg;","outputs":1,"noerr":0,"x":509.5500183105469,"y":190.48333740234375,"wires":[["ac162366.492e68"]]},{"id":"635911fd.d2da9","type":"function","z":"2c137dae.57f882","name":"Voltage data","func":"// initialise the counter to 0 if it doesn't exist alreadynvar count = context.get('count')||0;ncount += 1;n// store the value backncontext.set('count',count);n// make it part of the outgoing msg objectnmsg.payload.d.count = count;nif(count % 100 <= 90) {n msg.payload.d.voltage = Math.floor(Math.random() * (240 - 220) + 220);n} else {n msg.payload.d.voltage = Math.floor(Math.random() * (260 - 240) + 240);n}nmsg.payload.d.frequency = Math.floor(Math.random() * (80 - 60 + 1) + 60);nmsg.payload = JSON.stringify(msg.payload)nmsg.eventOrCommandType = "voltage"nreturn msg;","outputs":1,"noerr":0,"x":515.5500183105469,"y":265.98333740234375,"wires":[["ac162366.492e68"]]},{"id":"f8c050ab.54cd7","type":"function","z":"2c137dae.57f882","name":"Drum data","func":"// initialise the counter to 0 if it doesn't exist alreadynvar count = context.get('count')||0;ncount += 1;n// store the value backncontext.set('count',count);n// make it part of the outgoing msg objectnmsg.payload.d.count = count;nif(count % 100 <= 90) {n // No variation - within the safe limitn msg.payload.d.speed = Math.floor(Math.random() * (1100 - 1000) + 1000); n} else {n msg.payload.d.speed = Math.floor(Math.random() * (1300 - 1150) + 1150); n}nnnmsg.payload = JSON.stringify(msg.payload)nmsg.eventOrCommandType = "drum"nreturn msg;","outputs":1,"noerr":0,"x":518.5500183105469,"y":349.98333740234375,"wires":[["ac162366.492e68"]]}]
    2. This imported flow simulates the following 3 different sensor values,
      • Fluid Simulator – Provides events having flowrate, hardness, fluidlevel and temperature
      • Voltage Simulator – Provides events having voltage and frequency
      • Mechanical Simulator – Provides events having the drum speed
    3. The Function nodes present in the flow adds randomness and includes a counter for each of the sensor values.
    4. Note that this imported flow is not complete. Double click on Washer01 node and enter the Watson IoT Platform credentials, such as API Key and API Token as shown below. Also, modify the Device Id and Device Type if its different from what is registered in your Watson IoT Platform.
    5. Once you deploy, the events will be dispatched to Watson IoT Platform. In order to view the same in debug panel of Node-RED, import the following flow, If there is any error, copy the contents from github.
      [{"id":"69e83d29.0cfc84","type":"ibmiot","z":"bde43eb4.bdc838","name":"coi0nz"},{"id":"e568cc5f.ffd4c8","type":"debug","z":"bde43eb4.bdc838","name":"Debug","active":true,"console":"false","complete":"payload","x":564,"y":545,"wires":[]},{"id":"f8bd90ed.256ec","type":"ibmiot in","z":"bde43eb4.bdc838","authentication":"apiKey","apiKey":"69e83d29.0cfc84","inputType":"evt","deviceId":"","applicationId":"","deviceType":"+","eventType":"+","commandType":"","format":"json","name":"Subscribe and print events in Debug Panel","service":"registered","allDevices":true,"allApplications":"","allDeviceTypes":true,"allEvents":true,"allCommands":"","allFormats":"","x":272,"y":544.5,"wires":[["e568cc5f.ffd4c8"]]}]
    6. Observe that the following flow is added to the existing flow. Modify the API Key as shown above and click deploy.
    7. Observe that the events are printed out in the debug panel of the Node-RED editor,

    In this step, we have successfully created a Node-RED application to simulate the Washing Machine data to Watson IoT Platform.

  5. Onboard Washer events to IBM Streams service

    In this step, we will create the IBM Streaming Analytics service in Bluemix and onboard the Washer data, published on IBM Watson IoT Platform.

    Create Streaming Analytics service

    The Streaming Analytics service is powered by IBM Streams, which can analyze millions of events per second, enabling sub-millisecond response times and instant decision-making. Also, allows one to view information and events as they unfold.

    1. In Bluemix, click Catalog and select Streaming Analytics service under Data and Analytics section as shown below,streaming
    2. Click Create to create the service,
    3. Make sure that the service is started, If not click Start button to start the service,
    4. Click Launch to enter into the Streams Console, where we can submit and manage the jobs.

    Submit IoTPlatform application job

    In this recipe we use streamsx.iot toolkit to build applications that integrates Watson IoT Platform with IBM Streaming Analytics service. This toolkit uses the streaming publish-subscribe model within IBM Streams applications to separate connectivity to the specific IoT service from analytical applications. An independent application connects to the message hub and publishes streams for device events, device commands and device status (if supported by the message hub). Analytics applications then subscribe to device events and or commands of interest.

    We will launch a pre-built IoTPlatform application that will connect to your Watson IoT Platform service and act as the independent connection application. The analytics application we write wont need any IoT Platform connection information, other than the stream we want to subscribe to, because all communication with Watson IoT Platform will all be handled by this application.

    1. Download the IoTPlatform streaming application bundle com.ibm.streamsx.iot.watson.apps.IotPlatform.sab and store it in your system.
    2. Go to the Streaming Analytics service dashboard, click Submit Job and then the Browse button as shown below,
    3. Upload the com.ibm.streamsx.iot.watson.apps.IotPlatform.sab file and click Submit,
    4. Observe that the Streaming analytics service prompts you to enter Watson IoT Platform Organization, API-Key and Auth-Token as shown below,
    5. Enter the details that you noted in the previous step and click OK.
    6. You will see your Streams graph in the top right. All operators should be healthy. You can expand the graph for a better view and more details.

    We are now connected to the instance of the Watson IoT Platform service, so the next step is to build an application that connects and processes a specific data stream.

  6. View Device events

    In this step we will load a simple Streaming application job that allows the user to view the IoT device events in the dashboard.

    The @view annotation allows one to view the events in the Streaming console and also analyze streaming data in external programs such as Microsoft Excel. In this section we use the @view annotation to chart the Washer’s temperature data on the Streaming Analytics dashboard. For more information about the View annotation, refer to the documentation page.

    1. Download and submit the ViewEvents application into the Streaming Analytics service by following the same steps that you followed earlier. The source code of this application is present here.
    2. Observe the Streams graph for the newly submitted application as follows,
    3. As shown, the application subscribes to all the device events from the given Watson IoT Platform, filters the events based on the type and then creates the views using the @View annotation. Here is the code sample that uses the @View annotation to create the view for FluidData,
      @view(name = "FluidEvents", port = DeviceFluidData, sampleSize = 5, bufferSize = 50)
      stream<DeviceEventTs, FluidData> DeviceFluidData = DeviceEventExtractData(Events) {
      param
      dataType: FluidData;
      events: eventId == "fluid";
      }
    4. In order to view the events, Go to Streams Tree view, maximize and expand the Views as follows,
    5. This will add a new card in the dashboard where we can view the device events in real-time. By default the table view is added as shown below,
    6. But we can create a chart for better visualization by clicking the chart icon present in the DeviceFluidData.FluidEvents card view and configuring the chart as follows,
    7. Observe that the chart view is added into the dashboard and the temperature values are plotted as the data arrives.

    In this step, we saw how to view the IoT Device events in Streaming Analytics service console using the @View annotation. In the next section, we will show how to detect the anomalies and send a command back to the device to take remedy action.

  7. Threshold based Anomaly detection

    In this step, we will see how to detect the anomalies and send a command back to the device to take corrective action.

    One can use the Filter operator to detect the threshold based deviations. The Filter operator removes tuples from a stream by passing along only those tuples that satisfy a user-specified condition. For more information about the Filter operator refer to the documentation. To demonstrate the Rule based anomaly detection, we define the following rules,

    • Send a stop-drum command along with reason when the voltage crosses 240 Volt.
    • Send a stop-drum command when the drum speed crosses 1200 spin speed.
    • Send a command to add fluid softener when the hardness of the water is more than 100 ppm.

    Submit Anomaly detection job

    1. Download and Submit the RuleBasedAnomalyDetection sample application bundle into the Streaming Analytics dashboard by following the same steps that you followed earlier. The source code of this application is present here.
    2. Observe the following Streams graph in the console,
    3. As shown, the Streaming application filters the event based on the threshold values in real-time and sends appropriate commands back when the threshold is crossed. Following snippet shows the voltage rule definition using the Filter operator.
       // Get voltage tuples greater than 250
      stream<DeviceEventTs, VoltageData> VoltageAnamoly = Filter(DeviceVoltageData)
      {
      param filter : voltage > 250;
      }
    4. You can view the commands sent by the Streaming application using the Node-RED by carrying out the steps mentioned in the next section.

     

    Add Node-RED flow to view commands

    In this sub section we will just add a Node-RED flow to receive the commands(but don’t take any actions) to showcase that the commands are actually sent by the Streaming Analytics application when the threshold levels are crossed.

    1. In order to view only the commands in the debug panel, first stop the device events output by clicking on the debug node as shown below,
    2. Then, Import the following flow to display the commands into the debug panel of Node-RED. If there is any error, copy the contents from github.
      [{"id":"9ebe87eb.c34f18","type":"ibmiot","z":"eabb8159.dbe618","name":"coi0nz"},{"id":"28329f06.c93b1","type":"ibmiot in","z":"eabb8159.dbe618","authentication":"apiKey","apiKey":"9ebe87eb.c34f18","inputType":"cmd","deviceId":"","applicationId":"","deviceType":"+","eventType":"result","commandType":"","format":"json","name":"IBM IoT","service":"registered","allDevices":true,"allApplications":"","allDeviceTypes":true,"allEvents":true,"allCommands":true,"allFormats":true,"x":296.1166687011719,"y":258.1166687011719,"wires":[["ecf76993.5b49"]]},{"id":"ecf76993.5b49","type":"debug","z":"eabb8159.dbe618","name":"Debug","active":true,"console":"false","complete":"payload","x":472.4166564941406,"y":257.9166717529297,"wires":[]}] 
    3. Click on the IBM IoT node and modify the Watson IoT Platform credentials with your organization credentials. Then click ok.
    4. Observe that the commands are received as and when the threshold values are crossed and the same is displayed in the debug panel of the Node-RED flow editor. For example, you might observe something like below,
      iot-2/type/WashingMachine/id/Washer01/cmd/add/fmt/json : msg.payload : Object{ "reason": "Water hardness 120 is great than 100", "component": "fluid-softener" } 

    In this step, we have successfully detected events crossing the threshold and published a command back to device to take corrective action.

  8. Automated Anomaly detection

    In this step we will see how to use AnomalyDetector operator to detect deviations automatically.

    An anomaly is a deviation from the standard behavior of a system. Automated anomaly detection in critical systems is highly recommended because large systems are difficult to monitor with traditional means (i.e setting threshold for each data point), given that the monitoring process must deal with data that include many variables at each instant. One can use the AnomalyDetector operator which is capable of performing online anomaly detection of a time series. More specifically, the AnomalyDetector operator reports anomalies with the pattern of the incoming IoT data.

    The AnomalyDetector operator maintains a recent history of the input time series, which is referred to as the reference pattern. Whenever the AnomalyDetector ingests a tuple, that tuple is added to a buffer called the current pattern (the current pattern is essentially the most recent set of data points received). When this occurs, the operator compares the current pattern with the reference pattern. This comparison operation calculates a score that indicates how similar or dissimilar the current pattern is compared with the reference pattern. The higher the score, the more dissimilar the patterns are.

    1. Download and Submit the AnomalyOperatorSample sample application bundle into the Streaming Analytics dashboard by following the same steps that you followed earlier. The source code is this application is present here.
    2. Observe the following Streams graph in the console,
    3. As shown in the graph, this application receives all the device events from Watson IoT Platform, filters the Fluid hardness data, compares the current set of data with the reference set using the AnomalyDetector operator and publishes a command back to the device to stop washing when the current set of values deviates from the reference set. Following code snippet shows a sample anomaly detection definition for “fluid hardness” data.
       (stream<list<float64> subsequence, uint64 startTime, uint64 endTime,
      float64 score, rstring deviceId, rstring typeId> AnomalyDetector_2_out0) as AnomalyDetector_2 =
      AnomalyDetector(Functor_4_out0 as inPort0Alias)
      {
      param
      referenceLength : 50ul ;
      inputTimeseries : hardness ;
      patternLength : 10ul ;
      inputTimestamp : t ;
      confidence : 8E5;
      output
      AnomalyDetector_2_out0 :
      subsequence = getSubsequence(),
      startTime = getStartTime(),
      endTime = getEndTime(),
      score = getScore(),
      typeId = typeId,
      deviceId = deviceId;
      }

      (stream<uint64 t, float64 hardness, rstring deviceId, rstring typeId> Functor_4_out0) as Functor_4 =
      Functor(HardnessData)
      {
      logic
      state :
      {
      mutable uint64 cnt = 0ul ;
      }

      onTuple HardnessData :
      {
      cnt ++ ;
      }

      output
      Functor_4_out0 : t = cnt ;
      }
    4. Observe the following command in the Node-RED debug panel to stop the Washer whenever the hardness values deviate much. Note that the following message is print only when the deviation is detected, so might take a while.
      { "reason": "anomaly detected in fluid hardness", "score": 2557942.5136039816, "startTime": 348, "endTime": 357, "subsequence": [ 74, 76, 105, 110, 115, 120, 125, 77, 73, 77 ] } 

      (As you can see some of the values (>100) in the sequence are well above the normal sequence(70-80))

    5. Also, as shown in the graph, the application prints the abnormal sequences in the console, in order to view the same, click Log Viewer and then corresponding AnomalySequence log as shown below,

    In this step, we saw how to use AnomalyDetector operator to detect the Fluid hardness deviation in real-time. You can refer to this article for more information about the AnomalyDetector operator.

  9. Event Aggregation

    In this step we will show how to aggregate events over a period of time and calculate statistics like, Average, minimum, maximum and standard deviation of the sensor value(s).

    One can use the Aggregate operator to compute user-specified aggregations over tuples that are gathered in a window. To demonstrate the aggregation functionality, this step computes the average, minimum, maximum and standard deviation of voltage and drum speed over a minute. For more information about the Aggregate operator refer to the documentation.

    1. Download and Submit the EventAggregation application bundle into the Streaming Analytics dashboard by following the same steps that you followed earlier. The source code of this application is present here.
    2. Observe the following Streams graph in the console,
    3. As shown, the application extracts the Drum and Voltage events, aggregates the events over a minute, then calculates the statistics. Following snippet shows how the statistics information are calculated for the drum-speed using the Aggregate operator.
       // Calculate Avg, min, max and stddev of drum events tumbling every minute.
      stream<StatisticsInfo> DrumStatistics = Aggregate(DeviceDrumData)
      {
      window DeviceDrumData: tumbling, time(minutes(1));
      param
      groupBy: typeId, deviceId, eventId;
      output DrumStatistics:
      typeId = typeId,
      deviceId = deviceId,
      name = "speed",
      count = Count(),
      avg = Average(speed),
      max = Max(speed),
      min = Min(speed),
      standardDev = SampleStdDev(speed);
      }
    4. Observe that the application computes and publishes the voltage and drum-speed statistics every 1 minute with a command statistics.
      { "avg": 1156, "min": 1013, "max": 1296, "standardDev": 104, "name": "speed", "count": 9 }
      { "avg": 229, "min": 221, "max": 239, "standardDev": 4, "name": "voltage", "count": 12 }

    In this step, we saw how to compute a statistical information over a period and send it back to the device.

  10. Conclusion and the Road Ahead

    This recipe shows how to integrate IBM Watson IoT Platform with IBM Streaming Analytics service, to quickly ingest, view, analyze and report anomalies of IoT sensor data in realtime before an (unacceptable) event occurs. Developers can take a look at the code available in the github repository to understand whats happening under the hood. Developers can consider this recipe as a template for integrating Streaming Analytics service with IBM Watson IoT Platform. They can modify the existing Streaming application files (SPL) depending upon the use case.

    As a next step, go through the following Analytical recipes,

    1. Getting started with Streaming Analytics and the Internet of Things – showcases how to integrate the Watson IoT Platform and Streaming Analytics service with a different sample.
    2. Connect Apache Quarks on Pi to the Streaming Analytics Service – showcases how to analyze the sensor data from the edge.
    3. Engage Machine Learning for detecting anomalous behaviors of things – showcases how one can make use of the Predictive Analysis service, available on the IBM Bluemix, to determine the hidden patterns on the events published by IoT devices, on the IBM Watson IoT Platform.

4 Comments on "Integrate IBM Streaming Analytics Service with Watson IoT Platform"

  1. Aarushi_Mittal May 11, 2017

    Great Tutorial
    How do i go about if i want to create my own application ?

  2. YMDH_sathish_Palaniappan May 12, 2017

    Please refer step https://developer.ibm.com/recipes/tutorials/integrate-ibm-streaming-analytics-service-with-watson-iot-platform/#r_step5 that shows how to onboard the events into Streaming analytics service from Watson IoT Platform.

    In this recipe we used streamsx.iot toolkit to build applications that integrates Watson IoT Platform with IBM Streaming Analytics service. This toolkit uses the streaming publish-subscribe model within IBM Streams applications to separate connectivity to the specific IoT service from analytical applications. An independent application connects to the message hub and publishes streams for device events, device commands and device status (if supported by the message hub). Analytics applications then subscribe to device events and or commands of interest.

    The toolkit provides a pre-built IoTPlatform application that will connect Streaming analytics service to your Watson IoT Platform service and act as the independent connection application. The analytics application that you write wont need any IoT Platform connection information, other than the stream that you want to subscribe to, because all communication with Watson IoT Platform are handled by this application.

    Similarly if you want to send a command to the device, refer to this application – https://developer.ibm.com/recipes/tutorials/integrate-ibm-streaming-analytics-service-with-watson-iot-platform/#r_step9

Join The Discussion