rust icon indicating copy to clipboard operation
rust copied to clipboard

Filtering by service UUID doesnt work on linux

Open andrewdavidmackenzie opened this issue 2 months ago • 6 comments

This relates to the ble-scan branch that is currently WIP.

My GUI app uses it to discover compatible radios.

On macOS, all works as expected.

As it's cross-platform, I just tried it for the first time on Linux.

It discovers as compatible radios all the BT devices in my house :-) So, it appears that the filtering by the meshtastic service is failing for me on Linux (Pop OS!)

andrewdavidmackenzie avatar Oct 06 '25 19:10 andrewdavidmackenzie

I'll try to debug on linux why this is not working

andrewdavidmackenzie avatar Oct 16 '25 10:10 andrewdavidmackenzie

I've developed this feature on Linux, please check the bluez daemon and command line tools such as bluetoothctl.

lukipuki avatar Oct 16 '25 10:10 lukipuki

I'm on Pop OS! Not sure if relevant.

I have issues sometimes connecting to bluetooth mouse and keyboards (but my experience on linux has never been great TBH).

I see running:

  • bluetoothd
> bluetoothctl devices
Device E2:AC:DF:4A:47:FD Meshtastic_47fd
Device EC:B7:CD:85:51:71 Meshtastic_5171
Device EE:F6:A1:29:B5:16 MX Anywhere 3 Mac

Screenshot from my app that uses the crate method to find meshtastic devices, showing the MX Anywhere 3 Mac device which is bluetooth mouse.

Image

andrewdavidmackenzie avatar Oct 16 '25 12:10 andrewdavidmackenzie

Maybe differences in the bluetooth stack on this distro?

andrewdavidmackenzie avatar Oct 16 '25 12:10 andrewdavidmackenzie

I've debugged it down into set_discovery_filtre() (in "bluez-generated 0.4.0" crate) where it calls method_call() to "org.bluez.Adapter1" and further down into dbus calls, but the UUID property seems to being passed in just fine...so I'm not sure where to look now.

I lack BT stack experience in general and in linux in particular - but happy to help try and debug more on this distro if you have suggestions...

Details of parameters passed to method_call() in dbus 0.90 crate:

Image

andrewdavidmackenzie avatar Oct 17 '25 10:10 andrewdavidmackenzie

Using bluetoothctl to inspect what the OS sees, it sees both devices, and the radio has the correct Vendor specific UUID:

[bluetooth]# info E2:AC:DF:4A:47:FD
Device E2:AC:DF:4A:47:FD (random)
        Name: Meshtastic_47fd
        Alias: Meshtastic_47fd
        Paired: no
        Bonded: no
        Trusted: no
        Blocked: no
        Connected: no
        LegacyPairing: no
        UUID: Vendor specific           (6ba1b218-15a8-461f-9fa8-5dcae273eafd)
        RSSI: 0xffffffd4 (-44)
        TxPower: 0x0000 (0)

and the other device (mouse) does NOT have the same Meshtastic service UUID:

[bluetooth]# info EE:F6:A1:29:B5:16
Device EE:F6:A1:29:B5:16 (random)
        Name: MX Anywhere 3 Mac
        Alias: MX Anywhere 3 Mac
        Appearance: 0x03c2 (962)
        Icon: input-mouse
        Paired: yes
        Bonded: yes
        Trusted: no
        Blocked: no
        Connected: no
        LegacyPairing: no
        UUID: Generic Access Profile    (00001800-0000-1000-8000-00805f9b34fb)
        UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
        UUID: Device Information        (0000180a-0000-1000-8000-00805f9b34fb)
        UUID: Battery Service           (0000180f-0000-1000-8000-00805f9b34fb)
        UUID: Human Interface Device    (00001812-0000-1000-8000-00805f9b34fb)
        UUID: Vendor specific           (00010000-0000-1000-8000-011f2000046d)
        Modalias: usb:v046DpB025d0015

So, I can only assume that the bluez library is not filtering on the UUID correctly?

andrewdavidmackenzie avatar Oct 17 '25 10:10 andrewdavidmackenzie