-
-
Notifications
You must be signed in to change notification settings - Fork 335
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
AAVAA board: native BLE does not connect to device on MacOS #667
Comments
Welcome to BrainFlow project and thanks for your contribution! We will try to fix your issue ASAP. Make sure that you have read about issue format in the docs. |
Hi! I see that you are adding a new board, it will be great if you open a PR with these changes to upstream and I will be glad to merge it after review. Regarding macos issue, in the latest release there were a lot of changes in macos simpleble backend, do you try it with them or without? |
Hi @Andrey1994, Thanks for the quick reply. |
I am talking about this one #666 |
I have #666 in my recent test. I will try to test without and see if it solves the issue. |
I had issues with in code it looked like this:
I see that you do not have this ugly hack, maybe worth trying at least with previos version of simpleble |
I actually saw that too. My problem is that it never gets out of the method |
Another idea to try - do smth with permissions for macos and bluetooth. I have no idea how it works but somehow macos requires bluetooth permissions for certain applications and these permissions are inherited somehow as far as I understand |
maybe will be different without this PR |
To make the matter even more weird, in some lucky tries the device connects successfully and streams but then gets stuck for the rest of the day! It seems really hectic. |
Could you add some prints in this method There are multiple calls of |
Sorry, it was a busy day. I put some loggings in that method and it gets stuck here. I have no idea about SimpleBLE so it'd be great if you could help. |
Can you try it wo python also? Cpp example to get data will be the best option to test |
And did you try it wo this PR for ble update? |
I haven't checked the code with cpp yet, but with python and without #666 in the logs it prints that it failed:
but the method never returns, meaning it gets stuck somewhere else. |
it can be an issue with calling its currently under ifdef linux, maybe makes sense to expand it for macos.. if you build your cpp code with |
I asked simpleble developers for advice, other than that wo mac I cannot do much. You can join their discord also - there is a link in readme https://github.com/OpenBluetoothToolbox/SimpleBLE BTW did you check permissions for ble like here https://github.com/pauldemarco/flutter_blue/issues/1011#issuecomment-1008096832 ? |
Unfortunately, I don't have I'd appreciate it if you let me know about possible solutions or updates. In the mean time I will dig into the code and debug it. |
I had issues with gdb on mac too, bit I think I managed to install it via macports or by building it from the source code |
Since you brought up SimpleBLE, I tested with their code on their repo and without BrainFlow and only SimpleBLE everything looks good, I can scan and connect really fast. Does that help? Also on the permissions side, I have already checked all those and I have the right permissions. I can easily connect and stream using |
#671 this may help |
We are not seeing similar issues with BrainFlow 5.9.0 and OpenBCI Ganglion using Native Bluetooth on multiple Macs. @aavaa-farnood can we rename this issue to include the name for the board you are using? |
yes, it makes sense. Regarding further testing I can propose next steps to see at which layer it fails:
If it fails at steps 2 or 3 than its more likely an issue from simpleble or I copypasted it with mistake(its possible). If you see the issue at step 4 then we will need to debug whats wrong with my wrapper and loader |
Description
When compiled from source, the library connects to the board using BLE on Windows, but the same code compiled on MacOS does not connect to the same board and gets stuck in this method:
simpleble_peripheral_connect()
.To Reproduce
Please refer to this fork to see the changes:
Code:
Logs:
Info (please complete the following information):
Expected behavior
The same compiled code works great on Windows, but not on MacOS
Additional context
The code on MacOS is compile using
cmake
andNinja
:The text was updated successfully, but these errors were encountered: