⬆️ ⬇️

How to make Intel Edison and Galileo iBeacon-beacons

Using the Bluetooth Low Energy technology, which is also called Bluetooth Smart, you can create iBeacon beacons. The lighthouse periodically notifies the surrounding devices about 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 a museum, a visitor’s smartphone can show him additional information about the exhibits, based on the position of the person in the exhibition hall. According to the same scheme, it is possible to organize, for example, the provision of discounts in stores and any other options for user interaction that provide for its 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 the board, which looks to them as a BLE beacon. You can receive a signal, for example, using a smartphone program that can detect the presence of a beacon and measure the distance from it to a mobile device. The ready-made code for the BLE iBeacon application, designed for Edison and Galileo, can be found here .



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

')

Please note that since we are using Bluetooth Low Energy, it is not necessary that the mobile device and the beacon be 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 manual, your workplace must meet the following requirements:







Intel edison



Creating a new project with BLE iBeacon support



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



  1. Launch Intel XDK IoT Edition.
  2. At the top left of the program window, click on the Projects tab.
  3. Click 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 on Templates .





    Go to the choice of application template



  5. On the left side 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 board



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





After the connection is established, do the following:



  1. In an SSH session, or when connected via a terminal, execute these commands:



    rfkill unblock bluetooth hciconfig hci0 up 


  2. Enter the following command to open the base-feeds.conf file in the 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 properly, enter the following commands:



     rfkill unblock bluetooth killall bluetoothd hciconfig hci0 up 


Uploading 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 Intel XDK IoT Edition, click on the Upload icon. to upload the project to the board.



  2. Click the Run icon . to run the project.



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



Testing



If the application was able to run on the board - this is half the battle. The project should 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 that can be called Locate Beacon . It allows you to find beacons located nearby and calculate the distance to them. Here are a couple of suitable applications: one for iOS and one more for Android .



findings



We talked about how, using the capabilities of Bluetooth Low Energy, to make an Intel Edison or Intel Galileo iBeacon-beacon, 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, provides for the use of the board as an end device. Another option is to create on the basis of Edison or Galileo a prototype of a large commercial system. If the prototype meets expectations, universal boards can be replaced with specialized beacons, while Edison and Galileo can be used for new experiments.

Source: https://habr.com/ru/post/303670/



All Articles