--- id: bleak-retry-connector version: "4.6.3" license: MIT license_treatment: permissive maintenance: active --- # bleak-retry-connector — A connector for Bleak Clients that handles transient connection failures License: permissive · Maintenance: active · Downloads: 1.0M/mo ## What it is and what it does Bleak Retry Connector is a wrapper around the Bleak Bluetooth Low Energy client that adds automatic retry logic for transient connection failures. Instead of calling BleakClient.connect() directly, you call establish_connection() with your device and a retry count, and the library handles retries with intelligent backoff, service caching, and platform-specific workarounds. It solves common Bluetooth connection problems like timeouts on first attempt, "out of connection slots" errors on ESP32 devices, and interference from other Bluetooth operations. The package provides BleakClientWithServiceCache, which caches GATT services to speed up reconnections, and establish_connection(), which orchestrates the retry loop and error handling. It's designed for applications that need reliable Bluetooth connectivity across different operating systems and device types, particularly where transient failures are common or connection slots are limited. Use it for: - IoT applications connecting to multiple BLE devices where occasional timeouts or slot exhaustion occur. - Mobile or desktop apps that need to reconnect to wearables or sensors with automatic retry on failure. - Embedded device communication (e.g., ESP32) where connection slots are limited and retries are essential. - Long-running services that maintain persistent Bluetooth connections and need resilience to transient network glitches. - Testing or debugging Bluetooth devices where connection instability is expected during development. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Wraps Bleak's Bluetooth client with automatic retry logic and backoff to handle transient connection failures, including service caching for faster reconnections. Yes. The package is actively maintained, has no known vulnerabilities, carries a permissive MIT license, and solves a real problem in Bluetooth connectivity. If your application uses Bleak and experiences transient connection failures, this wrapper is a straightforward drop-in that adds retry logic and service caching with minimal overhead. Install it if you need reliable reconnection handling; skip it only if your use case has no tolerance for retries or you manage reconnection logic yourself. ## Install pip install bleak-retry-connector uv add bleak-retry-connector poetry add bleak-retry-connector ## Installing bleak-retry-connector Before you install: Low friction: pure Python wheel with four runtime dependencies (bleak, async-timeout, bluetooth-adapters, dbus-fast). Actively maintained as of 2026-07-22, last commit 2026-08-10. License in practice: MIT license permits commercial and private use with minimal restrictions; attribution required. Quickstart: pip install bleak-retry-connector import asyncio from bleak_retry_connector import establish_connection, BleakClientWithServiceCache async def connect(): client = await establish_connection( BleakClientWithServiceCache, device, "Device Name", max_attempts=3 ) await client.disconnect() asyncio.run(connect()) Requires Python 3.10 or later; dbus-fast may require system dbus development libraries on Linux. Verify before relying: - Whether service caching persists across process restarts or only within a session. - Specific backoff strategy and timing between retry attempts. - How platform-specific quirks are detected and handled (Windows vs. macOS vs. Linux). ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 1.0M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags bluetooth connection retry logic, bleak client reconnect handler, bluetooth transient failure recovery, BLE connection resilience, automatic bluetooth reconnect, bleak connection wrapper, bluetooth service caching, bluetooth, ble, async [View on SkillFed](https://skillfed.io/packages/bleak-retry-connector) · [View on PyPI](https://pypi.org/project/bleak-retry-connector/)