-
Notifications
You must be signed in to change notification settings - Fork 250
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
Is there a plan to support Bluetooth? #203
Comments
There was some rudimentary BT support in Circle earlier, but it was removed for legal reasons. In my opinion it is not possible to develop BT support, without being a member of the BT SIG (Special Interest Group). Please see issue #90 for a discussion on this. |
I had an idea, that it may be possible to port an existing BT stack (e.g. BlueZ) to Circle. BlueZ is GPL licensed and perhaps may be ported without using the BT core specs, which is prohibited for non-BT-SIG-members. Unfortunately I'm not familiar with BlueZ and I don't know, if it would provide all required functions, which one would need to use BT with Circle. In any way it's probably a big effort to port it. |
Can I use bluetooth by just apt install bluez without porting bluetooth driver? I'm testing raspberry pi and I installed bluez directly to use bluetooth |
To avoid Bluetooth membership fees, I thought maybe I could use AdHocWiFi, which can also share the network. |
Just my 2 cents: it's relatively easy to port nimble (https://github.com/apache/mynewt-nimble) to circle. I've done it (in a hacky way but it works) and it's only a matter of modifying nimble_hci.cpp to use CBTUARTTransport and writing the OS abstraction layer nimble_npl_os.cpp |
@tadli I don't think, that any available BT stack will run on Circle without porting it. Unfortunately I don't expect the Circle WLAN support to work in a wireless ad hoc scenario. @sebastienNEC Thanks for the info about nimble! This is very interesting. I will have a look on it. |
I had a look on NimBLE and currently I can connect a RPi 4B running the NimBLE bleprph application with my desktop PC. I used an USB BT dongle so far, not the internal BT device. Unfortunately this is only a quick porting hack and the way to some useful application and support for all internal BT devices of the different RPi models is probably long. I'm currently not sure, if it is worth going this way. NimBLE does support BLE (BT Low Energy) only, so it wouldn't help for standard BT (BR/EDR) applications. And I have no idea, for what this can be used in the end. Honestly I'm not very familiar with BT applications. |
Hello Rene, sorry for the very late reply ! I am personally using (nim)BLE for wireless MIDI but I guess other use cases include wireless mice/keyboards ? And potentially quite a few IoT devices. |
No problem. I would be interested in using NimBLE to communicate between multiple devices (e.g. some RPis Zero W) in a mesh, like the microbit does in the image at the end of this tutorial. Unfortunately I do not know, how to implement this from the point of view of a NImBLE application. NimBLE provides many services for applications, but which have to be used? This is really a hack so far, what I have done and describing it wouldn't help very much probably. But if there would be an interesting application, I would think about improving it. |
Isn't Raspberry Pi Trading Ltd. paying those, and hence we are paying them by buying the devices? |
No, any usage of the BT core spec is prohibited, if you are not a member of
the BT SIG. I cannot talk about others, but by myself I won't use it.
A possibility would be to use open source source code, which is ready to be
ported, so that one does not need to look into the specs. I tried this with
NimBLE earlier, but realized, that most of the Raspberry Pis, that I have
here, do not support the necessary version of BLE yet. Even my RPi 4B would
not work with it. I have a RPi 400, which would work, probably because it uses
a newer revision of the wireless chip.
But, this discussion is currently difficult, because I won't have enough time
left to deal with BT. I'm currently very busy, especially with the RPi 5.
There is lots to do for it.
|
I found this gem https://www.rpi4os.com/part7-bluetooth/ |
Yes, but this does only send a BT beacon. For a reasonable BT support it would require much more. The hardware interface is not the problem. We already had this in Circle years ago (see commit 41b5650). It was removed for legal reasons. One could only try to port some existing open source BT package, but I tried this already with NimBLE, which is BLE (low energy), but found out, that it works only on the RPi 400 (and maybe newer RPi 4B) models, so I aborted this project. I don't know about RPi 5, because it was not available at this time. I'm also not a BT expert, so this would be difficult for me. |
Oh did not realise about the 41b5650. Since HCI layer is covered I think I can try to get NimBLE's GATT layer to work, that can be an entry point to BLE MIDI which is simple enough. |
I have done that (BLE MIDI with nimble, see above) a few years back, and it works indeed. @rsta2 BLE also works on raspberry pi zero W. |
@sebastienNEC If pointers were there do we access to all NimBLE Host APIs? GATT Server/Client? Do you know if also the Security API works? |
I've only ever used the JustWorks association model, but there's no reason the rest should not work. I am using both ble_gatts_* and ble_gattc_* functions, so yes both GATT server/client works. I also tried to send raw audio over an L2CAP connection, but abandoned that, as I could not get low enough latency for my purposes. Mind you, I was using Nimbler 1.0.0 back then, and they are quite a few versions further. |
BLE also works on raspberry pi zero W.
@sebastienNEC I tested my RPi 4B and it didn't work, because the supported BLE
version was not sufficient. Then I tested RPi 400 and it worked. But if some RPi
4B do not work, that's a problem. Perhaps you used a newer version of NimBLE,
which works with older BLE versions?
|
If one of you guys wants to provide a BT library for Circle, it would be great! I think you have more BT knowledge than myself, so this should be easier for you. In case you want to develop such library, my suggestion would be, to do this as a separate project in your own project space on GitHub. Circle could be integrated as a submodule, like this has been done for other projects (e.g. libcamera). This would make it easier for you to develop and maintain the project. There could be a link added in the Circle Wiki to your project, so that potential users can find it more quickly. If you need modifications in Circle to be able to support BT, just let me know! |
Not a BLE expert, but could this be helpful in any way? |
Not a BLE expert, but could this be helpful in any way?
* https://github.com/rppicomidi/pico-w-ble-midi-lib
This is for the RPi Pico, but it's up to @omersiar, @sebastienNEC or to
anybody, who wants to deal with such a project, to decide, on what he/she
wants to build on.
|
@rsta2 Thanks for putting it in a direction. @sebastienNEC I have created the repository for it > https://github.com/omersiar/libbt (just a placeholder, structure copied from libcamera) |
Hello, sorry about the late reply ! I won't be able to contribute to the actual development unfortunately (lack of time, 2 small kids), but I can of course provide my code as it is. Give me some day to clean it up though, and I'll add it to the repository you created :) |
Bluetooth can be used for sharing network, it would be cool to use Bluetooth function.
The text was updated successfully, but these errors were encountered: