WebBluetooth Setup

Introduction

On Linux based systems we use BlueZ.
On Android the only prerequisite is Android 4.3 (Jelly Bean).

For simulating a BLE Device we use a Raspberry Pi 3, since it has a built in bluetooth adapter.

You will also need a bluetooth adapter (4.0 or above) for the desktop machine.

BlueZ

Note: the following instructions are based on this article.

To get and build bluez 5.39:


cd ~

wget http://www.kernel.org/pub/linux/bluetooth/bluez-5.39.tar.xz

xzcat bluez-5.39.tar.xz | tar -xv

cd bluez-5.39

sudo apt-get update
sudo apt-get install -y libusb-dev libdbus-1-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev

./configure CFLAGS="$CFLAGS -Wno-sign-compare -fPIC" --enable-experimental --enable-maintainer-mode

make

sudo make install

# search for the "ExecStart=/usr/local/libexec/bluetooth/bluetoothd" line
# append " -E" at the end
# in nano you can save with ctrl-o and exit with ctrl-x
sudo nano /lib/systemd/system/bluetooth.service

sudo systemctl daemon-reload

sudo systemctl restart bluetooth

Raspberry Pi (Raspbian)

Note: We used a RPi 3 because it has a built in adapter, but you can use any previous version with a bluetooth adapter (4.0 and above) as well.
Also, you will need BlueZ 5.39+ installed. (described above)

You can download our gatt server scripts from here.

You can use our predefined ones (e.g. sudo python heart-battery.py)

Or you can define custom services, characteristics and descriptors.

Desktop (Linux)

Note: You will need BlueZ 5.39+ installed. (described above)

You can download Servo from the official site.

The WebBluetooth support is aleady included, you just need to run in with ./runservo.sh.

Test

You can test it with these tests.