- Install or update BlueZ 5.51 or higher
Your device will need to install or update BlueZ with version 5.51 or higher. We've outlined a quick snippet set of instructions below to install BlueZ 5.61 as an example.
sudo apt-get updatesudo apt-get upgradesudo apt-get install libdbus-1-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev python-docutils -ywget http://www.kernel.org/pub/linux/bluetooth/bluez-5.61.tar.xztar -xf bluez-5.61.tar.xzcd bluez-5.61./configuremakesudo make install
- Add support for Linux to iOS connections.
BlueZ 5.51 and above try to automatically read the battery status/service of devices when they connect. However, by default, iOS devices will prevent BlueZ services from reading the battery service. As a result, BlueZ connection attempts will cause iOS devices to show a pairing prompt constantly. Therefore, we will need to disable the battery service in BlueZ, use the following steps.
Open the bluetooth service file. Depending on your system, it will be located either at
/etc/systemd/system/bluetooth.target.wants/bluetooth.service. Use your favorite text editor like vim or nano to edit these files. In addition, you may need sudo permission to write to this file.
Find the line beginning with
-P batteryto the end. Now the line should look like this:
ExecStart=/usr/lib/bluetooth/bluetoothd -P battery
- Save the file.
systemctl restart bluetoothto apply the changes to the Bluetooth service After that, BlueZ should be able to connect to iOS devices without prompting and Ditto Apps should be able to communicate over BLE between iOS and Linux.