-
Notifications
You must be signed in to change notification settings - Fork 185
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
Consider asyncio bleak backend as gatttool replacement #304
Comments
I basically implemented this here: https://github.com/alexandrebarachant/muse-lsl/pull/148/files Here it is with the pump loop automatically run in a separate thread: alexandrebarachant/muse-lsl@6336053 |
Bleak looks great! @xloem I'm curious, what value do you see in adding PyGATT as a wrapper? I'm not actively maintaining this project anymore and haven't found anyone interested in picking it up, so I'm wondering if the best course of action is to consider it deprecated and redirect people to bleak instead. |
[Edit: sorry thought this was a different project]. That sounds okay. In muse-lsl I was just a new visitor, so I don't know what all the users, forks, and maintainers need in order to retain compatibility. It was pretty obvious from the codebase that people had been used to using pygatt for some time. And as mentioned in that PR I've only tested bleak on Linux, and one of the devs may have found a bug with it. |
Well, I tried Bleak for some months in production (connection to GoPro cameras) and can say that I saw strange behavior of BleakClient. It's method write_gatt_char doesn't guarantee that command was successfully send to device. BleakClient needs about 10-30 retries to send command. Sometimes it is doesn't work at all, but native gattool console utility works like a charm. So I decided to try pygatt. |
Hey that's a great report but why are you mentioning it here instead of the bleak project? Did you open an issue so they can learn of it and fix it? EDIT: I see you are saying pygatt still has value. As a user of bleak I'd really appreciate it if you'd open an issue so they can fix it some day. |
Yep, this is good idea, maybe I will have time to describe this bug with enough details.
Correct! This was my main intention to say that pygatt might be useful in some scenarios. |
https://github.com/hbldh/bleak is a cross-platform bluetooth interface using python's asyncio infrastructure. The use of asyncio provides for more flexibility for the user. The bleak api has native python implementations for linux, windows, and osx, requiring no calling out to other processes or asking the user for root access.
The text was updated successfully, but these errors were encountered: