15

Is it possible to connect more than two bluetooth dongles(adapters) to the linux machine and use them for read/write/communication with other external bluetooth devices simultaneously? So that there are will be more than one bluetooth device bluez can recognize and work with in parallel.

Geka P
  • 587
  • 1
  • 6
  • 22

2 Answers2

11

To complete @sam's answer as I was looking at doing the them. Here is the demonstration of two bluetooth adapter in Linux with bluetoothctl:

Without any USB Bluetooth dongle on my laptop I see:

[bluetooth]# list
Controller 84:EF:18:1E:5B:8A olivier-ThinkPad-E460 #1 [default]

After I hotplug the USB Bluetooth dongle, I can see:

[NEW] Controller 5C:F3:70:8A:A6:97 olivier-ThinkPad-E460 #2 [default]
[CHG] Controller 5C:F3:70:8A:A6:97 UUIDs: 00001112-0000-1000-8000-00805f9b34fb
[CHG] Controller 5C:F3:70:8A:A6:97 UUIDs: 00001801-0000-1000-8000-00805f9b34fb
[CHG] Controller 5C:F3:70:8A:A6:97 UUIDs: 0000110e-0000-1000-8000-00805f9b34fb
[CHG] Controller 5C:F3:70:8A:A6:97 UUIDs: 00001800-0000-1000-8000-00805f9b34fb
[CHG] Controller 5C:F3:70:8A:A6:97 UUIDs: 00001200-0000-1000-8000-00805f9b34fb
[CHG] Controller 5C:F3:70:8A:A6:97 UUIDs: 0000110c-0000-1000-8000-00805f9b34fb
[CHG] Controller 5C:F3:70:8A:A6:97 UUIDs: 0000110a-0000-1000-8000-00805f9b34fb
[CHG] Controller 5C:F3:70:8A:A6:97 UUIDs: 0000110b-0000-1000-8000-00805f9b34fb
[bluetooth]# list
Controller 84:EF:18:1E:5B:8A olivier-ThinkPad-E460 #1 [default]
Controller 5C:F3:70:8A:A6:97 olivier-ThinkPad-E460 #2

To select the USB Bluetooth dongle which has for MAC address 5C:F3:70:8A:A6:97:

[bluetooth]# select 5C:F3:70:8A:A6:97
[bluetooth]# list
Controller 84:EF:18:1E:5B:8A olivier-ThinkPad-E460 #1 
Controller 5C:F3:70:8A:A6:97 olivier-ThinkPad-E460 #2 [default]

We can see the USB adapter is now marked as [default]. When I scan for bluetooth devices, I can see it use the USB dongle:

[bluetooth]# scan on
Discovery started
[CHG] Controller 5C:F3:70:8A:A6:97 Discovering: yes
[NEW] Device A0:E6:F8:37:AE:94 5AAA=mRwb6qK$v_~xL5O#uK)AqfHK
[NEW] Device 54:E5:F7:BC:4C:D9 54-E5-F7-BC-4C-D9

Same when I want to connect:

[bluetooth]# connect DE:79:A2:A1:E9:FA
Attempting to connect to DE:79:A2:A1:E9:FA
[CHG] Device DE:79:A2:A1:E9:FA Connected: yes
Connection successful
[NEW] Primary Service
    /org/bluez/hci1/dev_DE_79_A2_A1_E9_FA/service0008
    00001801-0000-1000-8000-00805f9b34fb
    Generic Attribute Profile
[NEW] Characteristic
    /org/bluez/hci1/dev_DE_79_A2_A1_E9_FA/service0008/char0009
    00002a05-0000-1000-8000-00805f9b34fb
    Service Changed

Notice the hci1 in the DBUS path: /org/bluez/hci1/dev_DE_79_A2_A1_E9_FA

OlivierM
  • 2,820
  • 24
  • 41
3

yes its possible. Use bluetoothctl command line tool provided by bluez to select adapter. Each device will recognized with different adapter. You can choose the adapter and give commands

sam
  • 126
  • 2