IQP Integration with IBM Watson IoT Platform on Bluemix · IQP Integration with IBM Bluemix® and...

15
1 Copyright 2016 IQP Japan Corporation All Rights Reserved Support e-mail: [email protected] IQP Integration with IBM Bluemix® and IoT Platform IQP Integration with IBM Watson IoT Platform on Bluemix This tutorial explains how to integrate IBM Watson IoT Platform with IQP on Bluemix. Contents 1. Preparation of your IBM Watson IoT Platform ................................................................ 2 2. Connect with “IBM Watson IoT Platform” ...................................................................... 3 Add New Device Type.................................................................................................... 4 Add New Device ID ....................................................................................................... 6 Device ID Information ................................................................................................... 6 3. Preparation of “IQP IoT Code-Free App Development” .................................................... 7 IQP Development Dashboard .......................................................................................... 8 IQP sample applications ................................................................................................. 8 4. Connect between IQP and Watson IoT Platform ............................................................. 9 Troubleshooting - why has connection failed? ................................................................. 11 1.5 Option: How to send data to Watson IoT Platform............................................. 11 5. View Data which you sent from your Device in IQP....................................................... 12 Which entity (table) is the data in? ................................................................................ 13 6. Register for a training seminar ................................................................................... 14

Transcript of IQP Integration with IBM Watson IoT Platform on Bluemix · IQP Integration with IBM Bluemix® and...

Page 1: IQP Integration with IBM Watson IoT Platform on Bluemix · IQP Integration with IBM Bluemix® and IoT Platform The Watson IoT Platform is now ready for API. For the next step, please

1 Copyright 2016 IQP Japan Corporation All Rights Reserved

Support e-mail: [email protected]

IQP Integration with IBM Bluemix® and IoT Platform

IQP Integration with IBM Watson IoT Platform on Bluemix

This tutorial explains how to integrate IBM Watson IoT Platform with IQP on Bluemix.

Contents

1. Preparation of your IBM Watson IoT Platform ................................................................ 2

2. Connect with “IBM Watson IoT Platform” ...................................................................... 3

Add New Device Type .................................................................................................... 4

Add New Device ID ....................................................................................................... 6

Device ID Information ................................................................................................... 6

3. Preparation of “IQP IoT Code-Free App Development” .................................................... 7

IQP Development Dashboard .......................................................................................... 8

IQP sample applications ................................................................................................. 8

4. Connect between IQP and Watson IoT Platform ............................................................. 9

Troubleshooting - why has connection failed? ................................................................. 11

1.5 Option: How to send data to Watson IoT Platform ............................................. 11

5. View Data which you sent from your Device in IQP ....................................................... 12

Which entity (table) is the data in? ................................................................................ 13

6. Register for a training seminar ................................................................................... 14

Page 2: IQP Integration with IBM Watson IoT Platform on Bluemix · IQP Integration with IBM Bluemix® and IoT Platform The Watson IoT Platform is now ready for API. For the next step, please

2 Copyright 2016 IQP Japan Corporation All Rights Reserved

Support e-mail: [email protected]

IQP Integration with IBM Bluemix® and IoT Platform

1. Preparation of your IBM Watson IoT Platform

Log in to Bluemix with your IBM ID. You will be in the DASHBOARD.

Two platforms are needed to send the data from your device to IQP through IBM:

① IBM Watson IoT Platform

This is the platform that is connected between your device and IBM Watson IoT Platform.

② IQP IoT Code-Free App Development

If this is your first visit, you must add the 2 icons shown in the screenshot below. Go to CATALOG in the

navigation. Choose Service > Internet of Things, then click to add each icon: “Internet of Things

Platform (Watson IoT Platform)” and “IQP IoT Code-Free App Development”. When you mouse over this

icons, a “View More” filed will pop up; click on it to see an explanation page appeared. Click on “CREATE”,

and the platforms will be added in your Bluemix.

Here’s what the Dashboard will look like after adding the icons.

Page 3: IQP Integration with IBM Watson IoT Platform on Bluemix · IQP Integration with IBM Bluemix® and IoT Platform The Watson IoT Platform is now ready for API. For the next step, please

3 Copyright 2016 IQP Japan Corporation All Rights Reserved

Support e-mail: [email protected]

IQP Integration with IBM Bluemix® and IoT Platform

2. Connect with “IBM Watson IoT Platform”

Click the icon “Internet of Things Platform”. Below you see the Main page of the Watson IoT Platform.

To connect your devices, please click “Launch Dashboard” and a new tab will open.

In the screenshot above, you can see there are already 2 types of devices and 4 device IDs registered

Page 4: IQP Integration with IBM Watson IoT Platform on Bluemix · IQP Integration with IBM Bluemix® and IoT Platform The Watson IoT Platform is now ready for API. For the next step, please

4 Copyright 2016 IQP Japan Corporation All Rights Reserved

Support e-mail: [email protected]

IQP Integration with IBM Bluemix® and IoT Platform

(From 1). To check detailed information on devices or to register new devices, go to the left navigation

menu and click on “Devices” (2).

Add New Device Type

On the Device page, you’ll find information on the devices that you registered. If you want to register a

new device, click the “+Add Device” on the right-hand side.

In Add Device, if you have already registered “Device Type”, you can make your selection from 1. If you

want to register a new device, click 2. For this example, we are going to create a new device type, so

click 2.

Page 5: IQP Integration with IBM Watson IoT Platform on Bluemix · IQP Integration with IBM Bluemix® and IoT Platform The Watson IoT Platform is now ready for API. For the next step, please

5 Copyright 2016 IQP Japan Corporation All Rights Reserved

Support e-mail: [email protected]

IQP Integration with IBM Bluemix® and IoT Platform

Click on “create device type”.

The Device Type name is required and should be entered in 1. A Description is optional. Go to Next.

The screenshot above shows all the available options. Go to Next after you have made your selections.

Also click Next when you finish entering information.

Page 6: IQP Integration with IBM Watson IoT Platform on Bluemix · IQP Integration with IBM Bluemix® and IoT Platform The Watson IoT Platform is now ready for API. For the next step, please

6 Copyright 2016 IQP Japan Corporation All Rights Reserved

Support e-mail: [email protected]

IQP Integration with IBM Bluemix® and IoT Platform

If you have a metadata (option), you can write and “Create”. >> Device Type is created.

Add New Device ID

Return to the “Add Device” page. If you choose the device type and click on “Next”, the next page will be

for Device ID. 1 Device Type needs to have at least 1 device ID.

Create the new Device ID name and click “Next”. If you have Metadata or security data, you can add it.

After checking Summary, go to “Add”.

Device ID Information

After adding the new Device ID, you will get the Device ID Information. The information in the red

square below is important and you’ll need it when your device attempts to connect to the IBM Bluemix

platform. (In particular, the Authentication Token is very important, so please write it down separately.)

You can use MQTT or other protocols to send the data to this address, so you will also see data in the

Watson IoT Platform.

Page 7: IQP Integration with IBM Watson IoT Platform on Bluemix · IQP Integration with IBM Bluemix® and IoT Platform The Watson IoT Platform is now ready for API. For the next step, please

7 Copyright 2016 IQP Japan Corporation All Rights Reserved

Support e-mail: [email protected]

IQP Integration with IBM Bluemix® and IoT Platform

The Watson IoT Platform is now ready for API. For the next step, please return to your Bluemix

Dashboard.

3. Preparation of “IQP IoT Code-Free App Development”

Click the “IQP IoT Code-Free App Development” icon on your Dashboard.

The IQP page will open as seen in the screenshot below. Click on “OPEN IQP IOT CODE-FREE APP

DEVELOPMENT DASHBOARD” to open IQP.

Page 8: IQP Integration with IBM Watson IoT Platform on Bluemix · IQP Integration with IBM Bluemix® and IoT Platform The Watson IoT Platform is now ready for API. For the next step, please

8 Copyright 2016 IQP Japan Corporation All Rights Reserved

Support e-mail: [email protected]

IQP Integration with IBM Bluemix® and IoT Platform

IQP Development Dashboard

The IQP Development Dashboard will open in a new tab. This is the development page to build your

applications. When you first get started, there is no list on the first page. To create your list, you add

sample applications by clicking “Import sample apps”. When you click this button, 12 sample

applications are launched.

IQP sample applications

These are important core applications.

▪ Asset Management will check what kind of device Type and ID is registered after connecting with

Bluemix Watson IoT Platform through API.

▪ IQP Tutorial Monitoring Demo will be a quick-start to learn how to build up an IQP application.

You can follow the Tutorial with this application.

Page 9: IQP Integration with IBM Watson IoT Platform on Bluemix · IQP Integration with IBM Bluemix® and IoT Platform The Watson IoT Platform is now ready for API. For the next step, please

9 Copyright 2016 IQP Japan Corporation All Rights Reserved

Support e-mail: [email protected]

IQP Integration with IBM Bluemix® and IoT Platform

▪ Solar Management provides visualization and accident report management functions for solar

device management. In this App, IQP supports different functionality based on the separate menu

screen for administrators and general users.

There are more useful applications to choose from. You can use them as a template or to learn

advanced techniques to create more sophisticated applications. For more detailed information

on sample apps, please refer to IQP Sample Applications.

4. Connect between IQP and Watson IoT Platform

In this step, you’ll learn how to connect IQP and the Watson IoT Platform. Return to the Watson IoT

Platform and go to “Access” in the left navigation menu and select api keys.

Obtain the API key to connect IQP by clicking “Generate API Key”.

Be sure to note your API Key and Authentication Token.

Page 10: IQP Integration with IBM Watson IoT Platform on Bluemix · IQP Integration with IBM Bluemix® and IoT Platform The Watson IoT Platform is now ready for API. For the next step, please

10 Copyright 2016 IQP Japan Corporation All Rights Reserved

Support e-mail: [email protected]

IQP Integration with IBM Bluemix® and IoT Platform

Important! The Authentication Token won’t appear anymore after the above window is closed.

Save this important info, you will need it. Complete the “Generate API Key” page.

Go Back to IQP Development Dashboard.

Click on “Connect to Watson IoT”.

Enter the API Key and Authentication Token that you generated in Watson IoT Platform. Click the

Connect button and check the status section, shown in the above screenshot 1. This indicates that

connection is successfully completed. At this time there is no data sending, so the status “0 events” is

OK.

Next you will send the data to Watson IoT Platform using the FactoryA_sensor1 of Device ID.

Page 11: IQP Integration with IBM Watson IoT Platform on Bluemix · IQP Integration with IBM Bluemix® and IoT Platform The Watson IoT Platform is now ready for API. For the next step, please

11 Copyright 2016 IQP Japan Corporation All Rights Reserved

Support e-mail: [email protected]

IQP Integration with IBM Bluemix® and IoT Platform

If the data is valid, then “1 events” will appear in the status section.

Troubleshooting - why has connection failed?

If you cannot successfully connect in API, here are some possible reasons.

1. Did you finish the “Generate API Key” page? If you didn’t click “finish” on the Generation API Key

page, you will not be successful in the step “Connect to Watson IoT”.

2. If the status “0 events” does not appear in the “Connect to Watson IoT” step, generate a new API

Key and add it to IQP. (You can delete the old API Key after adding the new one).

If you need more help, contact IQP tech support at [email protected].

1.5 Option: How to send data to Watson IoT Platform

This section provides optional instructions on how to send data to the Watson IoT Platform. One option

is to use the MQTT Protocol. For this method, we will use the console to send the data.

1. Prepare the MQTT console. ( MQTT.fx is the one of the choices)

2. Register the connection profile

