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

Accessing measured data remotely


The first step in this chapter is to access the data measured by your Galileo board remotely. In this first recipe of the chapter, we are going to learn how to do that from a web server running on our computer. This server is based on Node.js, which we already used to program our Galileo board, so we won't have to learn a brand new language. Let's dive in!

Getting ready

Before we start, we need to be sure that the Galileo board is configured correctly. We will use the data from analog pin A0 on the board for the measured data. You can, for example, connect a light level sensor or a temperature sensor to this pin. Refer to Chapter 1, Installing and Configuring Linux, to learn how to do this.

You also need to have the Galileo API running on your Galileo board to use this recipe. This is the same API that we created in Chapter 4, Creating a Web Server. Here is the complete code for that:

// Required modules
var m = require("mraa");
var util = require('util');

var...