Skip to main content

Real-time data streaming to IBM Bluemix

This screencast walks you through streaming data to IBM Bluemix from a resin.io powered device. Resin.io allows you to git push applications in the form of a Docker container to your Raspberry Pi. 

How it works

When the device boots resin.io starts your applications code in a container on the device. The device will then register automatically with the Bluemix IoTF service and stream randomized data to the cloud. The device's Bluemix ID and auth-token are saved as per-device environment variables on the device, so that the identity persists through container restarts and device reboots.

You can add multiple devices to your resin.io application that will automatically download the code, register and then stream to the same Bluemix application as a new device.

Here are the steps to accompany the screen-cast:

Provision your device

•         Sign up with resin.io & create an application.

•         Download the applications image.

•         Burn the image to an SD card:

–         Burning instructions for OSX and LINUX

–         Burning instructions for Windows

•          After booting your device it will pop up on your resin.io application's dashboard.

Setup Bluemix

•          Sign up for Bluemix.

•          Create an application; use the nodejs IoT boilerplate.

•          Go to "Catalog > Internet of things > Internet of Things service > Select application > Create" and associate this service with the application you just created.

Get the application running on the device

•          Clone the boilerplate Bluemix application:

git clone https://github.com/craig-mulligan/Bluemix-resin-boilerplate.git

•          Add your resin.io application's remote endpoint:

git remote add resin @git.resin.io:/.git

•          Push and resin.io will do the rest:

git push resin master

Configure your application

•          Go to your resin.io application's dashboard.

•          Select "Environment variables"

•          Add the auth-tokenfollowing key/value pairs:

–         JWT = 2sadfj435tdgsfdsa... (found here)

•          Add the following key/value pairs, which can be found on Bluemix dashboard if you click "Show creds" on the IoTF service:

–         ORGANIZATION = qyfod6

–         API_KEY = a-lydcfi-e7a2au1ymm

–         API_TOKEN = CWaxYwSUxoMd?MMkIu

–         DEVICE_TYPE = RPI2

Enjoy your live-stream

The logs will print a link to your IBM IoTF dashboard where you can manage your devices and view the data they are publishing.

Raspberry Pi & Accessories from RS Components

ResinIO has not written a bio yet…
DesignSpark Electrical Logolinkedin