aioble or low-level bluetooth for generic health device client on PICO-W? #13526
Replies: 2 comments 3 replies
-
I've used Bluetooth in C on a few embedded platforms in the past, and have been involved in the development of Bluetooth support on stm here in micropython. When aioble was first introduced here it was an absolute game changer for me, I think it's one of the best innovations in the entire Bluetooth industry to be honest. It dramatically simplifies BLE usage, especially for newer developers, and for me it provides significantly faster development of Bluetooth devices. I believe aioble code is far easier to review and clearly see what characteristics are expected to do. At work, junior developers have been able to ramp up on (existing) aioble based code and add new characteristic handling easier, which is definitely not the case on traditional C embedded platforms I'm used previously. To be fair, I was already a long term micropython developer and also very comfortable with asyncio usage. I don't know for sure if there's "feature parity" with all underlying Bluetooth features, in fact I've still got a few open pull requests for additional features. It's a pretty light weight library though and easy to expand once you find your way through it! |
Beta Was this translation helpful? Give feedback.
-
@brianreinhold I wrote and designed both the low-level API and aioble. I think if you're familiar with writing callback-based code, and if you understand BLE well (which you clearly do) then you'll probably have a pretty OK time with the low-level API. One of the things I wish I could revisit is the way the arguments are passed to the various events (via the If your app is already asyncio-based, then working with a callback-based API can be quite challenging. We wrote Making One major thing that would make aioble much more useful would be to implement a library of common services, so the user would never see the underlying characteristics and data types. You'd just e.g. use the environmental sensing library. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I need to write a generic client/central for health devices on a PICO-W. Some of these heath devices follow the BT SIG health device profiles but most are proprietary and one can never predict in advance what one might have to do in order to communicate with these devices.
The question is does the aioble high level library provide access to all the features of the low-level library such that proprietary devices can be handled? As I see it the advantages of the low-level library are
The aioble lib, on the other hand, is completely unfamiliar to me and requires learning a set of unique APIs that apply only to it. It also appears to try and hide/simply the event nature of BTLE which means a considerable investment in learning its structure (which is difficult in a dynamically typed language because you don't know what the fields in the examples mean). On the other hand, the number of lines of code one has to write seems considerably smaller though it might take a while to get used to what the async/await operations hide and how to use them.
If one can do everything using aioble that one can do in the low level API, then it is probably worth the learning curve for aioble. Anybody have experience between using aioble versus the low-level API?
Beta Was this translation helpful? Give feedback.
All reactions