Home

Awesome

bluepy

Python interface to Bluetooth LE on Linux

This is a project to provide an API to allow access to Bluetooth Low Energy devices from Python. At present it runs on Linux only; I've mostly developed it using a Raspberry Pi, but it will also run on x86 Debian Linux.

The code is tested on Python 2.7 and 3.4; it should also work on 3.3.

There is also code which uses this to talk to a TI SensorTag (www.ti.com/sensortag).

An example to interface the Nordic Semiconductor ASA IoT Sensor Kit, Thingy:52 is available in thingy52.py (https://www.nordicsemi.com/eng/Products/Nordic-Thingy-52).

Installation

The code needs an executable bluepy-helper to be compiled from C source. This is done automatically if you use the recommended pip installation method (see below). Otherwise, you can rebuild it using the Makefile in the bluepy directory.

To install the current released version, on most Debian-based systems:

$ sudo apt-get install python-pip libglib2.0-dev
$ sudo pip install bluepy

On Fedora do:

$ sudo dnf install python-pip glib2-devel

For Python 3, you may need to use pip3:

$ sudo apt-get install python3-pip libglib2.0-dev
$ sudo pip3 install bluepy

If this fails you should install from source.

$ sudo apt-get install git build-essential libglib2.0-dev
$ git clone https://github.com/IanHarvey/bluepy.git
$ cd bluepy
$ python setup.py build
$ sudo python setup.py install

I would recommend having command-line tools from BlueZ available for debugging. There are instructions for building BlueZ on the Raspberry Pi at http://www.elinux.org/RPi_Bluetooth_LE.

Documentation

Documentation can be built from the sources in the docs/ directory using Sphinx.

An online version of this is currently available at: http://ianharvey.github.io/bluepy-doc/

License

This project uses code from the bluez project, which is available under the Version 2 of the GNU Public License.

The Python files are released into the public domain by their author, Ian Harvey.

Release Notes

Release 1.3.0

Release 1.2.0

Release 1.1.4:

There was no release 1.1.3 made

Release 1.1.2: now deleted

Release 1.1.1

Release 1.1.0

Release 1.0.5

Release 1.0.4

Release 1.0.3

Release 0.9.12

Release 0.9.11

Release 0.9.10

Release 0.9.9

Release 0.9.0

Release 0.2.0

Release 0.1.0

Release dated 2-Jul-2014

Release dated 14-Apr-2014:

Release dated 12-Mar-2014

Initial release 19-Oct-2013:

TO DO list

The following are still missing from the current release: