Click here to Skip to main content
15,881,089 members
Articles / Internet of Things
Article

Getting Started with Intel® IoT Devkit & Intel® XDK IoT Edition

10 Dec 2014CPOL11 min read 21.1K  
The Intel Development Kit for IoT (IoTDK) is a complete solution to create and test applications for Intel IoT platforms like the Intel® Galileo and Edison maker boards.

This article is in the Product Showcase section for our sponsors at CodeProject. These articles are intended to provide you with information on products and services that we consider useful and of value to developers.

Introduction

The Intel Development Kit for IoT (IoTDK) is a complete solution to create and test applications for Intel IoT platforms like the Intel® Galileo and Edison maker boards.

The complete IoTDK provides software and hardware component for developers to create innovative projects using the Galileo board and the Grove Starter Kit for starter. The software distributed with IoTDK comprises of three main parts: the Intel® XDK IoT Edition, the Yocto Linux* system, and a set of libraries. These libraries were created to provide developers an easy way to control the hardware components integrated with Intel IoT platforms, as well as providing high level access to several sensors and actuators.

The Yocto Linux is a meta distribution specifically for embedded projects. It is a meta distribution because it is more than a Linux distribution - Yocto is an environment for producing tailored Linux-based operating systems. Yocto provides tools for selecting software packages, preparing settings and creating images that can be used to install this tailored OS. When you buy a Intel Galileo board, Yocto is the operating system available. With the IoTDK, another version is included, with even more libraries and resources, to offer developers more resources for creating applications in their favorite programming language. This version includes GCC*, Python, Node.js, OpenCV, just to name a few. If you would like to know more about Yocto, visit www.yoctoproject.org.

The Intel® XDK IoT Edition distributed with IoTDK lets you create and run applications directly on Intel IoT platforms.  This edition of Intel® XDK also provides templates for creating new applications, and we shall see how to use them later. Intel® XDK IoT Edition offers the possibility of remotely debugging your application, and running it from your own desktop. Since Intel Galileo is intended to run IoT projects, its processing power is somewhat limited, so bigger or more complex projects can take advantage of a more powerful processor to run a complete developer environment. Developers do not need to use the Intel® XDK IoT Edition, but it’s a great tool to have.

The Yocto system installed on the Intel Galileo or Edison board provides a set of libraries especially designed for the IoTDK and the Intel® XDK IoT Edition. These libraries are MRAA and UPM. MRAA is a low level library that offers a translation from the General Purpose Input/Output interfaces to the pins available on Intel Galileo or Edison. So instead of reading the raw level information from the GPIO module available on the Linux kernel, a developer can easily select a pin number and work directly with it. MRAA will take care of the underlying details. UPM is a repository of sensors representations, written in C++, and utilizing MRAA to do so. Both of these libraries have C++ bindings to JavaScript. With Intel® XDK IoT Edition, Node.JS is used to communicate with all of the GPIO Pins, libraries, and packages. For instance, the GPIO Pin 13 can be assigned with a useful line of code like var onboardLED = new mraa.Gpio(13);

Requirements

  • Intel Galileo (1st or 2nd Generation) Or Intel Edison
  • Desktop Operating System: Windows® 7 64-bits, Apple® OS X, Ubuntu®

Components

The following highlights important hardware components of the IoTDK.

  • Intel® Galileo board or Intel® Edison
  • MicroSD Card
  • USB to Serial Cable
  • Serial to D9 Cable
  • Ethernet Cable
  • Grove Starter Kit Plus
    • A Modular Electronics platform for engineers and artists to turn their ideas into reality.
    • It includes basic shield, sensors, button, relay, servo, LCD, LEDs and connecting cables.

Setting Up the Intel® Galileo Board

If using a Intel Galileo board, our first step is to update onboard firmware.

  1. Download the Arduino* software for Galileo at https://downloadcenter.intel.com/Detail_Desc.aspx?DwnldID=23171
  2. Connect the Intel Galileo board from the USB host port to the desktop system’s USB port
  3. Launch the Arduino Software
    1. Navigate to Tools > Board > Intel® Galileo Board or Intel® Galileo Gen2
    2. Navigate to Tools > Serial Port > COM?
      1. Note: (Windows) You can find  this under the Windows Device Manager
      2. Note: (Apple OS X*) You can find this under the Apple Logo > About This Mac > System Report
      3. Note: (Ubuntu*) You can find this using the lsusb command in the Terminal
  4. Navigate to Help > Firmware Update

Our second step is to prepare the Intel Galileo board to be used with our IoTDK. As mention previously, this means starting the board with the prepared Yocto image.

Download the latest image from https://software.intel.com/sites/landingpage/iotdk/board-boot-image.html 

Windows*

  1. Using 7zip or a similar tool, extract the downloaded image file *.bz2 on your Windows system.
  2. Insert the micro-SD Card in the appropriate card slot of the Windows system.
  3. Download the Win32DiskImager utility and install it as an Administrator. After a successful installation, run the Win32DiskImager as an Administrator.
  4. Ensure that you have selected the correct Device Drive corresponding to your inserted micro-SD card for writing.

OS X* or Linux*

  1. In OS X Command line (Terminal application), you can write the image to the SD card.
  2. Type the following commands (Example)
    1. diskutil list
    2. identify the disk (not partition) of your SD card. e.g. disk4 (not disk4s1)
    3. diskutil unmountDisk /dev/
    4. e.g. diskutil unmountDisk /dev/disk4
    5. sudo 3dbs=1m if=.img of=/dev/
    6. e.g. sudo 3dbs=1m if=iot-devkit-mmcblkp0.direct of=/dev/rdisk4
    7. (This will take a few minutes)

Connecting the Galileo Board to your desktop

  1. Place the prepared micro-SD card in the micro-SD card slot on the Intel IoT platform
  2. If using an Intel Galileo board, connect the correspondent serial cable (B9 for Gen1, FTDI for Gen2) in the appropriate port on the board. Connect the other side to an USB port on the desktop system.
  3. Connect the Ethernet cable to the Intel Galileo board, and the other point to your LAN, such as your router
  4. Connect the power cable on the Intel Galileo board, and connect it to the electrical power to start it up.
  5. Important note: make sure you have a power cable appropriate to your board. The power cable from Intel Galileo Gen2 is similar to Gen1, however it provides 12V instead of 5V, and the Gen1 is not prepared for it which can damage your board.

The full setup should look like this:

Image 1

Discovering the Board’s IP Address

Windows

  1. Using a terminal emulator (for example, Putty), open a Serial connection with the board:
  2. First, find which serial port your Windows system recognized as connected to the board. Open Start -> Devices and Printers, and you should see an USB-Serial entry.
  3. Open your terminal emulator(Putty), and set the following configurations:
    1. Session
      1. Serial line: COM?
        1. For example, COM12
      2. Speed: 115200
      3. Connection type: Serial
  4. Window
    1. Serial
      1. Serial line to connect to: COM?
      2. Speed (baud) :115200
      3. Data bits: 8
      4. Stop bits: 1
      5. Parity: 1
      6. Flow control: XON/XOFF
  5. Open the connection. If you don’t see anything, hit enter on your keyboard.
  6. Login with the root superuser. The password is empty. Type root
  7. Using the command `ip a`, identify the IP address being used by the board. It should be listed as inet, inside the second listed entry.

OS X

Using the Bonjour Browser, view all of the Bonjour services on your local network:

  1. Launch the Bonjour Browser application
  2. Search for _xdk-app-daemon._tcp.
  3. Expand it to discover the IP address

Setting up the Intel® Edison Board

Higlights

The daemon 0.0.19 fixes a stability bug with remote debugging, and also adds mandatory IP address whitelisting.

In order to connect to an Edison running the XDK daemon, the user must now first run the following command from the Linux* terminal of the Edison.

