Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bluetooth Connection Timeout. #73

Open
chrisjaxy opened this issue Nov 25, 2022 · 2 comments
Open

Bluetooth Connection Timeout. #73

chrisjaxy opened this issue Nov 25, 2022 · 2 comments

Comments

@chrisjaxy
Copy link

  • OS: Ubuntu 20.04
  • Bluetooth Hardware: MTK-7921
  • BlueZ Version: 5.53
  • Python Version: 3.8.10
  • ble-serial and dependency versions: ble-serial:2.6.1,bleak:0.19.5

Additional Context
I refer to the instructions to connect to BLE Bluetooth, such as ESP32, WLT8016, but I find that the Bluetooth connection is always disconnected. I grab the logs with hcidump and btmon, and it shows Connection Timeout. This rarely happens when I use bluetoothctl to connect to a Bluetooth device. I wonder if there is any difference between these two connections?

@Jakeler
Copy link
Owner

Jakeler commented Nov 26, 2022

It really should not make a difference, both bluetoothctl and ble-serial/bleak utilize the bluez dbus API. They should send practically the same commands.
Is there is specific time when the connection breaks? did you also try enabling notifications/indications via bluetoothctl, maybe that causes issues?
Otherwise you could check with the super verbose mode -vv or what happens on the bus dbus-monitor --system "destination=org.bluez".

@chrisjaxy
Copy link
Author

According to your method, I found these in the ble-serial log

DEBUG | manager.py: received D-Bus signal: org.freedesktop.DBus.Properties.PropertiesChanged (/org/bluez/hci0/dev_01_00_0A_DA_67_25): ['org.bluez.Device1', {'ServicesResolved': <dbus_fast.signature .Variant ('b', False)>, 'Connected': <dbus_fast.signature.Variant ('b', False)>}, []]’

In dbus-monitor, there is no special log for disconnection.

method return time=1669600087.902222 sender=org.freedesktop.DBus -> destination=:1.526 serial=344 reply_serial=22785

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants