Control home devices with Bluemix Internet of Things (Part 3)

Share this post:

Part 3: Bluemix app to control the Raspberry Pi

This is a continuation of the series on Controlling home devices with Bluemix Internet Of Things If you haven’t read Part 1, Part 2, please do that first…

In Part 1 we got the electrical work out of the way. We wired up the relay’s and connected the circuit’s.

In Part 2 we installed some libraries on our Raspberry Pi to control the lights.

In this part of the 3 part series we close the loop and allow our users to interact with the Christmas Lights.

So without delay let’s jump into the next part.

Install the IoT library on your Pi

We will be using the IoT (Internet of Things) service in Bluemix to do this.

First thing we need to install some pre-req’s on our Raspberry Pi.

<span>#Download the installer from GitHub</span><br />cd /tmp/<br />curl -LO<br /><br />#<span>Install the package with</span><br /><span>sudo dpkg -i iot_1.0-1_armhf.deb</span><br /><br />

Ok so the Raspberry Pi is basically done, there is one more step but we will come back to that in a bit. Let’s focus on the Bluemix App.

Walkthrough of the app

The app consists of a Node.js backend using Twilio (for texing/sms interactions) and the IoT service in Bluemix for communicating with the Raspberry Pi. The front-end of the app is built using JQuery, Bootstrap, Angular.JS, and websockets (Socket.IO) for real-time communication with the backend for voting.

Install Pre-req’s

The app needs Node.js to run. Let’s go ahead and install Node.

sudo dpkg -i node_latest_armhf.deb

Get source code and install dependencies

git clone blah
cd blah
npm install
node lib/client.js

IBM Cloud Containers Service - Core Dev Lead

Add Comment
No Comments

Leave a Reply

Your email address will not be published.Required fields are marked *

More How-tos stories

A predictive Machine Learning model from Build to Retrain

This post is an excerpt from our solution tutorial that walks you through the process of building a predictive machine learning model, deploying it as an API to be used in applications, testing the model and retraining the model with feedback data. All of this happening in an integrated and unified self-service experience on IBM Cloud.

Continue reading

IBM Announces Promotions for Cloud Servers and Components

IBM is excited to announce 50% off list price for 60 days on selected virtual server and bare metal server offerings. This is your chance to try out a wide variety of IBM Cloud infrastructure offerings – from our fast, flexible and easily provisioned virtual servers to our high performance, totally customizable bare metal servers running Intel®'s Xeon® Scalable processors – perfect for driving today's HPC and cognitive / analytics workloads to new performance levels.

Continue reading

IBM Cloud Container Service Live in São Paulo, Brazil

IBM Cloud Container Service is a managed Kubernetes service providing an intuitive user experience with on-going cluster management. Built-in security and isolation to enable rapid delivery of apps, while leveraging IBM Cloud Services including Weather data, IoT, Analytics, or AI capabilities with Watson. Available in six IBM regions WW, including 20+ datacenters.

Continue reading