Skip to main content

Take full control of your USB Bluetooth controllers!

Project description

USB Bluetooth

Build PyPI Snyk

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, usb or uucp group (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.rules with content similar to:

    SUBSYSTEM=="usb", ATTR{idVendor}=="your_vendor_id", ATTR{idProduct}=="your_product_id", MODE="0666"
    

    Replace your_vendor_id and your_product_id with the actual vendor and product IDs of your device (you can find these using lsusb). Then reload udev rules with sudo 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

usbbluetooth-0.1.4.tar.gz (19.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

usbbluetooth-0.1.4-py3-none-any.whl (20.0 kB view details)

Uploaded Python 3

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

Hashes for usbbluetooth-0.1.4.tar.gz
Algorithm Hash digest
SHA256 585b39b0cf2b2dce26e68910a86fc5e8f1906308f041bd3e183bf1b79b395d7a
MD5 21e78f753f09fdff27d18646a6d0f06c
BLAKE2b-256 5c303a95f2e9bd0ffd834fa8fca5c235ee435ecccd1360ad7d8cc2b723197911

See more details on using hashes here.

Provenance

The following attestation bundles were made for usbbluetooth-0.1.4.tar.gz:

Publisher: build.yml on usbbluetooth/usbbluetooth-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for usbbluetooth-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 62e56497a65a8485e4ffdc1c770de416be686b7a7630b04443638e3270668f90
MD5 a08e239d472bf61041745c447d4790e5
BLAKE2b-256 b28e7564726e39df3407391522e240f02133af9dc9f1b917e1fbcd869ee69d35

See more details on using hashes here.

Provenance

The following attestation bundles were made for usbbluetooth-0.1.4-py3-none-any.whl:

Publisher: build.yml on usbbluetooth/usbbluetooth-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page