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
About the Author
About the Reviewers

Sending data to a cloud device

We are now going to learn how to take measurements from the temperature sensor and the photocell, and send them to the cloud to be logged. They will then be accessible from anywhere, and you will also be able to use them in other applications.

Getting ready

There is nothing extra you need to do for this recipe. We are going to use to store data in the cloud, and you can read more about this service at: is a very nice and easy-to-use cloud service for storing data. You make a request to the service with your data, and their servers store it.

How to do it...

In the project in this recipe, we will take measurements from the sensors, connect to, and then send the data to the server.

This is the complete code for this recipe:

// Includes
var mraa = require("mraa");
var util = require('util');
var request = require('request');

// Sensor pins
var temp_sensor_pin = new mraa.Aio(0);
var light_sensor_pin...