-
Notifications
You must be signed in to change notification settings - Fork 21
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
Failed to connect when device is already connected #29
Comments
Does the branch I am on a new PC without integrated bluetooth, cannot test this myself until I get a dongle. |
@newAM sadly enough it doesn't, it gets stuck on the listing/scanning step in bluez; it seems that the scan doesn't return already connected devices (which makes sense I guess); disconnecting from the desk (even while it's already scanning, as long as not all tries have been exhausted) makes it connect to it and report back. Sadly enough my python knowledge is quite limited, so I'm not how to help exactly, but it seems that the issue would be in here https://github.com/newAM/idasen/blob/master/idasen/__init__.py#L234 edit: or an issue with BleakClient itself? https://github.com/newAM/idasen/blob/master/idasen/__init__.py#L84 edit2: looks like it's a known limitation of Bleak hbldh/bleak#367 (comment) |
The last person said:
Would you know how to do that? My bluez/dbus experience is limited, I chose bleak simply because it looked like the only bluetooth back-end receiving regular bugfixes. Edit: Also, sorry for the slow replies, work has been keeping me rather busy on weekdays. |
Sadly enough not really 😅 No problem, work is keeping me quite busy too |
https://stackoverflow.com/a/16129705/620141 might be useful for a native connection? (The tutorial in particular) |
Huh, it appears the python socket interface will also just work. |
I've just completed a PoC in Node connecting the desk through IFTTT with google assistant, and I must say it's working AMAZINGLY so far 😎 |
As per the Prerequisites
However, I was unable to execute a command until I specifically DISCONNECTED the device.
My theory: When f.e. executing
bluetoothctl
I'm directly on the desk already, so the script is likely trying to connect the desk with another device; instead of just doing its thingAs being connected already would avoid scanning & connecting; thus significantly reducing execution time (especially for simple commands) I'd propose to actually check if we're already connected, and just communicate directly in that case, instead of trying to scan & connect
OS: Ubuntu 20.04
bleak is using bluez as backend (in my case)
edit: regarding timing, a no-op (simple read) takes 4-5 seconds currently
The text was updated successfully, but these errors were encountered: