Wiki

Clone wiki

comp-house.repo / Bluez5A2DP

Подключение bluetooth гарнитуры (да и не только) в Fedora 20

Коротко

  • Поставить пакеты
yum install bluez pulseaudio-module-bluetooth
  • Запустить в терминале bluetoothctl
$ bluetoothctl 
[bluetooth]# power on
[bluetooth]# agent on
[bluetooth]# default-agent on
[bluetooth]# pair 00:11:67:0D:DE:5A 
[bluetooth]# trust 00:11:67:0D:DE:5A
[bluetooth]# connect 00:11:67:0D:DE:5A 
  • Запустить pavucontrol и выбрать соответствующую конфигурацию.

q7-pavucontrol-1.png q7-pavucontrol-2.png

Долго и по пунктам

При запуске bluetoothctl выводит список адапетров и известных устройств.

  • Включить питание блутузного адаптера. Иначе оно не работает.
power on
  • Включить агента и сделать его агентом по умолчанию. Что это значит, лично для меня туман. По идее это действо регистрирует в стеке всех клиентов, которые умеют работать через bluetooth, но не факт.
[bluetooth]# agent on
[bluetooth]# default-agent on
  • командой scan найти макадрес устройства и спарить его с компьютером
[bluetooth]# scan on
Discovery started
[CHG] Controller 6C:71:D9:A8:5A:EC Discovering: yes
[NEW] Device D0:66:7B:35:5D:50 DTVBluetooth
[bluetooth]# devices
Device 00:11:67:0D:DE:5A Q7
Device D0:66:7B:35:5D:50 DTVBluetooth
[NEW] Device 50:C9:71:A3:C3:4A JABRA EASYG
[CHG] Device 50:C9:71:A3:C3:4A Name: JABRA EASYGO
[CHG] Device 50:C9:71:A3:C3:4A Alias: JABRA EASYGO
[bluetooth]# scan off
[CHG] Device 50:C9:71:A3:C3:4A RSSI is nil
[CHG] Device D0:66:7B:35:5D:50 RSSI is nil
Discovery stopped
[CHG] Controller 6C:71:D9:A8:5A:EC Discovering: no
  • спарить устройство.
pair 50:C9:71:A3:C3:4A
Attempting to pair with 50:C9:71:A3:C3:4A
  • Внести устройство в доверенные
trust 00:11:67:0D:DE:5A

Результат виден по команде info 00:11:67:0D:DE:5A в строке Trusted см. полный лог дальше.

  • Соединиться с устройством
[bluetooth]# connect 00:11:67:0D:DE:5A 
Attempting to connect to 00:11:67:0D:DE:5A
[CHG] Device 00:11:67:0D:DE:5A Connected: yes
Connection successful

Полный лог удачных и неудачных команд bluetoothctl:

 bluetoothctl 
[NEW] Controller 6C:71:D9:A8:5A:EC BlueZ 5.14 [default]
[NEW] Device 00:11:67:0D:DE:5A Q7
[bluetooth]# power off
Changing power off succeeded
[bluetooth]# power on
[CHG] Controller 6C:71:D9:A8:5A:EC Class: 0x0c010c
Changing power on succeeded
[CHG] Controller 6C:71:D9:A8:5A:EC Powered: yes
[bluetooth]# list
Controller 6C:71:D9:A8:5A:EC BlueZ 5.14 [default]
[bluetooth]# devices
Device 00:11:67:0D:DE:5A Q7
[bluetooth]# pair 00:11:67:0D:DE:5A 
Attempting to pair with 00:11:67:0D:DE:5A
Failed to pair: org.bluez.Error.AlreadyExists
[bluetooth]# connect 00:11:67:0D:DE:5A 
Attempting to connect to 00:11:67:0D:DE:5A
Failed to connect: org.bluez.Error.Failed
[bluetooth]# connect 00:11:67:0D:DE:5A 
Attempting to connect to 00:11:67:0D:DE:5A
Failed to connect: org.bluez.Error.Failed
[bluetooth]# default-agent
No agent is registered
[bluetooth]# default-agent on
No agent is registered
[bluetooth]# agent on
Agent registered
[bluetooth]# default-agent on
Default agent request successful
[bluetooth]# connect 00:11:67:0D:DE:5A 
Attempting to connect to 00:11:67:0D:DE:5A
Failed to connect: org.bluez.Error.Failed
[bluetooth]# info 00:11:67:0D:DE:5A 
Device 00:11:67:0D:DE:5A
	Name: Q7
	Alias: Q7
	Class: 0x240404
	Icon: audio-card
	Paired: yes
	Trusted: no
	Blocked: no
	Connected: no
	LegacyPairing: no
	UUID: Headset                   (00001108-0000-1000-8000-00805f9b34fb)
	UUID: Audio Sink                (0000110b-0000-1000-8000-00805f9b34fb)
	UUID: Handsfree                 (0000111e-0000-1000-8000-00805f9b34fb)
[bluetooth]# trust 00:11:67:0D:DE:5A
[CHG] Device 00:11:67:0D:DE:5A Trusted: yes
Changing 00:11:67:0D:DE:5A trust succeeded
[bluetooth]# info 00:11:67:0D:DE:5A 
Device 00:11:67:0D:DE:5A
	Name: Q7
	Alias: Q7
	Class: 0x240404
	Icon: audio-card
	Paired: yes
	Trusted: yes
	Blocked: no
	Connected: no
	LegacyPairing: no
	UUID: Headset                   (00001108-0000-1000-8000-00805f9b34fb)
	UUID: Audio Sink                (0000110b-0000-1000-8000-00805f9b34fb)
	UUID: Handsfree                 (0000111e-0000-1000-8000-00805f9b34fb)
[bluetooth]# connect 00:11:67:0D:DE:5A 
Attempting to connect to 00:11:67:0D:DE:5A
Failed to connect: org.bluez.Error.Failed
[bluetooth]# connect 00:11:67:0D:DE:5A 
Attempting to connect to 00:11:67:0D:DE:5A
[CHG] Device 00:11:67:0D:DE:5A Connected: yes
Connection successful
[CHG] Device 00:11:67:0D:DE:5A Connected: no
[bluetooth]# connect 00:11:67:0D:DE:5A 
Attempting to connect to 00:11:67:0D:DE:5A
[CHG] Device 00:11:67:0D:DE:5A Connected: yes
Connection successful

Updated