Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Intel® XDK IoT Node.js* Device to Hub App

See for license terms and conditions.

This sample application is distributed as part of the Intel® XDK. It can also be downloaded or cloned directly from its git repo on the public Intel XDK GitHub* site.

For help getting started developing applications with the Intel XDK, please start with the Intel XDK documentation.

See also, the mraa library documentation for details regarding supported boards and the mraa library API and the upm library documentation for information regarding the upm sensor and actuator library APIs.

App Overview

This sample app demonstrates how to pass sensor data from an IoT Device and send it to your Microsoft Azure Hub account. The hub encrypts the data you send and allows you to store and retrieve the information received from IoT device by another device or system.

NOTE: You can get your Microsoft Azure Hub membership by going to the Azure Portal. For this app you do not need a full subscription to the service - you can use the free trial. For a detailed tutorial on how to setup your Azure IoT hub, see: Setup Azure IoT Hub

Hardware Requirements

Intel Edison CPU module mounted on an Intel Edison breakout board

Getting Started

Download and unzip a copy of the project files and put it into an easily accessible folder on your workstation.

  • Start the Intel XDK and select "Open an Intel XDK Project” from the Projects tab (see the image below).

  • Locate the folder that contains the "IoT-Device-to-Hub" project you downloaded and unzipped and select the file with the .xdk extension.

How to open an Intel XDK project

Modifying the Source Files

Modify the connection.json file to specify the connection string information that is unique to your hub. The information shown below will not work, you must change it to match your IoT hub connection identification information:

    "HOST_NAME": "your-hostname",
    "SHARE_ACCESS_NAME": "shared-access-key-name",
    "FIRST_KEY": "shared-access-key"

To get your shared access key, goto your IoT Hub > Shared Access Policies > IoT Hub Owner > Connection String - Primary.

Share Policies Page Key Page

Connecting Hardware

Once your source files are ready to go, you can go ahead and connect your device in the following manner.

  1. Connect your Base Shield to your IoT device -- base shield attached to an Intel Edison

  2. Make sure your voltage switch is set to 5 Volts -- closeup look at the volt switch

  3. Attach your temperature sensor to the A0 port on the base shield -- temperature sensor on the base shield

  4. Plug in your power adapter -- power and USB connections for an Intel Edison Board

Running the Project

After all hardware and software configuration are complete, be sure to configure your IoT board's network interface so it has access to the Internet.

Important App Files

  • main.js
  • package.json
  • connection.json

Important Project Files

  • <project-name>.xdk

Tested IoT Node.js Platforms

This sample can run on other IoT Node.js development platforms, that include the appropriate sensor hardware, but may require changes to the I/O initialization and configuration code in order to work on those other platforms.

You can’t perform that action at this time.