Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Bluetooth LE Programming On Raspberry Pi

Bluetooth LE Programming On Raspberry Pi

I'm looking at building up some Bluetooth LE programming expertise on Linux, specifically for use with Raspberry Pi 3 B+ and Pi Zero W models.

This is a compendium of libraries and tools that I'm looking at to build that skill on.


On the Raspberry Pi Zero W, a user must be a member of the bluetooth group to work with tools like bluetoothctl. Set this up with:

$ usermod -aG bluetooth [username]



To get pybluez installed, I had to increase the size of the system swapfile (the gattlib dependency wouldn't compile). See this for info on how to change the swapfile size.

Also has to fix a gattlib dependency, as described here:

Because pybluez requires root access, and because of the aforementioned issues, here's how I installed everything:

pip3 download gattlib
cd gattlib-0.20150805
sed -ie 's/boost_python-py34/boost_python-py35/'
sudo pip3 install .
sudo pip3 install pybluez\[ble\]

This ensures that root can see the packages, and that we get gattlib installed before pybluez.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment