IBM Bluemix Setup

This guide shows how to configure an IBM Bluemix service for use with IoTIFY's Hello IoT project.  View Source

1. IBM IoT Service Setup

The IBM IoT service we are going to set up acts as a communication bridge between the emulated Raspberry Pi running in the Hello IoT project and a mobile app. Follow along the steps given below to launch your IBM IoT service instance. If you do not yet have an IBM Id, this is the time to create one and get started.

Step 1: Locate the “IBM Internet of Things Platform” Service

After creating an account at IBM Bluemix, you will be asked to create an organization and a space: simply follow the on-screen instructions. You will be assigned an organization ID, that will be needed when building the application that accesses the Bluemix API; this ID will also be visible in your Bluemix dashboard at the top right corner of the page. After this initial setup, go to the IBM Internet of Things Platform web page.

Step 2: Launch the Service

Choose a name for the service (e.g. “ioTIFY Hello IoT”), select the free plan, and click on the “Create” button at the bottom right:

A welcome screen will be displayed for your newly created service:

Step 3: Launch the service dashboard

Clink on the “Launch” button “Launch Dashboard” in the welcome page: the service will be launched and its dashboard will be shown in a new browser tab.

Step 4: Access the device profiles page on the service dashboard

To use this service with IoT devices, we must create the device profiles first. In this tutorial we have two devices, the virtual Raspberry Pi running in IoTIFY’s virtual lab and the mobile app. So to facilitate communication between the two devices, we will create a device profile for each.

In the dashboard page, hover your mouse to left side menu to expand and bring it up.

Click on the “DEVICES” sub-menu to bring up the Device list page

And on the same page, click on “Device Types” tab to bring up the device types panel.

Step 5 : Create device profile for IoTIFY’s Raspberry Pi

Click on the “Create Type” button on the top right corner of the page to add a new device profile. Follow the sequence of screenshots below to add a device type for the virtual hardware underneath IoTIFY’s Hello IoT project.

Note: Make sure to select “Create device type” in the above step

Click on the “Next” button on the bottom right corner of the “Create Device Type” dialog to move through the steps. All the subsequent steps are optional and can be skipped. Finally, the device type will be created and listed under the “Device Types” tab panel.

Step 6: Create device profile for the mobile app

Now we can follow the same steps to create another device type in “IBM IoT Platform” for the mobile app.

At last, we will have the two device types listed as per our project requirement.

Step 7: Create device instances

We now have the device types defined in the service. The next thing is to define the actual device itself which acts as a virtual identifier (device id) for every device instance that is going to access the service. In our case, we have the virtual Raspberry Pi and the mobile app as our two device instances.

So let’s go ahead and add them by clicking on the “Add Device” button under the “Browse” tab of “Devices” section in the dashboard.

Lets first add the Raspberry Pi device. We will select the device type as “raspberry_pi”.

And, assign a unique name to the device, RASPBERRY_PI_001 in this case.

Note: Just like in the case of adding device types, we can ignore the other steps in creating device and hit Next until we reach the end of “Add Device” dialog.

As part of the final step, we will be presented with the device credentials of this newly added device.

In this tutorial, the device authentication token generated as part of the device creation process is not used, because we will use the API key authentication method; however, if you plan to connect your emulated Raspberry Pi to IBM Bluemix using other methods, you may want to take a note of the generated authentication token now, because it will not be recoverable afterwards from the IBM Bluemix dashboard.

Similarly, let’s also create another device instance for the mobile app



The same considerations about the device authentication token made for the emulated Raspberry Pi apply for the mobile app device as well.

We now have the devices also listed in the IBM IoT Platform service, and that concludes the device provisioning.

Step 8: Generate API Key and Auth Token

Now that all the devices are created, we need to generate the API key and auth token to access the IBM IoT service from our end point devices.

For this, go to the “APPS” sub-menu:

Now, click on the “Generate API Key” button.

You will see the API key and Auth token being displayed on a dialog. Make a note of these parameters, as they will be used to program the application software later.

Click “Generate” on the lower right corner of the dialog to return back to the “API Keys” tab and you can now see your newly generated API credentials listed over there.