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 How-tos Stories

Obey your commands: Home automation using Watson and PubNub

Integration of voice control in smart devices is buzzing, and adoption continues to grow. Voice control provides a more natural way of interacting with connected apps and devices ranging from news feeds, traffic information to acting as personal assistants in the home. These intelligent devices respond to commands spoken in our own voice and act immediately.

Continue reading

60 minutes of Serverless by Software Engineering Daily

On a recent episode of Software Engineering Daily’s popular podcast, host Jeffrey Meyerson sat with Rodric Rabbah to discuss cloud native development, Serverless functions being the focal point. As the principal researcher and technical lead in serverless computing at IBM, Rodric helped design OpenWhisk, the open source functions-as-a-service platform that IBM has deployed and operationalized as IBM Cloud Functions.

Continue reading

How do I monitor my IBM Cloud applications?

If you are a service owner or first responder, you ask yourself "What’s going on with my IBM Cloud application?", "Are my customers satisfied with the service they’re getting?", "Has performance changed recently?" and so on. The answer begins with your organization's plan to design, deliver, operate, and control the IT and cloud services that it offers. This first post of the series begins with monitoring your cloud-based applications.

Continue reading