Community

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 https://github.com/ibm-messaging/iot-raspberrypi/releases/download/1.0.2/iot_1.0-1_armhf.deb<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.

wget http://node-arm.herokuapp.com/node_latest_armhf.deb 
sudo dpkg -i node_latest_armhf.deb

Get source code and install dependencies

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

Add Comment
No Comments

Leave a Reply

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

More Community Stories

Bluemix in the News

Too busy coding to keep up with all the exciting happenings in the Bluemix world? Well don’t worry! This concise post will summarize announcements, videos, and events that Bluemix has been involved in because we understand your busy schedule, but we also know your desire to learn more about Bluemix!

Continue reading

Services Changes with Bluemix General Availability

As you've probably heard by now, we are very excited to announce that the Bluemix platform is now officially available as a commercial offering. As part of this announcement we've introduced new IBM and 3rd party services, updated our UI and docs and perhaps most importantly, introduced pricing.

Continue reading

Get Instant Answers to Bluemix Questions with IBM Digital Advisors

What is Bluemix? How can I get started in Bluemix? We can show you! The IBM Digital Advisors are ready to engage with you. IBM is testing new frontiers to enhance our digital experience we offer clients.

Continue reading