How to Deploy Bluetooth Secure Gateway on Intel Edison

Posted on December 28, 2016 by Kai Ren

Bluetooth SIG released an advanced toolkit, the Bluetooth Secure Gateway, last September. With this toolkit, you can learn how to connect your Bluetooth devices to the Internet of Things. The hands-on labs in this kit will help you familiarize yourself with how to set up the popular ARM-based Raspberry Pi2/Pi3 to act as a secure gateway for your Bluetooth low energy devices. I became curious to see if there any other popular dev boards which could run the Bluetooth Secure Gateway aside from one based on the ARM-cored architecture. So, I decided to try the Intel Edison because it’s another popular architecture and is based on anX86 architecture. Before I dive into the hands-on, let’s have a brief introduction about Intel Edison.

The Intel Edison is a tiny computer-on-module offered by Intel as a development system for wearable devices and Internet of Things which can communicate via Bluetooth and Wi-Fi. Okay, it’s time to get started.

0. Prerequisite

  • Download Bluetooth Secure Gateway Kit here
  • One Intel Edison board. 
  • Assemble the board correctly and power it on like this
  • One computer which running Windows.
  • Wireless Router with internet connection.

1. Serial Connection

After your Edison is up and running, you should try to build a serial connection with it, then you can configure the board through serial interface.

Open “Device Manager” of Windows and check which Com port should be used, you can see my port is COM3.


Then open a serial port utility on your Windows computer and set baud rate to 115200; a serial connection is established like below. If this is first time you’ve logged into this board, you may need to input user name: “root” and click Enter key.

*More information about serial connection, please refer to here.

2. Change password for SSH

When you login to the board, you need to change password to enable SSH. Type this command in the console:

configure_edison --password
A prompt pops up and you can type the password and then re-type it to change it.
After that, SSH is enabled.




3. Connect to the Internet

Since Edison already has a Wi-Fi interface, you can set it up to connect with your wireless router, and connect to the internet. Type this command in the console:

configure_edison –wifi

A prompt will come up and you can select the Wi-Fi network you want to join; type the password following the hint message in the console.

*More information about connecting to network, please refer to here.

4. Update & Upgrade

Type the below commands to update and upgrade software packs.
opkg update
opkg upgrade


5. Install node-gyp

Finally, we will need to install node-gyp. node-gyp is a cross-platform command-line tool written in Node.js for compiling native add-on modules for Node.js. The Bluetooth Secure Gateway needs this to compile some modules, so we MUST install it here.
npm install -g node-gyp


6. Download Source Code for the Bluetooth Secure Gateway toolkit and Deployment Scripts

Then enter the following command to download the code:
wget http://downloads.bluetooth.com/tools/SG/smart-gateway-installscript.zip



When the zip has downloaded enter the following command to unzip it:

unzip smart-gateway-installscript.zip


When the code has been unzipped, navigate to the \gateway folder where we will install all the prerequisites defined in package.json. Run the command below to do this. The command may take some time to complete during which you will see a number of warnings. These are to be expected and should be ignored.
cd ./BluetoothSecureGateway1.0.14/ScriptsAndSourceCode/gateway/
npm install


Once completed the gateway server can be started by entering the following command:
rfkill unblock bluetooth
npm start


Open an SSH client and login to your Edison board, navigate to the \navible folder and install all prerequisites defined in package.json by running the commands below:
cd ./BluetoothSecureGateway1.0.14/ScriptsAndSourceCode/navible/
cd navible
npm install


Once completed the gateway server can be started by entering the following command:

npm start

If all is working you will see a message indicating that the server is now up and an IP address you can connect to will be displayed. It should look something like this:
Server running at: https://192.168.128.66:8000

Copy the URL and paste into a browser. See section 5.4 and 5.5 in BluetoothSecureGateway-HandsOnLab.pdf for further information.

7. Conclusion

After finishing this hands-on lab, you should be set with the Bluetooth Secure Gateway up on your Edison board. With this gateway on Edison, you can connect any Bluetooth LE device by browser, navigate through the various devices that you see, and interact with your peripherals. If you want to add a cloud service module to it, you can do this in a very standard way because most of cloud service vendors provide node.js modules for it. Enjoy, and start to expand your reach of Bluetooth devices through the Internet!

Appendix

If you have any question about Intel Edison board, here is resource for your reference.

Kai Ren

Kai Ren

Kai Ren is a Tech Evangelist & Technical Program Manager for the Bluetooth SIG.

View all posts by Kai Ren