Click here to Skip to main content
15,867,686 members
Articles / Internet of Things
Article

Creating a Bluetooth Smart/Low Energy iBeacon application

Rate me:
Please Sign up or sign in to vote.
5.00/5 (1 vote)
18 Apr 2016CPOL4 min read 8.8K   3  
This guide contains steps to create a Bluetooth Smart/Low Energy (BLE) iBeacon application that runs on an Intel® Galileo board or Intel® Edison board, advertising the board's presence as a BLE device

This article is 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

Get access to the new Intel® IoT Developer Kit, a complete hardware and software solution that allows developers to create exciting new solutions with the Intel® Galileo and Intel® Edison boards. Visit the Intel® Developer Zone for IoT.

This guide contains steps to create a Bluetooth* Smart/Low Energy (BLE) iBeacon* application that runs on an Intel® Galileo board or Intel® Edison board, advertising the board's presence as a BLE device. Once the application is running, you can use a mobile app to scan for and measure the distance between the mobile device and your board. The source code for the BLE iBeacon application that runs on your board can be found here: https://github.com/gomobile/iotapp-template-ble-ibeacon.

This example demonstrates the usefulness of BLE iBeacon technology for identifying the location of a BLE device (in this case, your board) in reference to a mobile device's location. For design considerations, including in-depth technical information about this application, visit https://github.com/gomobile/iotapp-template-ble-peripheral#design-considerations. This project was tested on an Intel® Edison board with the Arduino* expansion board.

Since all communication between the mobile device and your board is via Bluetooth Low Energy, they do not have to be on the same wireless network. The Intel® XDK IoT Edition and your board, however, must be on the same network.

Requirements

Image 1

Creating a new project with BLE iBeacon functionality

This section contains steps to use sample code to advertise your board's presence via BLE.

  1. Run the Intel XDK IoT Edition.
  2. In the top left, click the Projects tab.
  3. Click Start a New Project.

    Image 2
  4. Under Internet of Things Embedded Application, click Templates.

    Image 3
  5. From the right, click (BLE) BLE-iBeacon. Click Continue.

    Image 4
  6. Type a name for the project in the Project Name field, then click Create. Your new project opens.

    Image 5

Enabling BLE on your board

This section contains steps to enable BLE on your board.

In the steps below, you can connect to your board using the SSH Terminal or Serial Terminal tabs within the Intel XDK IoT Edition. For detailed steps to create a serial terminal connection to your board outside of the Intel XDK IoT Edition, see the following:

  1. Within an SSH or serial terminal connection, type the following 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. Insert the following lines into base-feeds.conf:
    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 your changes and exit the editor. For more information on the vi editor, visit http://www.cs.colostate.edu/helpdocs/vi.html.
  4. To get the bleno Node.js package to work successfully, enter the following commands:
    rfkill unblock bluetooth
    killall bluetoothd
    hciconfig hci0 up 

Uploading the BLE-iBeacon Node.js* application to your board

This section contains steps to build, upload, and run the relevant code to advertise, read and write data via the Bluetooth Low Energy module.

  1. In the bottom toolbar of the Intel XDK IoT Edition, click the Upload icon Image 6 to upload the project to your board.
  2. Click the Run icon Image 7 to run your project.

Note: If the bottom console window displays a message about being unable to find MRAA, you must update the MRAA library on your board. To do so, click the Manage your daemon/IoT device icon Image 8 in the bottom right of the Intel XDK IoT Edition, then select Update libraries on board.

Testing your application

The recommended way to test this application is to download and use a mobile application that allows you to view your nearby board (iBeacon), as well as other BLE iBeacon devices. Use Locate Beacon, which lets you find any nearby beacon with real-time distance estimates:

References

License

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


Written By
United States United States
You may know us for our processors. But we do so much more. Intel invents at the boundaries of technology to make amazing experiences possible for business and society, and for every person on Earth.

Harnessing the capability of the cloud, the ubiquity of the Internet of Things, the latest advances in memory and programmable solutions, and the promise of always-on 5G connectivity, Intel is disrupting industries and solving global challenges. Leading on policy, diversity, inclusion, education and sustainability, we create value for our stockholders, customers and society.
This is a Organisation

42 members

Comments and Discussions

 
-- There are no messages in this forum --