bleak.exc.BleakDBusError: [org.bluez.Error.Failed] le-connection-abort-by-local
See original GitHub issue- bleak version:
0.16.0
- Python version:
3.10
- Operating System: Home Assistant docker container
Linux homeassistant 5.15.32-v8 #1 SMP PREEMPT Tue Aug 16 14:52:58 UTC 2022 aarch64 Linux
- BlueZ version (
bluetoothctl -v
) in case of Linux:5.64
Description
Cant connect to device
What I Did
import asyncio
import binascii
import uuid
from bleak import BleakClient, BleakScanner
from bleak.exc import BleakError
MAC = "00:A0:50:82:75:CA"
NAME_CHARACTERISTIC = '00002A00-0000-1000-8000-00805F9B34FB'
GENERAL_SERVICE = '00001801-0000-1000-8000-00805f9b34fb'
async def main(ble_address: str):
device = await BleakScanner.find_device_by_address(ble_address, timeout=20.0)
async with BleakClient(device) as client:
services = await client.get_services()
print("Services:")
for service in services:
print(service)
value = bytes(await client.read_gatt_char(uuid.UUID(NAME_CHARACTERISTIC))).decode('utf-8')
print(value)
asyncio.run(main(MAC))
The stack-trace is:
Traceback (most recent call last):
File "/config/./debug_bleak.py", line 29, in <module>
asyncio.run(main(MAC))
File "/usr/local/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/local/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
return future.result()
File "/config/./debug_bleak.py", line 21, in main
async with BleakClient(device) as client:
File "/usr/local/lib/python3.10/site-packages/bleak/backends/client.py", line 61, in __aenter__
await self.connect()
File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/client.py", line 167, in connect
assert_reply(reply)
File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/utils.py", line 24, in assert_reply
raise BleakDBusError(reply.error_name, reply.body)
bleak.exc.BleakDBusError: [org.bluez.Error.Failed] le-connection-abort-by-local
Same code at the native Linux works correctly
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:20 (2 by maintainers)
Top Results From Across the Web
[org.bluez.Error.Failed] Software caused connection abort
Failed ] Software caused connection abort or This service is already present in this BleakGATTServiceCollection! When I exit the program, I get ...
Read more >Bluetooth connection error while using bleak in raspberrypi 400
I am using raspberry pi 400 and I using bleak python module to ... bleak.exc.BleakDBusError: [org.bluez.Error.Failed] Input/output error
Read more >Error when trying to connect to bluetooth speaker: `org.bluez ...
I was trying to pair my magic keyboard and it was failing with "Failed to connect: org.bluez.Error.Failed" no matter what I tried. Only...
Read more >Controlling nRF52840 Express Feather from Raspberry Pi
Adafruit CircuitPython supports using Bluetooth Low Energy (BLE) to communicate ... bleak.exc.BleakDBusError: org.bluez.Error.NotPermitted
Read more >BLE Characteristic Read failed with ATT error - Apple Developer
Client App - An external device works with bluez; iOS peripheral app register a Gatt Service with 1 characteristic; external client device connect...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Same issue on x86 Ubuntu 22.04.1
When my RTL8761BU based ZEXMTE BT-505 gets overloaded I get this error.
I replaced it with a Feasycom FSC-BP119 which is CSR8510A10 and seems to handle the bluetooth density quite a bit better.