Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Bluetooth Low Energy (BLE) / GATT #68

Closed
GoogleCodeExporter opened this issue Mar 14, 2015 · 8 comments
Closed

Support for Bluetooth Low Energy (BLE) / GATT #68

GoogleCodeExporter opened this issue Mar 14, 2015 · 8 comments

Comments

@GoogleCodeExporter
Copy link

GoogleCodeExporter commented Mar 14, 2015

It would be great to have wrappers for the Bluetooth Low Energy features added 
in the recent version(s) of BlueZ, to allow for the following features to be 
controlled from a python application:

 * discovery of BLE devices and their GATT services
 * reading and writing of BLE attributes/values
 * creation and management of GATT services

I am interested in contributing, but not sufficiently experienced with the 
pybluez source code to create sensible abstractions for the low-level functions.

Original issue reported on code.google.com by aprsdr...@googlemail.com on 18 Jun 2014 at 1:38

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/16987615-support-for-bluetooth-low-energy-ble-gatt?utm_campaign=plugin&utm_content=tracker%2F13568755&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F13568755&utm_medium=issues&utm_source=github).
@GoogleCodeExporter
Copy link
Author

Any contribution will be more then wellcome
But I see no easier way  then get familiar with source code.

Maybe You could try to first implement "discovery of BLE devices and their GATT 
services"

As a starting point You could look at discover_devices function in 
https://code.google.com/p/pybluez/source/browse/trunk/bluetooth/bluez.py
it uses _bt.hci_inquiry which is implemented in 
https://code.google.com/p/pybluez/source/browse/trunk/bluez/btmodule.c#1973

Original comment by karu...@wp.pl on 23 Jun 2014 at 1:53

  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

@GoogleCodeExporter
Copy link
Author

There is also Ian Harvey's project
https://github.com/IanHarvey/bluepy
It wraps bluez 5.4, python sources are in public domain

As of windows support:
http://social.msdn.microsoft.com/Forums/en-US/65c9cf4e-e225-4fc3-8c2c-66cd2401d3
ed/how-to-establish-a-connection-from-windows-8-pc-to-a-bluetooth-low-energy-dev
ice

"The Windows 8 Bluetooth GATT apis requires that the device be paired using the 
built-in UI and does not allow application to connect to an arbitrary Bluetooth 
LE device."
So I am not sure how much can be implemented there


Original comment by karu...@wp.pl on 13 Aug 2014 at 10:59

@karulis
Copy link
Collaborator

karulis commented Aug 28, 2015

Now we have initial support for BLE on Linux platform - release 0.22

@larsblumberg
Copy link

Hi @karulis! Do I find a documentation somewhere what the state of BLE support is right now?

@ksze
Copy link

ksze commented Aug 9, 2017

Regarding BLE support, does anybody know whether it's possible (and how) to scan for BLE beacons without root privilege using pybluez?

Currently, if I try to scan for BLE beacons as a normal user (in the "bluetooth" and "lp" unix user groups), I get a RuntimeError:

~ $ ipython
Python 3.6.2 | packaged by rpi | (default, Jul 19 2017, 12:58:40)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.1.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: from bluetooth.ble import BeaconService

In [2]: service = BeaconService()

In [3]: service.scan(2)
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-3-b47b2f3a4f45> in <module>()
----> 1 service.scan(2)

RuntimeError: Set scan parameters failed (are you root?)

@stale
Copy link

stale bot commented Jul 23, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
PyBluez is not under active development, but we still accept pull requests!
If you've resolved your issue, please post your solution and close this issue. Future users will benefit from the knowledge you share. Thank you.

@stale stale bot added the wontfix label Jul 23, 2019
@stale stale bot closed this as completed Jul 30, 2019
@filips123
Copy link

@rgov @karulis Does BLE works on Windows 10? If not, can it be supported?

@rgov
Copy link
Collaborator

rgov commented Oct 3, 2019

I believe BLE only works on Linux. There is no one currently working on the project to add support for this, unfortunately. However, you may be able to use PyQt5 and its cross-platform QBluetooth API.

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

No branches or pull requests

6 participants