Home  >  Edison  >  Current State

Bluetooth functions

Bluetooth attach

Assign the correct Bluetooth address

On Intel Edison the BCM43341B Bluetooth controller has a default MAC address 43:34:1B:00:1F:AC if none is given. This address contains the sequence 43341B, the name the controller itself. Using the same BD_ADDR is problematic when having multiple Edison modules in each others range and also prevents a BNEP device from being created, needed for BT tethering. Therefore this address is blacklisted in the kernel, which blocks Bluetooth until a unique BD_ADDR is configured using btmgmt -i hci0 public-addr xx:xx:xx:xx:xx:xx.

Each Intel Edison stores a unique BD_ADDR in /factory/bluetooth_address.

A systemd service bluetooth_bd_addr is provided that powers on Bluetooth on boot and configures the factory provided address.

Unblock the Bluetooth device

Bluetooth may be soft blocked. To unblock:

connmanctl enable bluetooth

Or the old school:

root@edison:~# rfkill list

0: phy0: wlan
         Soft blocked: no
         Hard blocked: no
1: hci0: bluetooth
         Soft blocked: yes
         Hard blocked: no
root@edison:~# rfkill unblock 1
root@edison:~# rfkill list
0: phy0: wlan
         Soft blocked: no
         Hard blocked: no
1: hci0: bluetooth
         Soft blocked: no
         Hard blocked: no

In case of problems check the logs for the following:

dmesg | grep -i blue

Bluetooth: Core ver 2.22 
Bluetooth: HCI device and connection manager initialized 
Bluetooth: HCI socket layer initialized 
Bluetooth: L2CAP socket layer initialized 
Bluetooth: SCO socket layer initialized 
pci 0000:00:04.1: Registered Bluetooth device: hci_bcm 
Bluetooth: HCI UART driver ver 2.3 
Bluetooth: HCI UART protocol H4 registered 
Bluetooth: HCI UART protocol Broadcom registered 
Bluetooth: hci0: BCM: chip id 82 
Bluetooth: hci0: BCM: features 0x2f 
Bluetooth: hci0: BCM43341B0 
Bluetooth: hci0: BCM43341B0 (002.001.014) build 0000 
Bluetooth: hci0: BCM (002.001.014) build 0176 
Bluetooth: RFCOMM TTY layer initialized 
Bluetooth: RFCOMM socket layer initialized 
Bluetooth: RFCOMM ver 1.11

Pair and connect Bluetooth

To connect to other devices use: bluetoothctl

root@edison:~# systemctl start bluetooth
root@edison:~# bluetoothctl
[NEW] Controller 43:34:1B:00:1F:AC edison [default]
Agent registered
[bluetooth]# discoverable on
Changing discoverable on succeeded
[CHG] Controller 43:34:1B:00:1F:AC Discoverable: yes
[bluetooth]# pairable on
Changing pairable on succeeded
[bluetooth]# scan on
Discovery started
[CHG] Controller 43:34:1B:00:1F:AC Discovering: yes
[NEW] Device 00:0A:3A:71:BA:34 00-0A-3A-71-BA-34
[bluetooth]# connect 00:0A:3A:71:BA:34
Attempting to connect to 00:0A:3A:71:BA:34
[CHG] Device 00:0A:3A:71:BA:34 Connected: yes

and follow the instructions in Intel Edison Bluetooth Guide

Alternatively you might want to connect from the other device (your phone). It that case it might be easier to change the default agent:

agent off
agent DisplayOnly
agent on

Serial communication over Bluetooth

I have succeeded in paring 2 BT 4.0 devices and failed in paring a BT 2.0 device. I was able to get a wireless terminal using the following command on the Edison:

rfcomm watch /dev/rfcomm0 3 /sbin/agetty -L 115200 rfcomm0 xterm-256color

and on the client (laptop):

sudo rfcomm bind /dev/rfcomm0 ##:##:##:##:##:## 3

screen /dev/rfcomm0 115200

Bluetooth tethering

On the other device (phone) enable tethering and connect to the Intel Edison.

In connmanctl:

connmanctl> services 
* O Wired                gadget_000000000000_usb
    OP35_Extra           wifi_xxxx_xxxxxxx_managed_psk
    Ferry Toth (Galaxy Note3) bluetooth_xxxx_xxxx

connect bluetooth_xxxx_xxxx

connmanctl> services 
* O Wired                gadget_000000000000_usb
*   Ferry Toth (Galaxy Note3) bluetooth_xxxx_xxxx