Skip to content

Instantly share code, notes, and snippets.

@stonehippo
Last active March 23, 2024 21:35
Show Gist options
  • Star 17 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save stonehippo/d56d626927d0d4d137428341ac95b87b to your computer and use it in GitHub Desktop.
Save stonehippo/d56d626927d0d4d137428341ac95b87b to your computer and use it in GitHub Desktop.
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