IBMStreams/streamsx.iot.starterkit

Name: streamsx.iot.starterkit

Owner: IBM Streams

Description: Starter kit to help connect Apache Edgent devices with IBM Streams

Created: 2017-10-20 13:29:05.0

Updated: 2017-10-30 16:03:34.0

Pushed: 2018-01-09 21:34:17.0

Homepage: null

Size: 7218

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

streamsx.iot.starterkit

This starter kit simplifies the setup for using the streamsx.iot toolkit to connect Apache Edgent applications with Streams applications.

The recommended way to analyze data from IoT devices running Apache Edgent is to send the data to the Watson IoT Platform. Then, you can retrieve that data from a Streams application running locally or in the Streaming Analytics service in the IBM Cloud, as illustrated below.

Illustration

Deploying this starter kit to the IBM Cloud will set up the Watson IoT Platform and Streaming Analytics services for you. It will also create the credentials you need to connect your Streams and Edgent applications.

If you choose not to deploy the services automatically, or if you are using an on-prem Streams installation, you can follow these instructions to setup Streams and the Watson IoT Platform manually.

Deploy the starter kit

Click the the Deploy to IBM Cloud button below to start deployment. This will take about 10-15 minutes.

Deploy To Bluemix

Note: If you have both services created and would like to use automatic configuration, you need to rename the services to match the names expected by the configuration script before starting the process:

Using the starter kit

After deployment is complete, the best place to get started is the starter kit home page.

View the starter kit home page

To access the home page, you must first create a username and password.

Set a Password

These steps are illustrated below. setusername

Open the home page

Clicking Visit App URL will take you to the home page of your starter kit where you can log in using the KIT_OWNER and KIT_PASSWORD as username and password. After a successful log in, the page appears as follows:

Sample home page

From the starter kit home page, you can try out the sample application and get your credentials.

Using the starter kit to run a complete Edgent-Streams scenario:
  1. Run the IoT sensors sample from Edgent:

  2. Download your device.cfg file from the “View all Credentials” page of the starter kit.

  3. Download and unpack Edgent, choose a binary release

  4. Edgent 1.1.0+: Edit runiotpsensors.sh to uncomment out the line starting with USE_OLD_EVENT_FORMAT,

  5. Run the IoT sensors application:

    edgent>/java8/scripts/connectors/iotp
    uniotpsensors.sh device.cfg
    
  6. Submit the IotPlatform application to your Streams instance. Click “Tools” on the starter kit home page and click Submit IoTPlatform Job if it is not running.

  7. Run a sample Streams appplication in Python, Java, or SPL.

  8. For Python and Java, download credentials for your Streaming analtyics service by clicking “Streams Credentials” > “Download credentials as JSON”.

Using the starter kit to create your own application

You need the following requirements to create your own application:

The IoTPlatform application

This application connects to the Watson IoT Platform to retrieve events from your Edgent application. Then, it publishes the device events as Streams tuples for consumption by other Streams applications. The following diagram illustrates: iotapp

If your Streams application wishes to send a command to the Edgent application, the commands are also sent through the IoTPlatform application. Thus, this application must be running on your instance alongside your Streams application(s).

Click Tools on the starter kit home page and if the application is not running, click Submit IoTPlatform Job.

Note: When submitted from the starter kit home page, the application only runs for 1 hour in order not to incur charges on your IBM Cloud account. To run it indefinitely you must submit it directly to the Streaming analytics service. You will need API keys for the Watson IoT Platform. Download the API keys from the starter kit home page: View All Credentials > Streams Credentials > Download API keys as properties file. This page has manual submission instructions.

Tutorials
  1. Create an Edgent application. Follow this recipe to create an Edgent application that sends data to the Watson IoT platform.

  2. Create a Streams application. Complete the follow up to the Edgent recipe to create a Streams application that processes the data from Edgent.

More Resources
Development information: Run the starter kit app locally

If you would like to modify the node js app locally, you need to have the services created on the IBM Cloud. Then, after cloning the repository:


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.