Take full control of your USB Bluetooth controllers!
Project description
USB Bluetooth
Take full control of your USB Bluetooth controllers from Python!
If you want to use this library with Scapy, please check out scapy-usbbluetooth.
For general documentation about the project, please visit usbbluetooth.github.io.
For a C version of this library, check out UsbBluetooth for C.
For a C# version of this library, check out UsbBluetooth for C#.
Installation
Just use pip :)
pip install usbbluetooth
Usage
Once installed, you may list devices using usbbluetooth.list_controllers(), and for each device you may open() the device, write() and read() to them and close() it once you are done.
See the examples folder for some sample code.
Plaform quirks
Windows
In Windows you may have to install WinUSB driver in your device using Zadig. Otherwise, UsbBluetooth will detect your device but it may not be able to take control of your device.
Linux
Your Linux user must have permissions to access USB hardware. Here are several options to ensure access:
-
Run as root: Execute the application with elevated privileges using
sudo. Note that this may not be ideal for security reasons. -
Add user to a group: Add your user to the
plugdev,usboruucpgroup (depending on your distribution). Remeber to reboot or log out and log back in for the changes to take effect. For example:sudo usermod -a -G plugdev $USER -
Create a udev rule: Create a custom udev rule to automatically set permissions for USB Bluetooth devices. Create a file like
/etc/udev/rules.d/99-usbbluetooth.ruleswith content similar to:SUBSYSTEM=="usb", ATTR{idVendor}=="your_vendor_id", ATTR{idProduct}=="your_product_id", MODE="0666"Replace
your_vendor_idandyour_product_idwith the actual vendor and product IDs of your device (you can find these usinglsusb). Then reload udev rules withsudo udevadm control --reload-rules && sudo udevadm trigger.
History
Package versions < 0.1 were bindings around the original C library. The history for those packages can be found in the usbbluetooth repository in the respective tags.
Package versions >= 0.1 are developed in this repo and based of pyusb, the Python LibUSB binding.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file usbbluetooth-0.1.4.tar.gz.
File metadata
- Download URL: usbbluetooth-0.1.4.tar.gz
- Upload date:
- Size: 19.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
585b39b0cf2b2dce26e68910a86fc5e8f1906308f041bd3e183bf1b79b395d7a
|
|
| MD5 |
21e78f753f09fdff27d18646a6d0f06c
|
|
| BLAKE2b-256 |
5c303a95f2e9bd0ffd834fa8fca5c235ee435ecccd1360ad7d8cc2b723197911
|
Provenance
The following attestation bundles were made for usbbluetooth-0.1.4.tar.gz:
Publisher:
build.yml on usbbluetooth/usbbluetooth-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
usbbluetooth-0.1.4.tar.gz -
Subject digest:
585b39b0cf2b2dce26e68910a86fc5e8f1906308f041bd3e183bf1b79b395d7a - Sigstore transparency entry: 685366452
- Sigstore integration time:
-
Permalink:
usbbluetooth/usbbluetooth-python@e94d07fc46e200caaa0b9796a41206a0cc93e9cf -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/usbbluetooth
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@e94d07fc46e200caaa0b9796a41206a0cc93e9cf -
Trigger Event:
push
-
Statement type:
File details
Details for the file usbbluetooth-0.1.4-py3-none-any.whl.
File metadata
- Download URL: usbbluetooth-0.1.4-py3-none-any.whl
- Upload date:
- Size: 20.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62e56497a65a8485e4ffdc1c770de416be686b7a7630b04443638e3270668f90
|
|
| MD5 |
a08e239d472bf61041745c447d4790e5
|
|
| BLAKE2b-256 |
b28e7564726e39df3407391522e240f02133af9dc9f1b917e1fbcd869ee69d35
|
Provenance
The following attestation bundles were made for usbbluetooth-0.1.4-py3-none-any.whl:
Publisher:
build.yml on usbbluetooth/usbbluetooth-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
usbbluetooth-0.1.4-py3-none-any.whl -
Subject digest:
62e56497a65a8485e4ffdc1c770de416be686b7a7630b04443638e3270668f90 - Sigstore transparency entry: 685366453
- Sigstore integration time:
-
Permalink:
usbbluetooth/usbbluetooth-python@e94d07fc46e200caaa0b9796a41206a0cc93e9cf -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/usbbluetooth
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@e94d07fc46e200caaa0b9796a41206a0cc93e9cf -
Trigger Event:
push
-
Statement type: