Skip to content
Michael Saunby edited this page Jul 4, 2020 · 4 revisions

For a supported BLE (GATT) library see https://pypi.org/project/pygatt/

There are a couple of blog posts about this project.

http://mike.saunby.net/2014/04/sensortag-and-raspberry-pi-revisted.html

http://mike.saunby.net/2013/04/raspberry-pi-and-ti-cc2541-sensortag.html

And some other info you might need is here -

http://stackoverflow.com/questions/24853597/ble-gatttool-cannot-connect-even-though-device-is-discoverable-with-hcitool-lesc

http://www.cnx-software.com/2013/07/21/texas-instruments-sensortag-unboxing-getting-started-with-bluetooth-low-energy-in-linux-with-a-raspberry-pi/

As of May 2015 the latest Raspian image doesn't include Bluez Bluetooth tools, and doing 'sudo apt-get install bluez' will get you an old version that won't work with SensorTags, it might not work with any BLE devices.

Fortunately building from the latest source code is straightforward. The following shows the commands you'll need to type; responses aren't shown.

wget http://www.kernel.org/pub/linux/bluetooth/bluez-5.30.tar.xz
tar xf bluez-5.30.tar.xz
sudo apt-get install libusb-dev libdbus-1-dev libglib2.0-dev automake libudev-dev libical-dev libreadline-dev
cd bluez-5.30
./configure --disable-systemd
make
sudo make install
sudo cp attrib/gatttool /usr/local/bin/

Note that TI's Beaglebone doesn't require building Bluez from sources. See http://www.zephyr-labs.com/?p=87

There's now a Python GATT interface - https://bitbucket.org/OscarAcena/pygattlib

Clone this wiki locally