At the moment yocto/openembedded ships with BlueZ4 as the Linux Bluetooth protocol stack. Due to the fact that Bluetooth low energy is only supported in BlueZ5 this is a bit of a disappointment. There is a long-standing bug report on this #5031 . But since the commit 1139cc4e… the used BlueZ version can be selected. According to the reference manual BlueZ5 can be enabled by adding bluez5 to the DISTRO_FEATURES for me the easiest way to to this was adding the following line to my conf/local.conf in the Build Directory.

DISTRO_FEATURES = "ext2 alsa wifi usbhost bluetooth bluez5 ${DISTRO_FEATURES_LIBC}"

This disables x11 for example. But you may also could add something like this:

DISTRO_FEATURES_append = "bluez5"

After this run an build of your preferred image. In my case this was “core-image-base”

bitbake core-image-base

To have full bluetooth support on the target I needed to install some extra packages. To get a list of all bluetooth related packages run the following command. For this you need a opkg/ipkg feed server.

root@odroidc1:~# opkg list | grep blue
bluez5 - 5.29-r0 - Linux Bluetooth Stack Userland V5  Linux Bluetooth stack V5 userland
bluez5-dbg - 5.29-r0 - Linux Bluetooth Stack Userland V5 - Debugging files  Linux Bluetooth
bluez5-dev - 5.29-r0 - Linux Bluetooth Stack Userland V5 - Development files  Linux Bluetooth
bluez5-doc - 5.29-r0 - Linux Bluetooth Stack Userland V5 - Documentation files  Linux Bluetooth
bluez5-noinst-tools - 5.29-r0 - Linux Bluetooth Stack Userland V5  Linux Bluetooth stack V5 userland
bluez5-obex - 5.29-r0 - Linux Bluetooth Stack Userland V5  Linux Bluetooth stack V5 userland
bluez5-testtools - 5.29-r0 - Linux Bluetooth Stack Userland V5  Linux Bluetooth stack V5 userland
libasound-module-bluez - 5.29-r0 - Linux Bluetooth Stack Userland V5  Linux Bluetooth stack V5 userland
packagegroup-base-bluetooth - 1.0-r83 - Bluetooth support  Merge machine and distro options to create a basic

I installed the following packages:

bluez5-testtools, bluez5-noinst-tools

The later bluez5-noinst-tools was required for the gatttool.

Comments