Skip to content
Permalink
Browse files

updated instructions for linux

  • Loading branch information
jiska2342 committed Jul 16, 2019
1 parent 636a416 commit cea981c6472453e57be99fac1e3e606492cf8a14
Showing with 92 additions and 61 deletions.
  1. +11 −5 README.md
  2. +0 −56 internalblue/fw/README.md
  3. +81 −0 linux_bluez/README.md
@@ -13,16 +13,22 @@ Setup and Installation

The framework uses __ADB__ (Android Debug Bridge) to connect to an Android
smartphone, __BlueZ__ sockets on Linux, or the included __iOS Proxy__ on iOS.
For ADB, either connect the phone via USB or setup ADB over TCP and make sure you
enable USB debugging in the developer settings of Android.

For [Android](android_bluetooth_stack) with ADB, either connect the phone via USB or setup ADB over TCP and make sure you
enable USB debugging in the developer settings of Android.
The Android device needs to run a Bluetooth stack that was compiled with
debugging features enabled. A detailed description on how to compile the
Bluetooth stack for your device can be found in the *README.md* file inside the
*android_bluetooth_stack* directory of this repository. It also contains
precompiled stacks for some devices. InternalBlue does not work without the
debug Bluetooth stack.

If you have a jailbroken [iOS](ios-proxy) device, you need to install a proxy that locally connects
to the Bluetooth device and forwards HCI commands and events.

On [Linux](linux_bluez) with *BlueZ*, everything should work out of the box, but
you need to execute *InternalBlue* as root for most features.

The InternalBlue framework is written in Python 2. You can install it together
with all dependencies by using pip:

@@ -102,18 +108,18 @@ Android:
* Android device connected via ADB
* Best support is currently given for Nexus 5 / BCM4339
* Optional: Patch for Android driver to support Broadcom H4 forwarding
* Optional: Wireshark [Broadcom H4 Dissector Plugin](https://github.com/seemoo-lab/h4bcm_wireshark_dissector)

Linux:
* BlueZ
* BlueZ, instructions see [here](linux_bluez/README.md)
* Optional: Privileged access

iOS:
* A jailbroken iOS device
* The included ios-proxy (instructions in [here](ios-proxy/README.md))
* Optional: a Mac with xcode to compile the proxy yourself

Common Optional Requirements:
* Wireshark [Broadcom H4 Dissector Plugin](https://github.com/seemoo-lab/h4bcm_wireshark_dissector)



Supported Features
@@ -84,62 +84,6 @@ On newer chips, the build information is located in the beginning of the stack.

hd 0x200400



Firmware Related Setup
----------------------
The following steps are required to use the CYW20735B1 evaluation kit as normal HCI device on Linux with BlueZ.


**1. Setup as HCI device**

You need to set the baud rate to 3 Mbit/s. Replace `/dev/ttyUSB0` with your device.

btattach -B /dev/ttyUSB0 -S 3000000

If this does not work directly, use:

stty -F /dev/ttyUSB0 3000000
btattach -B /dev/ttyUSB0

**2. Use with BlueZ**

Assuming that you already have a regular Bluetooth device, you new device is `hci1`.

hciconfig hci1 up

You can list your HCI devices:

hcitool dev

**3. Command line tools for connections**

Scanning for devices:

hcitool scan
hcitool lescan

Connections and pairing:

bluetoothctl

Enter into `bluetoothctl` command prompt:

power on
agent on
default-agent
scan on

Optional - accept connections:

advertise on
pairable on
discoverable on

Do a pairing and then connect:

pair aa:bb:cc:dd:ee:ff
connect aa:bb:cc:dd:ee:ff



@@ -0,0 +1,81 @@


Linux Setup
-----------
The following steps are required to use the CYW20735B1 evaluation kit as normal HCI device on Linux with BlueZ.


**1. Setup as HCI device**

You need to set the baud rate to 3 Mbit/s. Replace `/dev/ttyUSB0` with your device.

btattach -B /dev/ttyUSB0 -S 3000000

If this does not work directly, use:

stty -F /dev/ttyUSB0 3000000
btattach -B /dev/ttyUSB0

Sometimes, you need to plug/unplug the evaluation board multiple times and run a combination of the commands above.
If setup was successful can be checked with `hciconfig`. A MAC address with all zeros indicates that the baud rate
was not set correctly and you need to try again.

**2. Use with BlueZ**

Assuming that you already have a regular Bluetooth device, you new device is `hci1`.

hciconfig hci1 up

You can list your HCI devices:

hcitool dev

**3. Command line tools for connections**

Scanning for devices:

hcitool scan
hcitool lescan

Connections and pairing:

bluetoothctl

Enter into `bluetoothctl` command prompt:

power on
agent on
default-agent
scan on

Optional - accept connections:

advertise on
pairable on
discoverable on

Do a pairing and then connect:

pair aa:bb:cc:dd:ee:ff
connect aa:bb:cc:dd:ee:ff



Diagnostics
-----------

On some devices, diagnostic logging for LMP and LCP already works out of the box.
Note that diagnostics can do more, but the additional features are currently not
integrated into *BlueZ* or the Linux kernel.

To enable diagnostics, execute:

echo 1 > /sys/kernel/debug/bluetooth/hci0/vendor_diag

By default, this entry is only created for Intel and Broadcom chips.
The evaluation board claims to be Cypress, a different vendor ID, thus
the vendor diagnostics are missing.
*BlueZ* already comes with a monitor that decodes some parts of the diagnostic
traffic, simply run:

btmon

0 comments on commit cea981c

Please sign in to comment.
You can’t perform that action at this time.