SimplePyBLE provides Python bindings for SimpleBLE, a fully cross-platform Bluetooth Low Energy (BLE) library written in C++. It is designed for simplicity and ease of use, offering a consistent API across Windows, macOS, and Linux, with some support for iOS and Android. The library is currently at version 0.12.1 and maintains an active release cadence, with frequent updates addressing features, stability, and bug fixes.
pip install simplepybleVerified import paths — ran on the pinned version, not inferred.
This asynchronous quickstart demonstrates how to initialize an adapter, scan for Bluetooth Low Energy (BLE) peripherals, and connect to a discovered device. It uses the `simplepyble.aio` module, which offers an `asyncio`-compatible API with automatic callback cleanup and context manager support for robust asynchronous operations.
Review the new license terms (BUSL-1.1) for compliance with your project's use case. Contact SimpleBLE maintainers for commercial licensing inquiries if needed.
Upgrade to simplepyble v0.10.3 or newer to benefit from stability fixes related to threading and GIL management.
For asynchronous applications, use `from simplepyble.aio import Adapter` and follow the `asyncio` patterns. For older versions, consider upgrading or using separate threads for blocking BLE operations if a responsive UI is required.
Ensure that the 'Desktop development with C++' workload is installed in Visual Studio, including 'MSVC v143 - VS 2022 C++ x64/x86 build tools' and 'Windows 10/11 SDK'. If problems persist, consider trying a slightly older Python version for which pre-built wheels might be available.
Install the latest Microsoft Visual C++ Redistributable for your system (x64 and/or x86) from the official Microsoft website. Ensure any other system-level dependencies are correctly installed and visible in the system's PATH.
Install the necessary development packages. For Debian/Ubuntu-based systems, run: `sudo apt-get update && sudo apt-get install libdbus-1-dev`. Adapt for other distributions (e.g., `dnf install dbus-devel` on Fedora, `pacman -S dbus` on Arch).
Verify that your Bluetooth hardware is enabled and turned on. On Linux, ensure your user has permissions to access Bluetooth devices (e.g., `sudo usermod -a -G bluetooth $USER` and reboot). Restart the Bluetooth service if necessary (e.g., `sudo systemctl restart bluetooth`).