Contents

Recipes are community-created content. They are neither monitored nor endorsed by IBM. If you find inappropriate content, please use Report Abuse to let us know. For more information on community content, please refer to our Terms of Use.

Overview

Skill Level: Beginner

Beginner

This recipe is going to connect your Edgent on Pi to the Streaming Analytics Service.

Ingredients

Step-by-step

Introduction

This recipe is going to pick up where our Apache Edgent on Pi to Watson IoT Platform recipe left off from. Your Raspberry Pi is sending useful information to Watson IoT, so now we want to do some back end processing using the Streaming Analytics Bluemix service.

Apache Edgent (incubating*) is made for running analytics at the edge, but there are a lot of cases where you need a centralized streaming analytics hub–that’s where the Streaming Analytics service comes in. Using the IBM Streams-powered Streaming Analytics service opens you up to dozens of toolkits and several hundred operators that are already made to connect to the messaging servers and databases you care about, run the analytics you want, and much more.

@Aarushi_Mittal, it shouldn’t matter where you write your code. The build/run commands provided should be sufficient. The job gets submitted using a REST API and the actual job runs on Bluemix. Feel free to post errors in your comments to provide more context.

i need streams installed ..
where do i install it ? on my windows machine ?
Also how to proceed further?
i coded on eclipse, but i dont have streams so it wont compile correctly. also the code does not receive any readings that pi is sending to watson iot? I did not understand that piece of architecture.

Also how are Streaming analytics service , my eclipse project and the Part 1 setup( code running on raspberry pi that i sending data to IoT Watson Platform) communicating ?
What is the architecture there ?

Exception in thread “main” java.lang.Error: Unresolved compilation problems:
JSONObject cannot be resolved to a type
The method transform(Function) from the type TStream refers to the missing type JSONObject
This lambda expression refers to the missing type JSONObject
JSONObject cannot be resolved to a type
The method getPayload() from the type DeviceEvent refers to the missing type JSONObject
The method aggregate(Function<List,A>) in the type TWindow is not applicable for the arguments (new Function<List,Double>(){})
JSONObject cannot be resolved to a type
JSONObject cannot be resolved to a type
The method getPayload() from the type DeviceEvent refers to the missing type JSONObject
Cannot infer type arguments for HashMap
The method put(String, File) is undefined for the type Map
The method put(String, String) is undefined for the type Map
ANALYTICS_SERVICE cannot be resolved or is not a field