-
Notifications
You must be signed in to change notification settings - Fork 46
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
Can't get monitor #110
Comments
What BlueZ version are you using? |
5.70, up to date Arch Linux. |
You need to launch your |
Now this code panics with error kind |
Could you check whether this example works for you? |
I am not able to get the passive scan example to find the nearby bluetooth advertisers such as
when I run
it just runs without displaying anything. my I also added @surban do I need to modify the patterns value? |
I have never used the Bluetooth passive monitoring functionality myself. Maybe @kjetijor can help. |
So - there's two things.
|
@kjetijor thanks for the help. I am not able to see anything when I run
I generated an advertising packet on another device using
And I captured the OTA advertisement which I think should be picked up by the pattern setting. What are your thoughts as to what could be wrong? |
@potto216 You'd need to advertise manufacturer id 0x0499 (or 0x9904 - depending on whether or not bluetoothctl interprets the manufacturer id argument as big or little endian). With your bluetoothctl advertisement you'd need to change the or-pattern in the example to i.e. |
@potto after having slept on that, I think in order to get the LE example to do anything moderately useful - you're going to need an advertisement that changes as well. The way it works today is, when we first see/discover an advertisement that matches the or-pattern, we subscribe to the device that sent it for updates, any subsequent advertisements that come that matches our or-pattern, we get an update event. I think - with an un-changing advertisement you should hit this print statement but anything in the polling loop needs the advertisement to actually change. I've tried to get bluetoothctl to generate something useful, without too much luck - so; yea - handcrafted hcitool it is. I changed the or-filter to something that uses the non-specific manufacturer id 0xffff, and tossed in a few extra bytes.
If this works for you - I might actually go ahead and update the example with the or-filter and the hcitool handcrafted monstrosity. |
Hi @kjetijor thanks for the help. I'm not getting any output when I run
and advertise with
Tomorrow I'll try to capture the advertising packets over the air to make sure it is advertising. |
@potto216 you did update the or-pattern in the example? |
No I forgot, I'll try that out tomorrow, |
@kjetijor I modified the pattern to be |
@potto216 I'm getting to the "I'm at a loss" stage - Do you have multiple bt-interfaces attached ? is the "default interface" the wrong one ? Does bt passive scanning work with your bt interface and bluez at all ? (I.e. did it work using other bindings to bluez ?) - Having gone through my collection of bt dongles, this is experimental - I have a 50-50 success rate in getting it to work at all, ranging from the "fails with an error", "fails silently" and "occasionally work, after you randomly restart bluetoothd and/or yank/insert the bt dongle". |
I’ll check the bluez messages and also dbus messages in depth after
December 9th. I’m running both the advertiser and scanner on raspberry pi’s
using the latest bluez build. I was able to get the bluer device scan to
get advertisements but didn’t test with these advertisements. Thanks for
your help
…On Thu, Nov 30, 2023 at 12:08 PM Kjetil Jørgensen ***@***.***> wrote:
@potto216 <https://github.com/potto216> I'm getting to the "I'm at a
loss" stage - Do you have multiple bt-interfaces attached ? is the "default
interface" the wrong one ?
Does bt passive scanning work with your bt interface and bluez at all ?
(I.e. did it work using other bindings to bluez ?) - Having gone through my
collection of bt dongles, this is experimental - I have a 50-50 success
rate in getting it to work at all, ranging from the "fails with an error",
"fails silently" and "occasionally work, after you randomly restart
bluetoothd and/or yank/insert the bt dongle".
—
Reply to this email directly, view it on GitHub
<#110 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACLYMF2HNU26SBE3ROAHOHTYHC4RFAVCNFSM6AAAAAA7OQP7T2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZUGE4DGOBUGE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Well it now works and I'm not sure why, maybe antenna position.
with
and using the HCI commands given by @kjetijor or the following bluetoothctl commands
BTW @kjetijor was it intended that the advertising packets have a lot of zero length advertising elements (below)? Which seem to be from the HCI_LE_Set_Advertising_Data's Advertising_Data_Length being set to 0x1E so it includes the zero padding in the Advertising_Data parameter (below). @kjetijor thanks for your help with resolving this. |
@potto216 the zero-padding was primarily just an artifact left over from borrowing from a random reply on the internet; I forget where, it may be entirely superfluous. |
@LinuxHeki does this now work for you? Can this issue be closed? |
I am closing as completed for now, since there has been no response. Feel free to reopen if the issue still exists. |
Running this crashes with error:
DBus error org.freedesktop.DBus.Error.UnknownMethod: Method "RegisterMonitor" with signature "o" on interface "org.bluez.AdvertisementMonitorManager1" doesn't exist
The text was updated successfully, but these errors were encountered: