In order to use your Raspberry Pi to send out Beacon data in the advertising frame, we'll need to install a few open source tools, mainly Bluez

Check if you already have Bluez

If you already have a modern version of Bluez you do not need to compile and can skip to step 4!

On your Raspberry Pi, try running

sudo apt-get install bluez

and then

dpkg --status bluez | grep '^Version:'

If you get something like Version: 5.23-2+rpi2
Where the version is greater than 5.11 you can skip the installation and compilation steps.

1. Install Required Libraries

sudo apt-get install libusb-dev libdbus-1-dev libglib2.0-dev libudev-dev
sudo apt-get install libical-dev
sudo apt-get install libreadline-dev
You may need to type the above code in to make it work rather than doing a copy/paste, or manually remove a superfluous line feed between lines

2. Download Bluez

sudo mkdir bluez
cd bluez
sudo wget

3. Unzip and Compile Bluez

Next you need to actually build Bluez on the Pi. This step may take a while, but should work without any hiccups if you properly installed all the libraries in step one above:
      sudo unxz bluez-5.11.tar.xz
sudo tar xvf bluez-5.11.tar
cd bluez-5.11
sudo ./configure --disable-systemd
sudo make
sudo make install

4. Insert the USB Module and Reset

Once Bluez has been built, shut down your computer with sudo shutdown -h now and once its Halted, insert your Bluetooth 4.0 USB Module and then restart the Raspberry Pi so that all of the changes we have made can take effect.

This guide was first published on Dec 04, 2013. It was last updated on Apr 18, 2024.

This page (Compiling Bluez) was last updated on Apr 05, 2024.

Text editor powered by tinymce.