xdk-whitelist --add <ip address> (where <ip address> should be the address of the computer running the Intel® XDK IoT Edition)

If a user attempts to connect to the Edison from an unauthorized (aka not in the white list) host, an error message with instructions on how to add the computers IP address to the whitelist will be presented.

The xdk-whitelist utility accepts the following commands:

  • --clear Remove all IP addersses from the whitelist
  • --add Add an IP address to the whitelist. [ Example: xdk-whitelist --add <ip address> ]
  • --remove Remove an IP address from the whitelist. [ Example: xdk-whitelist --remove <ip address> ]
  • --list Display a list of IP addresses in the whitelist

Notes

If you are experiencing issues connecting to your Intel Edison board or even your Intel Galileo board to Intel XDK IoT Edition, run the following commands in a ssh session:

  1. systemctl enable xdk-daemon
  2. systemctl restart xdk-daemon

If you don’t see your board automatically within the IoT Device dropdown menu, click Add Manual Connection:

  1. Type the IP Address for your board in the  Address: field
  2. Type 58888 for your board in the  Port: field (By default,  Intel XDK app daemon port is 58888)

If you continue to have network connection related issues with your board or Intel XDK:

  1. For Edison, reboot the board within the ssh terminal or manually power cycle the board
  2. For Intel XDK, Close application and reopen

Setting up the Intel® XDK

  1. Download Intel® XDK IoT Edition to your computer at http://software.intel.com/en-us/html5/xdk-iot
  2. Double click the on the file iot_web_<desiredOS>_master_<versionNumber> to install and launch Intel® XDK IoT Edition for application development.
  3. This will open Intel® XDK with the various project creation options including the Work from an IoT with Node.js Template option.
  4. Select the Start with a Sample or Template under the Internet of Things (IoT) with Node.js Projects option to open the environment for developing Node.js applications for your  board. The end results should look like this:

Image 2

Note: A toolbar appears at the bottom of the Develop tab when editing a Internet of Things (IoT) with Node.js Projects project. This includes a list of accessible & connected boards running the IoTdevkit Linux* image on the left and a button on the right that hides or show the command console. The toolbar also includes the functionality to install/build node modules, upload, debug, stop and run the active project

  1. Let’s connect to the Intel Galileo board. Click on the IoT Device drop down list, on the bottom left corner on Intel XDK.
  2. Select Intel Galileo (quark) in the list.
  3. A popup window appears displaying the Connection status and IP Address of the Intel Galileo or Edison board.

Running a Sample Application

As you may have noticed, Intel® XDK IoT Edition has some examples projects already built in. Execute a simple one to test if everything is properly connected.

  1. In the Projects tab, under Internet of Things (IoT) with Node.js Projects, click Start with a Sample or Template.
  2. Choose a project type
  3. Click Use This Template
  4. Input a Name and create the project. This becomes the active project in the Intel XDK.
  5. Click the IoT Device: Dropdown menu in the bottom toolbar to connect to your board
  6. Click the Toggle console window button to reveal the console window
  7. Click Manage your daemon/IoT device menu in bottom toolbar. Select sync PC time w/ clock on target board to avoid computer and device timing issues. (#1 in the image above)
  8. Click Install/Build to fetch node modules specified in package.json and install them on device. (#2 in the image above)
  9. Click Upload to upload the current project to the board. (#3 in the image above)
  10. Click Run to run project on the device. (#4 in the image above)

Note: If you get an error message saying "can not find mraa", connect to your board using a ssh session and run the following:

  1. echo "src maa-upm http://iotdk.intel.com/repos/1.1/intelgalactic" > /etc/opkg/intel-iotdk.conf
  2. opkg update
  3. opkg upgrade

Related Links and Resources

Intel XDK

Intel Developer Zone (IDZ) – Internet  of Things (IoT) Zone

Intel Edison

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Canada Canada
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
-- There are no messages in this forum --