UART HCI Bluetooth Module For Linux v1 - 0
UART HCI Bluetooth Module For Linux v1 - 0
INTRODUCTION
BT860 is Laird’s latest UART HCI Bluetooth module based on the Cypress CYW20704 A2 chipset. This application
note describes how to use the BlueZ BCCMD tool to attach on the Linux platform. BlueZ and BlueZ-Utils
packages are required for this operation.
REQUIREMENTS
▪ BT860 development board
▪ BlueZ – Official Linux Bluetooth protocol stack
Notes: The BT860 development board uses the FTDI USB-UART chip. The testing platform used in this
application note has the driver installed automatically. The name of the serial port is
/dev/ttyUSB0.
Ubuntu 16.04 is used as the testing platform (Kernel version 4.4.0-31). The BlueZ stack (v 5.37) is
included.
PREPARATION
Before plugging the BT860 development board to the computer, type hciconfig to find out if there are any
existing Bluetooth radios. If you find one, close it by typing the following: hciconfig hciX down (Figure 1).
Typically, hci0 is the first Bluetooth device on the computer. Superuser permissions should be required.
After plugging the BT860 development board to the computer, locate the USB UART port by typing the
following: dmesg | grep FTDI (Figure 2). The development board uses the FTDI USB-UART chip.
Embedded Wireless Solutions Support Center: Americas: +1-800-492-2320
http://ews-support.lairdtech.com 1 Europe: +44-1628-858-940
www.lairdtech.com/wireless © Copyright 2015 Laird. All Rights Reserved Hong Kong: +852 2923 0610
BT860 UART HCI Bluetooth Module for Linux
Application Note
hcitool dev
This command displays local devices. If it finds one, it returns the following (Figure 6):
Note: The hcitool command uses the first available Bluetooth device for its operations. If multiple
Bluetooth devices are found, all hcitool commands must specify which device to use, as follows:
In this example, <hciX> must correspond to the HCI device number found using hcitool dev, e.g.
hci1.
hcitool scan
When a scan is initialized, the terminal returns found devices in the following format:
Scanning ...
[MAC Address] Friendly_Name
If there are discoverable devices nearby, they appear in this list as they are discovered (Figure 7).
To demonstrate the RFcomm connection, a Laird module (already configured as discoverable and connectable),
is used. Simple secure mode must also be enabled (Figure 8).
#hcitool lescan
LE Scan ...
[MAC Address] – [BLE device]
To demonstrate the BLE connection, a Laird module running the Laird vSP upass application is used (Figure 11).
The Linux computer first scans for the Bluetooth device. Once the module displays, Press Ctrl-C to stop the
scanning. Send the following command:
gatttool –b <BT900_MAC> -t random –I
Once the prompt is returned, send the following:
Connect
The Linux computer returns Connection successful and the BT860 connected to UwTerminal reports the
connection as well (Figure 12).
To locate the handles for TX and RX, send the command characteristics to obtain the list of characteristics
(including the properties, handle value, and UUID). From the BL600 smartBASIC extension guide, the BL600 TX
characteristic UUID is 569a2000-b87f-490c-92cb-11ba5ea5167c and the Linux host must enable notification to
receive data from the BL600. The BL600 RX characteristic UUID is 569a2001-b87f-490c-92cb-11ba5ea5167c and
the Linux host writes to it (Figure 13).
Figure 14: Enable notification for Modem-In and TX characteristics and written to Modem-Out characteristic to set the value to 1
From UwTerminal, you can enter ABCDEF into the terminal and press Enter. Data is received on the Linux
computer.
To send from the BT860 side with ABCDEF as data, enter the following command:
char-write-cmd 0x001e 414243444546
REVISION HISTORY
Version Date Notes Contributors Approver
1.0 18 Jan 2018 Initial Release Raymond Au Jonathan Kaye