Passive scanning with bluez or_pattern to filter on device address #1612
Unanswered
LeCyberDucky
asked this question in
Q&A
Replies: 1 comment 8 replies
-
This has an "X" in the "AD" and "SRD" columns for "LE Bluetooth Device Address", so I don't think this would work. I think the best you can do is filter on the service UUID in the Service Data. |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey there!
I'm trying to monitor measurements from a bluetooth scale via passive scanning using a Raspberry 3b+. But I'm unable to get even a minimal example to work.
I'm running Raspbian 12, bookworm (Linux 6.1.41-v7+ armv7l).
I built bluez from source a couple of days ago (including experimental features), landing me at version 5.76.
Here's the code I have at the moment:
The
0x1B
part of the pattern is the LE Bluetooth Device Address, as stated here: https://www.bluetooth.com/wp-content/uploads/Files/Specification/HTML/Assigned_Numbers/out/en/Assigned_Numbers.pdf?v=1720033659741and here https://www.bluetooth.com/specifications/css-11/
The
b'\xD8\xE7\x2F\xA6\x11\x21'
part is the MAC address of my device.I get no results whatsoever using the above code. Does anybody have an idea about what might be going wrong?
Edit: From looking through the issues for this repo, I just stumbled upon the
btmon
tool. Running this in another window, while executing the above script, yields an error:= bluetoothd: Invalid argument of property Patterns of the Adv Monitor at path /org/bleak/3072/197..
This begs the question what is wrong with my pattern.
Edit 2:
I found an issue with some example code showing just how wrong my attempt at creating a pattern was.
Now I have this:
With that, my program still doesn't provide any results. But
btmon
gives me a bunch of much more interesting output. In fact, the data I'm looking for appears in the output ofbtmon
:Beta Was this translation helpful? Give feedback.
All reactions