Skip to content

Bluetooth

Bluetooth boot messages

During boot the following Bluetooth kernel messages are received:

dmesg | grep -i Bluetooth
Bluetooth: Core ver 2.18
Bluetooth: HCI device and connection manager initialized
Bluetooth: HCI socket layer initialized
Bluetooth: L2CAP socket layer initialized
Bluetooth: SCO socket layer initialized
Bluetooth: HCI UART driver ver 2.2
Bluetooth: HCI H4 protocol initialized
Bluetooth: HCI BCSP protocol initialized
Bluetooth: HCIATH3K protocol initialized
Bluetooth: RFCOMM TTY layer initialized
Bluetooth: RFCOMM socket layer initialized
Bluetooth: RFCOMM ver 1.11
Bluetooth: BNEP (Ethernet Emulation) ver 1.3
Bluetooth: BNEP filters: protocol multicast
Bluetooth: BNEP socket layer initialized
Bluetooth: HIDP (Human Interface Emulation) ver 1.2
Bluetooth: HIDP socket layer initialized

Device identification

After the file system is up, hciconfig should show the connected Bluetooth module.

hciconfig hci0 up
hciconfig
hci0:   Type: BR/EDR  Bus: UART
        BD Address: 64:A3:CB:5B:69:F0  ACL MTU: 1021:8  SCO MTU: 64:1
        UP RUNNING PSCAN
        RX bytes:1772 acl:0 sco:0 events:69 errors:0
        TX bytes:1152 acl:0 sco:0 commands:65 errors:0

The hcitool can be used to show the Bluetooth MAC address of the Bluetooth module with the respective hci connection.

hcitool dev
Devices:
        hci0    64:A3:CB:5B:69:F0

Type help to show commands.

hcitool --help

Managing Bluetooth

You can manage Bluetooth with bluetoothctl. Type bluetoothctl to enter the interface. Type help to show commands. For connecting a device do the following:

bluetoothctl
power on
agent off
agent on
default-agent
pairable on

Push the connect button in the device

scan on

Copy mac address

scan off
pair <mac address>

Approve pairing on the device if required

trust <mac address>
connect <mac address>
quit

For example, when connecting a Microsoft Bluetooth mouse, do the following:

bluetoothctl
[NEW] Controller 50:72:24:11:EF:B0 BlueZ 5.28 [default]
power on
Changing power on succeeded
default-agent
No agent is registered
pairable on
Changing pairable on succeeded
scan on
Discovery started
[CHG] Controller 50:72:24:11:EF:B0 Discovering: yes
[NEW] Device 00:1D:D8:39:93:46 Microsoft Bluetooth Notebook Mouse 5000
scan off
[CHG] Device 00:1D:D8:39:93:46 RSSI is nil
Discovery stopped
[CHG] Controller 50:72:24:11:EF:B0 Discovering: no
pair 00:1D:D8:39:93:46
Attempting to pair with 00:1D:D8:39:93:46
[CHG] Device 00:1D:D8:39:93:46 Connected: yes
[CHG] Device 00:1D:D8:39:93:46 Modalias: usb:v045Ep0700d0100
[CHG] Device 00:1D:D8:39:93:46 UUIDs:
        00001000-0000-1000-8000-00805f9b34fb
        00001124-0000-1000-8000-00805f9b34fb
        00001200-0000-1000-8000-00805f9b34fb
[CHG] Device 00:1D:D8:39:93:46 Paired: yes
Pairing successful
[CHG] Device 00:1D:D8:39:93:46 Connected: no
trust 00:1D:D8:39:93:46
[CHG] Device 00:1D:D8:39:93:46 Trusted: yes
Changing 00:1D:D8:39:93:46 trust succeeded
connect 00:1D:D8:39:93:46
Attempting to connect to 00:1D:D8:39:93:46
[CHG] Device 00:1D:D8:39:93:46 Connected: yes
hid-generic 0005:045E:0700.0001: unknown main item tag 0x0
input: Microsoft Bluetooth Notebook Mouse 5000 as /devices/soc0/soc.0/2100000.aips-bus/21e8000.serial/tty/ttymxc1/hci0/hci0:1/0005:045E:0700.0001/input/input1
Connection successful
[bhid-generic 0005:045E:0700.0001: input: BLUETOOTH HID v1.00 Mouse [Microsoft Bluetooth Notebook Mouse 5000] on 50:72:24:11:ef:b0
quit
[DEL] Controller 50:72:24:11:EF:B0 BlueZ 5.28 [default]