Book Image

Intel Galileo Networking Cookbook

By : Marco Schwartz
Book Image

Intel Galileo Networking Cookbook

By: Marco Schwartz

Overview of this book

Arduino is an electronic prototyping platform used by millions of people around the world. Intel Galileo is fully Arduino compatible; hence it combines the high performance of Intel with the simplicity of Arduino Software Development Environment. This makes it the ideal platform to build exciting projects, especially in the field of web-based connected applications and the Internet of Things. The book features several recipes all based on the Intel Galileo board, and that exploit the powerful features of the board. Each chapter explores a given field using the Galileo board. The book is mainly divided in three parts. The first part is all about learning the basics of the Intel Galileo board, but it uses some of the powerful features of the board such as connecting external sensors and complex hardware devices, compared with more basic Arduino boards. Then, the book dives into the topics related to networking and the Internet of Things. You will learn how to run a web server on the board and log data using a cloud-based service. Finally, the book ends with a chapter that aims to build a complete home automation hub using the Galileo board. This chapter uses everything that was learned in the book to make a home automation system using the Galileo board and Arduino.
Table of Contents (10 chapters)
9
Index

Connecting Arduino modules to the Galileo board


In this recipe, we are going to establish a link between our Arduino Wi-Fi modules and the Galileo board. This is the first step in making the Galileo board the hub of our home automation system.

Getting ready

The first step is to have at least one Arduino Wi-Fi module ready. You also need to have the Galileo board ready to run a Node.js program with the Intel XDK software, as in previous chapters.

How to do it...

We are now going to examine the code to connect our Arduino boards to the Galileo board. We will assume here that we have two Arduino modules in our home automation system, at two different IP addresses: one ending with 103, and one ending with 105.

This is the complete code:

// Node-aREST
var rest = require("arest")(app);
rest.addDevice('http','192.168.1.103');
rest.addDevice('http','192.168.1.105');

Pretty simple, right? The only thing you need to change is the IP addresses of the boards in your system.

You also need to edit the package...