-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
BLE Scan fails to start when running in parallel with BLE mesh #19361
Comments
Unfortunately this is currently by design. The Mesh stack essentially "owns" the advertising and scanning functionality and any attempts to make direct calls to |
I see, can you tell if there are any possible ways because the mesh follows the observer capabilities. It picks up packets and does the work accordingly. Can I filter out beacon packet of a particular type somewhere in the zephyr code? |
@stephenmasih currently you'd need to manually edit the I would like to introduce a more flexible scan API which would allow having multiple callbacks, perhaps even per advertising data type, however I put this work on hold when I realised we'd probably need to properly take into account Advertising Extensions as well. My worry was that since AE requires new APIs we'd end up having three different ways of catching advertisements. Anyway, the simple idea was to just have a linked list of callbacks, using something like this:
If we can do something like that which also fits nicely together with AE APIs then that would be ideal from my perspective. @joerchan FYI. |
Thank you @jhedberg FYI. Let me try editing the bt_mesh_scan_cb() in adv.c . Can you please tell me if it is possible to work with mesh beacons. As I see, |
@stephenmasih see section "3.9 Mesh beacons" in the Mesh Profile Specification. This covers both unprovisioned devices as well as secure network beacons. |
I added a callback function as you mentioned @jhedberg. My callback is getting triggered but my scanning stops after some time the mesh initialisation. I mean even my mesh data packets are dropped. My callback is also neither triggered anymore. I seems like it crashed. Can you explain to me the probable reason? |
@stephenmasih I wouldn't dare to claim a probable reason, but some common reasons can be stack overflows and controller asserts. I'd recommend enabling various logging/debugging Kconfig options to see if you can get some error outputted to the console. |
@stephenmasih if you have gdb access it would also help to use that to investigate in what state the system is |
Thank you @jhedberg. okay, let me dig deeper into debug mode. I will keep updated. |
If we can do something like that which also fits nicely together with AE APIs then that would be ideal from my perspective. joerchan FYI. @jhedberg I think this is covered by @trond-snekvik currently open PR. @stephenmasih Any updates on this? We have a similar bug-report for the advertiser, maybe it is the same type of issue for the scanner? It could be affecting the scanner disable call. |
@jhedberg @trond-snekvik can this be closed? |
I'd say so. @stephenmasih can reopen it if/when he's done with further digging and concluded that there's still something to fix in the stack. |
Describe the bug
When I try to start the scan before mesh initialising followed by self-provisioning and configuring. It fails with error code -11.
When I first successfully initialise, provision and configure the mesh. and then call bt_le_scan_start(). It fails with error code -69. But I am able to publish and subscribe to the mesh messages.
To Reproduce
Steps to reproduce the behaviour:
Expected behaviour
BLE mesh works in broadcaster and scanning topologies. I should be able to scan all nearby beacon packets and parallel stay involved in the mesh.
Screenshots or console output
The text was updated successfully, but these errors were encountered: