Skip to content
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

Discovery example = "Invalid arguments in method call" #5

Closed
bobgates opened this issue Jul 7, 2021 · 5 comments
Closed

Discovery example = "Invalid arguments in method call" #5

bobgates opened this issue Jul 7, 2021 · 5 comments

Comments

@bobgates
Copy link

bobgates commented Jul 7, 2021

I'm not able to run the discover_devices example:

Platform:
5.10.17-v7+ #1421 SMP Thu May 27 13:59:01 BST 2021 armv7l GNU/Linux
Using bluez 5.50.

I get this error:

Error: Error { kind: InvalidArguments, message: "Invalid arguments in method call" }

The code fails on this line in adapter.rs, in the function discovery_session, around about line 140 (I've been messing with code, line number is vague):

                    self.call_method("SetDiscoveryFilter", (filter.to_dict(),)).await?;

The filter it is called with contains:

DiscoveryFilter { uuids: {}, rssi: None, pathloss: None, transport: Auto, duplicate_data: false, discoverable: false, pattern: None }
@surban
Copy link
Collaborator

surban commented Jul 7, 2021

You can set the log level to trace to see D-Bus messages.

Could you try again with bluez 5.59 or master? I've never tested older versions.

@bobgates
Copy link
Author

bobgates commented Jul 7, 2021

How do I set bluez 5.59? apt tells me I'm at most recent version?

@surban
Copy link
Collaborator

surban commented Jul 7, 2021

http://www.bluez.org/release-of-bluez-5-59/

Either update your distribution or build and install from source.

@bobgates
Copy link
Author

bobgates commented Jul 7, 2021

Okay, that worked: discover_devices is now running

@bobgates bobgates closed this as completed Jul 7, 2021
@fujexo
Copy link

fujexo commented Sep 30, 2022

Got the example working on Raspbian Bullseye with bluez 5.55-3.1. Thanks for the hint about bluez update!

root@terrariumpi:~# lsb_release -a 
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 11 (bullseye)
Release:        11
Codename:       bullseye
root@terrariumpi:~# dpkg -l | grep bluez
ii  bluez                          5.55-3.1                         armhf        Bluetooth tools and daemons
ii  bluez-firmware                 1.2-4+rpt8                       all          Firmware for Bluetooth devices

This didn't work on Raspbian Buster with bluez 5.50-1.2~deb10u2+rpt1

root@terrariumpi:~# RUST_LOG=trace /home/pi/bletest_bluer                                                                                                                                                                                   
[2022-09-30T02:34:45Z TRACE bluer::session] Connected to D-Bus with unique name :1.124629                                                                                                                                                   
[2022-09-30T02:34:45Z TRACE mio::poll] registering event source with poller: token=Token(1), interests=READABLE                                                                                                                             
[2022-09-30T02:34:45Z TRACE bluer::session] Starting event loop for :1.124629                                                                                                                                                               
Discovering devices using Bluetooth adapater hci0                                                                                                                                                                                           
                                                                                                                                                                                                                                            
[2022-09-30T02:34:45Z TRACE bluer::adapter] /org/bluez/hci0: org.bluez.Adapter1.Powered := true                                                                                                                                             
[2022-09-30T02:34:45Z TRACE bluer::session] Starting new single session for /org/bluez/hci0                                                                                                                                                 
[2022-09-30T02:34:45Z TRACE bluer::adapter] /org/bluez/hci0: org.bluez.Adapter1.SetDiscoveryFilter ({"Discoverable": Variant(false), "UUIDs": Variant([]), "Transport": Variant("auto"), "DuplicateData": Variant(false)},)                 
[2022-09-30T02:34:45Z TRACE bluer::adapter] /org/bluez/hci0: org.bluez.Adapter1.SetDiscoveryFilter (...) -> Err(D-Bus error: Invalid arguments in method call (org.bluez.Error.InvalidArguments))                                           
[2022-09-30T02:34:45Z TRACE bluer] DBus error org.bluez.Error.InvalidArguments: Invalid arguments in method call                                                                                                                            
[2022-09-30T02:34:45Z TRACE mio::poll] deregistering event source from poller                                                                                                                                                               
[2022-09-30T02:34:45Z TRACE mio::poll] deregistering event source from poller                                                                                                                                                               
Error: Error { kind: InvalidArguments, message: "Invalid arguments in method call" }                                                                                                                                                        

otaviojr added a commit to otaviojr/bluer that referenced this issue May 10, 2023
# This is the 1st commit message:

BLE Passive Scanning

# This is the commit message #2:

monitor

# This is the commit message bluez#3:

monitor

# This is the commit message bluez#4:

monitor

# This is the commit message bluez#5:

monitor

# This is the commit message bluez#6:

monitor

# This is the commit message bluez#7:

monitor

# This is the commit message bluez#8:

monitor

# This is the commit message bluez#9:

monitor

# This is the commit message bluez#10:

monitor

# This is the commit message bluez#11:

monitor

# This is the commit message bluez#12:

monitor

# This is the commit message bluez#13:

monitor

# This is the commit message bluez#14:

monitor

# This is the commit message bluez#15:

monitor

# This is the commit message bluez#16:

monitor

# This is the commit message bluez#17:

monitor

# This is the commit message bluez#18:

monitor

# This is the commit message bluez#19:

monitor

# This is the commit message bluez#20:

monitor

# This is the commit message bluez#21:

monitor

# This is the commit message bluez#22:

monitor

# This is the commit message bluez#23:

monitor

# This is the commit message bluez#24:

monitor

# This is the commit message bluez#25:

monitor

# This is the commit message bluez#26:

monitor

# This is the commit message bluez#27:

monitor

# This is the commit message bluez#28:

monitor

# This is the commit message bluez#29:

monitor

# This is the commit message bluez#30:

monitor

# This is the commit message bluez#31:

monitor

# This is the commit message bluez#32:

monitor

# This is the commit message bluez#33:

monitor

# This is the commit message bluez#34:

monitor

# This is the commit message bluez#35:

monitor

# This is the commit message bluez#36:

monitor

# This is the commit message bluez#37:

monitor

# This is the commit message bluez#38:

monitor

# This is the commit message bluez#39:

monitor

# This is the commit message bluez#40:

monitor

# This is the commit message bluez#41:

monitor

# This is the commit message bluez#42:

monitor

# This is the commit message bluez#43:

monitor

# This is the commit message bluez#44:

monitor

# This is the commit message bluez#45:

monitor

# This is the commit message bluez#46:

monitor

# This is the commit message bluez#47:

monitor

# This is the commit message bluez#48:

monitor

# This is the commit message bluez#49:

monitor

# This is the commit message bluez#50:

monitor

# This is the commit message bluez#51:

monitor

# This is the commit message bluez#52:

monitor

# This is the commit message bluez#53:

monitor

# This is the commit message bluez#54:

monitor

# This is the commit message bluez#55:

monitor

# This is the commit message bluez#56:

monitor

# This is the commit message bluez#57:

monitor

# This is the commit message bluez#58:

monitor

# This is the commit message bluez#59:

monitor

# This is the commit message bluez#60:

monitor

# This is the commit message bluez#61:

monitor

# This is the commit message bluez#62:

monitor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants