Skip to content

Instantly share code, notes, and snippets.

Embed
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.

DON'T FORGET!!!

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]

General

Python

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: https://stackoverflow.com/questions/41463847/got-error-while-download-gattlib-via-pip3/52271293#52271293

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/' setup.py
sudo pip3 install .
sudo pip3 install pybluez\[ble\]

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

Ruby

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