Book Image

Intel Galileo Networking Cookbook

By : Marco Schwartz
Book Image

Intel Galileo Networking Cookbook

By: Marco Schwartz

Overview of this book

Table of Contents (15 chapters)
Intel Galileo Networking Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Building an interface for your home automation system


In the preceding recipe, we established a connection between our Arduino modules and the Galileo board, which is now acting as the hub for our home automation system.

However, what we would really like to do is have a nice graphical interface so that we can monitor our system, and this is exactly what we are going to do in this recipe.

Getting ready

Before attempting this recipe, you need to complete the previous recipe, with at least one Arduino board connected to the Galileo board via Wi-Fi.

How to do it...

This recipe is only about upgrading the code that we started to write in the preceding recipe. This is the complete code:

var express = require('express');
var app = express();

// Define port
var port = 3000;

// View engine
app.set('view engine', 'jade');

// Set public folder
app.use(express.static(__dirname + '/public'));

// Serve interface
app.get('/', function(req, res){
  res.render('interface');
});

// Node-aREST
var rest = require...