How to make Intel Edison and Galileo iBeacon beacons

Original author: Intel
  • Transfer
Using Bluetooth Low Energy technology, also called Bluetooth Smart, you can create iBeacon beacons. The lighthouse periodically notifies the surrounding devices of its presence, and devices equipped with appropriate applications determine the distance to the lighthouse and perform certain actions. If such a system is installed in the museum, the visitor’s smartphone can show him additional information about the exhibits, based on the position of the person in the exhibition hall. The same scheme can be used, for example, to provide discounts in stores and any other options for interacting with a user that require his presence in a certain area of ​​space.



Today we will talk about how to create an iBeacon application for Intel Galileo and Intel Edison. The application informs others about the presence of a board that looks like a BLE beacon to them. You can receive a signal, for example, using a program for a smartphone that can detect the presence of a beacon and measure the distance from it to a mobile device. Ready-made code for the BLE iBeacon app for Edison and Galileo can be found here .

This example demonstrates the applicability of BLE iBeacon technology to identify the location of a BLE beacon (in this case, Edison or Galileo boards) relative to a mobile device. If you are interested in the features of creating a project, including detailed technical information, look here. Our development has been tested on Intel Edison with an Arduino expansion board installed.

Please note that since we use Bluetooth Low Energy here, it is not necessary that the mobile device and the beacon are connected to the same Wi-Fi network. At the same time, the board and the computer running the Intel XDK IoT Edition development environment must be connected to the same network.

Prerequisites


To successfully master this guide, your workplace must meet the following requirements:

  • You must have a computer with Intel XDK IoT Edition installed and an IoT board connected to it. If you need a step-by-step guide on organizing your development environment, check out this article.

  • The board must be connected to the same wireless network as the computer. Connection details read here .

  • The board must have a Bluetooth module.
  • You must have a device, for example, an iOS or Android smartphone that supports the Bluetooth Low Energy standard. Here is a list of suitable devices.


Intel edison

Creating a new project with support for BLE iBeacon


Here we will talk about how to use code examples to create a project that will allow the board to notify surrounding devices of its presence using BLE.

  1. Launch Intel XDK IoT Edition.
  2. In the upper left of the program window, click on the Projects tab .
  3. Click on the Start a New Project button .


    Creating a New Project in Intel XDK IoT Edition

  4. In the Internet of Things Embedded Applications group, click Templates .


    Go to application template selection

  5. In the left part of the window, click the (BLE) BLE-iBeacon icon . After that, click on the Continue button .


    Template selection

  6. Enter the project name in the Project Name field , then click the Create button . A new project will be created and opened in the XDK.


    Project creation

Enable BLE on the board


Here we talk about how to enable BLE on the board. In order to follow the steps below, you will need to connect to the board using the bookmarks tool SSH Terminal or Serial Terminal , which are available in Intel XDK IoT Edition. Here are some useful links with details on how to organize a terminal connection to the board via the serial port in the XDK.

  • If you use Intel Edison, take a look here .
  • If you are developing for Intel Galileo, here is a set of manuals for different operating systems: Windows , Mac OS X , Linux .

After the connection is established, do the following:

  1. In an SSH session, or when connecting through a terminal, execute these commands:

    rfkill unblock bluetooth 
    hciconfig hci0 up

  2. Type the following command to open the base-feeds.conf file in a vi text editor .

    vi /etc/opkg/base-feeds.conf

  3. Add the following to this file:

    src/gz all http://repo.opkg.net/edison/repo/all
    src/gz edison http://repo.opkg.net/edison/repo/edison
    src/gz core2-32 http://repo.opkg.net/edison/repo/core2-32

    Save the changes and exit the editor.

  4. In order for the Bleno package for Node.js to work correctly, enter the following commands:

    rfkill unblock bluetooth
    killall bluetoothd
    hciconfig hci0 up

Downloading the BLE-iBeacon Node.js application to the board


Here we consider the assembly, uploading to the board and launching an application that allows the device to work with the BLE module.

  1. In the bottom toolbar of the Intel XDK IoT Edition, click the Upload icon to upload the project to the board.

  2. Click the Run icon to start the project.

If a message is displayed in the console located at the bottom of the program window stating that it is not possible to detect MRAA, you will need to update the MRAA library on the board. To do this, click on the Manage your daemon / IoT device icon in the lower right part of the window, then select Update libraries on board .

Testing


If the application managed to run on the board, this is half the battle. The project needs to be tested using a smartphone and a suitable mobile application designed to work with BLE iBeacon devices. In such applications, there is usually a command called Locate Beacon . It allows you to find beacons located nearby and calculate the distance to them. Here are a couple of suitable apps: one for iOS and one for Android .

conclusions


We talked about how, using the capabilities of Bluetooth Low Energy, to make an Intel iBeacon beacon from Intel Edison or Intel Galileo, which is able to notify about its presence devices located near it. We see several options for using the proposed solution. The first, designed for small and educational projects, involves the use of the board as the end device. Another option is to create a prototype of a large commercial system based on Edison or Galileo. If the prototype lives up to expectations, universal boards can be replaced with specialized beacons, and Edison and Galileo can be used for new experiments.

Also popular now: