Installing the necessary components
The hardware component needed for this project is a BLE-enabled Bluetooth USB dongle. It is important that this hardware supports BLE as we will specifically make use of this part of the Bluetooth stack. We will use one by Plugable, which is available on Amazon.
The Raspbian distribution that we have downloaded already contains support for Bluetooth, but we need to update Bluetooth packages for better LE support. You can build and install a more modern of the Bluetooth package version using the following commands:
sudo apt-get install libdbus-1-dev libdbus-glib-1-dev libglib2.0-dev libical-dev libreadline-dev libudev-dev libusb-dev make mkdir -p work/bluepy cd work/bluepy wget https://www.kernel.org/pub/linux/bluetooth/bluez-5.33.tar.xz tar xvf bluez-5.33.tar.xz cd bluez-5.33 ./configure --disable-systemd make sudo make install
The make
step will compile the necessary packages needed for the Pi and will take about 15 minutes...