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

Running BTBench between Android Device and UbuntuHost #427

Open
jaisontj opened this issue Feb 14, 2024 · 1 comment
Open

Running BTBench between Android Device and UbuntuHost #427

jaisontj opened this issue Feb 14, 2024 · 1 comment

Comments

@jaisontj
Copy link

I am trying to run bumble-bench between an ubuntu host and an Android Device (using the BTBench app)

What I'm doing,

Android device

# Build and install BTBench
# Start in RFCOMM server mode
adb shell am start -n com.github.google.bumble.btbench/.MainActivity --es autostart rfcomm-server

Ubuntu Host

# $USB is the BT transport
# D4:3A:2C:53:29:BC is the BT address of the Android device that I got from the device's About page
python3 apps/bench.py --mode rfcomm-client --packet-count 100 central --peripheral D4:3A:2C:53:29:BC/P $USB

Output

$ python3 apps/bench.py --mode rfcomm-client --packet-count 100 central --peripheral D4:3A:2C:53:29:BC/P $USB
INFO:root:>>> Connecting to HCI...
INFO:root:>>> Connected
INFO:root:### Connecting to D4:3A:2C:53:29:BC/P...
INFO:root:### Connected
INFO:root:@@@ Connection:    MTU=23
WARNING:bumble.host:--- Ignoring event HCI_CONNECTION_PACKET_TYPE_CHANGED_EVENT:
  status:            HCI_SUCCESS
  connection_handle: 50
  packet_type:       52248
WARNING:bumble.host:--- Ignoring event HCI_CONNECTION_PACKET_TYPE_CHANGED_EVENT:
  status:            HCI_SUCCESS
  connection_handle: 50
  packet_type:       52248
INFO:root:*** Starting RFCOMM client...
INFO:root:!!! Disconnection: reason=5

I'm not entirely sure what "reason=5" is.

Any idea what I maybe doing wrong?

@barbibulle
Copy link
Collaborator

Android requires an encrypted connection for RFComm sockets to be connected.
There are several ways to enable encryption:
1/ temporarily, by using the --encrypt option for the central command.
2/ more permanently, by pairing. You can use the bumble-pair with the --mode classic option to pair with the Android phone. The pairing key will be stored in the default key store (location is platform-dependent, the logs, when DEBUG logging is enabled, will show the path of the JSON file where the pairing keys are stored).

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

2 participants