① xxxxx.messaging.internetofthings.ibmcloud.com (xxxxx is your Organization ID

② Broker Port: 1883

③ Client ID: d:xxxxx:yyyyy:zzzzz (xxxxx is your Organization ID, yyyyy is your Device Type, zzzzz

is your Device ID)

3. User Credentials

① User Name: use-token-auth

② Password: aaaaa (Password is Authentication Token)

Page 12: IQP Integration with IBM Watson IoT Platform on Bluemix · IQP Integration with IBM Bluemix® and IoT Platform The Watson IoT Platform is now ready for API. For the next step, please

12 Copyright 2016 IQP Japan Corporation All Rights Reserved

Support e-mail: [email protected]

IQP Integration with IBM Bluemix® and IoT Platform

4. Topic: iot-2/evt/eventid1/fmt/json

5. Payload: It must be the Json.format

Sample payload

{"d": {"metric1": metric1_data,"metric2": metric2_data}}

Ex) {"d": {"Temperature": 32.8,"Humidity": 67,"Light": 315}}

6. Publish MQTT

5. View Data which you sent from your Device in IQP

In this step, you can verify your data that is being sent to IQP.

▪ Asset Management (default application): Registered devices in Bluemix are displayed in

this app.

After data is sent from your device, the device type, device ID and metric is registered

automatically.

Supported Device Type (IQP) = Device Type (Bluemix)

Devices (IQP) = Device ID (Bluemix)

Device Metrics (IQP) = Metrics (sensors) from the device

▪ Asset Testing (default application): The data being sent from registered devices can be

Page 13: IQP Integration with IBM Watson IoT Platform on Bluemix · IQP Integration with IBM Bluemix® and IoT Platform The Watson IoT Platform is now ready for API. For the next step, please

13 Copyright 2016 IQP Japan Corporation All Rights Reserved

Support e-mail: [email protected]

IQP Integration with IBM Bluemix® and IoT Platform

seen in this app.

1. Choose your Device Type

2. Choose your Device ID

The last data from your Device ID will be displayed in each metric.

3. If you want to see the history, click “Metric History” to see this info in detail.

Which entity (table) is the data in?

The sensor data using the IBM Watson IoT Platform is stored in “M2M_data”. Go to entities > M2M_data.

M2M_data is the place where all sensor data are stored. This entity is pre-defined by IQP, so a user

cannot change the structure. This table is very flexible work with, so if you want to add or delete sensors,

the metric can be easily updated or deleted. (“Metric” is normally the name given to sensors, such as

temperature, humidity or speed, and “data” is the value of sensor data).

Page 14: IQP Integration with IBM Watson IoT Platform on Bluemix · IQP Integration with IBM Bluemix® and IoT Platform The Watson IoT Platform is now ready for API. For the next step, please

14 Copyright 2016 IQP Japan Corporation All Rights Reserved

Support e-mail: [email protected]

IQP Integration with IBM Bluemix® and IoT Platform

6. Register for a training seminar

We listen to user feedback and continually improve and expand our technical support services. For

example, you can get more in-depth information about IQP by registering for an on-line training seminar.

Here’s how…

Register for a training seminar in IQP

Visit the IQP dashboard and click on “Register for a training seminar”.

Enter your contact information in the pop-up window and click Submit.

Page 15: IQP Integration with IBM Watson IoT Platform on Bluemix · IQP Integration with IBM Bluemix® and IoT Platform The Watson IoT Platform is now ready for API. For the next step, please

15 Copyright 2016 IQP Japan Corporation All Rights Reserved

Support e-mail: [email protected]

IQP Integration with IBM Bluemix® and IoT Platform

A user confirmation verification email will be sent to the e-mail address that you used to register. Click

on the URL in the e-mail to confirm the registration process.

After the confirmation mail is sent, your will see a status update “Registered for a training seminar” in

the top of IQP dashboard. Now you’re set! An IQP representative will contact you to discuss your

requirements and the timing of our upcoming training sessions.