Updating BlueZ on Raspberry Pi (5.43 to 5.48)


Update (Jul 9, 2019):
Now, Raspbian Buster, released on 6/20/2019, has bluez 5.50 by default!


Update (March 3, 2019):
Please see this post to update BlueZ to 5.50.


 

This post shows how to update BlueZ from 5.43 (the default version comes with Raspbian Stretch November 2017 version) to 5.48 (the latest as of 2/14/2018) on Raspberry Pi.
According to the release notes [1], many issues (especially GATT related issues) have been fixed and also, Advertising Manager API, which was previously marked as experimental, is now stable in 5.48.

Here is the list of contents of this post.

– Assumptions
– Steps
1. Check Current BlueZ Version
2. Install Dependencies
3. Install Latest BlueZ
4. Verify Update
– Reference

 

Assumptions
In this post, I assume that you already have Raspberry Pi 3 B+ or Raspberry Pi Zero W running Raspbian Stretch November 2017 version.

 

Steps
1. Check Current BlueZ Version
1-1. Before starting, let’s check the current BlueZ version.

bluetoothctl -v

In case you are using Raspbian Stretch (November 2017 version), the BlueZ version should be 5.43.

$ bluetoothctl -v
5.43

 

2. Install Dependencies
2-1. Update the package list.

sudo apt-get update

2-1. Install the dependencies.

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

 

3. Install Latest BlueZ
3-1. Download the latest version of BlueZ source code.

wget www.kernel.org/pub/linux/bluetooth/bluez-5.48.tar.xz

3-2. Uncompress the downloaded file.

tar xvf bluez-5.48.tar.xz && cd bluez-5.48

3-3. Configure.

./configure --prefix=/usr --mandir=/usr/share/man --sysconfdir=/etc --localstatedir=/var --enable-experimental 

3-4. Compile the source code.

make -j4

3-5. Install.

sudo make install

3-6. Reboot Raspberry Pi 3.

sudo reboot

 

4. Verify Update
4-1. Verify the BlueZ version by issuing the command below.

bluetoothctl -v

The result should be like this:

$ bluetoothctl -v
bluetoothctl: 5.48

 

References
[1] BlueZ Release Notes
[2] Installing Bluez 5.44 onto Raspbian? – Raspberry Pi Stack Exchange