Tutorial: Connect to the IBM IOT Foundation Quickstart

This tutorial explains how you can send data into the IBM Internet of Things Foundation from Reactive Blocks. The example runs out-of-the-box, but it is easy to adapt it so you can send your own kind of data.

In this tutorial, we connect to the quickstart server of the Internet of Things Foundation. This is a preview version of the actual IOT Foundation service. It does not require authentication or a signup, and displays all data sent in directly on a web site.

Note that the IoT Foundation uses MQTT over ports 1883 or 8883, which must not be blocked by your firewall.

Why IBM Internet of Things Foundation? With the IBM Internet of Things Foundation you can collect event data from devices, forward it to other applications, and retrieve historical data.

Why Reactive Blocks? With Reactive Blocks you can build robust applications from building blocks. The simple example here can for instance be extended, block for block, towards the final application.

Step 1: Install Reactive Blocks

Step 2: Import the Example

  • In the Blocks view, click the import button.
  • Import (Level 2) Publish Data to IBM IOT Foundation Quickstart from the Tutorial Team.

How it Works

  1. Within the init method, we configure the Quickstart block with the necessary parameters. It sets the deviceType and the deviceId. For the quickstart service, we don’t need (in fact, cannot) add authentication credentials.
  2. The Quickstart block connects to IBM, and returns the URL of the web site that will visualize our data. We open that web site with block Open Browser.
  3. We also open the window of the event simulator.
  4. Any event from the simulator is forwarded to the event pin of the quickstart block. This is the data that will be sent to the IOT Foundation server.
  5. Once the window is closed, we disconnect and close the application.

Step 3: Build the Example

  • To generate code, right-click, select Build / Re-Build for Java Standard Edition
  • The package explorer will open and reveal the generated Java project.

Step 4: Run

Find the launch configuration, right-click, and select Run As / IOTFoundationQuickstart

Now the following happens:

A website opens and shows the IBM IOT Foundation Quickstart web site for a new device that the application just created. As our application is not yet sending any data, the website will tell that the device is connected, but that it did not yet receive any data.

If the device application cannot connect, this may be due to a firewall that blocks the MQTT traffic via ports 1883 or 8883.

A window opens that lets you simulate data. Whenever you adjust any of the values, a new data event is sent into quickstart. As soon as you send the first data, the website will show the data.

This is the web site with some data: