Estou usando o bluez v5.46 no Ubuntu 17.10 e não consigo me conectar a um dispositivo bluetooth pareado.
Aqui está a saída do bluetoothctl
comando:
$ bluetoothctl
[NEW] Controller 6C:0B:84:27:43:66 tensorFlowPHY [default]
Agent registered
[bluetooth]# scan on
Discovery started
[CHG] Controller 6C:0B:84:27:43:66 Discovering: yes
[NEW] Device FC:58:FA:A1:C2:70 OE-P51
[bluetooth]# pair FC:58:FA:A1:C2:70
Attempting to pair with FC:58:FA:A1:C2:70
[CHG] Device FC:58:FA:A1:C2:70 Connected: yes
[CHG] Device FC:58:FA:A1:C2:70 UUIDs: 00001101-0000-1000-8000-00805f9b34fb
[CHG] Device FC:58:FA:A1:C2:70 UUIDs: 00001108-0000-1000-8000-00805f9b34fb
[CHG] Device FC:58:FA:A1:C2:70 UUIDs: 0000110b-0000-1000-8000-00805f9b34fb
[CHG] Device FC:58:FA:A1:C2:70 UUIDs: 0000110e-0000-1000-8000-00805f9b34fb
[CHG] Device FC:58:FA:A1:C2:70 UUIDs: 0000111e-0000-1000-8000-00805f9b34fb
[CHG] Device FC:58:FA:A1:C2:70 ServicesResolved: yes
[CHG] Device FC:58:FA:A1:C2:70 Paired: yes
Pairing successful
[CHG] Device FC:58:FA:A1:C2:70 ServicesResolved: no
[CHG] Device FC:58:FA:A1:C2:70 Connected: no
[CHG] Controller 6C:0B:84:27:43:66 Discoverable: no
[bluetooth]# connect FC:58:FA:A1:C2:70
Attempting to connect to FC:58:FA:A1:C2:70
Failed to connect: org.bluez.Error.Failed
Aqui está um pouco mais de informação:
$ journalctl -u bluetooth | tail
Mar 29 12:06:01 tensorFlowPHY systemd[1]: Started Bluetooth service.
Mar 29 12:06:01 tensorFlowPHY bluetoothd[1136]: Starting SDP server
Mar 29 12:06:01 tensorFlowPHY bluetoothd[1136]: Bluetooth management interface 1.14 initialized
Mar 29 14:36:12 tensorFlowPHY bluetoothd[1136]: a2dp-sink profile connect failed for FC:58:FA:A1:C2:70: Protocol not available
Mar 29 14:36:59 tensorFlowPHY bluetoothd[1136]: a2dp-sink profile connect failed for FC:58:FA:A1:C2:70: Protocol not available
E systemctl
diz:
$ systemctl status bluetooth
● bluetooth.service - Bluetooth service
Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2018-03-30 16:30:15 CEST; 21s ago
Docs: man:bluetoothd(8)
Main PID: 1492 (bluetoothd)
Status: "Running"
Tasks: 1 (limit: 4915)
Memory: 1.5M
CPU: 42ms
CGroup: /system.slice/bluetooth.service
└─1492 /usr/lib/bluetooth/bluetoothd
Mar 30 16:30:15 tensorFlowPHY systemd[1]: Starting Bluetooth service...
Mar 30 16:30:15 tensorFlowPHY bluetoothd[1492]: Bluetooth daemon 5.46
Mar 30 16:30:15 tensorFlowPHY systemd[1]: Started Bluetooth service.
Mar 30 16:30:15 tensorFlowPHY bluetoothd[1492]: Starting SDP server
Mar 30 16:30:15 tensorFlowPHY bluetoothd[1492]: Bluetooth management interface 1.14 initialized
Mar 30 16:30:20 tensorFlowPHY bluetoothd[1492]: a2dp-sink profile connect failed for FC:58:FA:A1:C2:70: Protocol not available
Mar 30 16:30:31 tensorFlowPHY bluetoothd[1492]: a2dp-sink profile connect failed for FC:58:FA:A1:C2:70: Protocol not available
EDIT 1: instalei um pacote do Ubuntu que estava faltando: pulseaudio-module-bluetooth
e reiniciei o pulseaudio com o comando:pulseaudio -k
Agora, a saída do log do bluetooth após a tentativa de conexão é:
Mar 30 16:36:59 tensorFlowPHY bluetoothd[1492]: Unable to get connect data for Headset Voice gateway: getpeername: Transport endpoint is not connected (107)
Mar 30 16:37:00 tensorFlowPHY bluetoothd[1492]: connect error: Connection refused (111)
Mar 30 16:37:02 tensorFlowPHY bluetoothd[1492]: connect error: Connection refused (111)
Alguma ideia do porquê?
EDIT 2: Acabei de reiniciar o Ubuntu como alguém pediu para fazer. Ainda tem o mesmo pb.
EDIT 3: Já tenho os dois módulos carregados em /etc/pulse/default.pa
:
$ egrep "(policy|discover)" /etc/pulse/default.pa
.ifexists module-bluetooth-policy.so
load-module module-bluetooth-policy
.ifexists module-bluetooth-discover.so
load-module module-bluetooth-discover
Mas não consigo encontrar aqueles no hdd, preciso instalar algo mais?
EDIT 4: Erro meu, usei o locate
comando. Depois de um sudo updatedb
, o locate
comando agora pode encontrar esses 2 arquivos.
EDIT 5: Aqui está a pactl
saída:
$ pactl list modules | grep "Name:"
Name: module-device-restore
Name: module-stream-restore
Name: module-card-restore
Name: module-augment-properties
Name: module-switch-on-port-available
Name: module-udev-detect
Name: module-alsa-card
Name: module-alsa-card
Name: module-bluetooth-policy
Name: module-bluetooth-discover
Name: module-bluez5-discover
Name: module-native-protocol-unix
Name: module-default-device-restore
Name: module-rescue-streams
Name: module-always-sink
Name: module-intended-roles
Name: module-suspend-on-idle
Name: module-console-kit
Name: module-systemd-login
Name: module-position-event-sounds
Name: module-role-cork
Name: module-filter-heuristics
Name: module-filter-apply
Name: module-switch-on-connect
Name: module-x11-publish
Name: module-x11-cork-request
Name: module-x11-xsmp
e a dpkg -l
saída:
$ dpkg -l | grep blue
ii bluefish 2.2.9-1 amd64 advanced Gtk+ text editor for web and software development
ii bluefish-data 2.2.9-1 all advanced Gtk+ text editor (data)
ii bluefish-plugins 2.2.9-1 amd64 advanced Gtk+ text editor (plugins)
ii blueman 2.0.4-1ubuntu3 amd64 Graphical bluetooth manager
ii bluez 5.46-0ubuntu3 amd64 Bluetooth tools and daemons
ii bluez-cups 5.46-0ubuntu3 amd64 Bluetooth printer driver for CUPS
ii bluez-obexd 5.46-0ubuntu3 amd64 bluez obex daemon
ii bluez-tools 0.2.0~20140808-5build1 amd64 Set of tools to manage Bluetooth devices for linux
ii gnome-bluetooth 3.26.1-1 amd64 GNOME Bluetooth tools
ii indicator-bluetooth 0.0.6+17.10.20170605-0ubuntu3 amd64 System bluetooth indicator.
ii libbluetooth3:amd64 5.46-0ubuntu3 amd64 Library to use the BlueZ Linux Bluetooth stack
ii libgnome-bluetooth13:amd64 3.26.1-1 amd64 GNOME Bluetooth tools - support library
ii pulseaudio-module-bluetooth 1:10.0-2ubuntu3.1 amd64 Bluetooth module for PulseAudio sound server
E aqui estão os módulos bluetooth pulseaudio carregados:
$ pactl list modules short | grep module-bluetooth
9 module-bluetooth-policy
10 module-bluetooth-discover
EDIT 6: Sua solução funcionou! Entao, para resumir :
$ bluetoothctl
[bluetooth]# power on
Changing power on succeeded
[CHG] Controller 6C:0B:84:27:43:66 Powered: yes
[bluetooth]# remove FC:58:FA:A1:C2:70
[DEL] Device FC:58:FA:A1:C2:70 OE-P51
Device has been removed
[bluetooth]# exit
Agent unregistered
[DEL] Controller 6C:0B:84:27:43:66 tensorFlowPHY [default]
$ sudo service bluetooth restart
e finalmente :
$ bluetoothctl
[NEW] Controller 6C:0B:84:27:43:66 tensorFlowPHY [default]
Agent registered
[bluetooth]# power on
Changing power on succeeded
[CHG] Controller 6C:0B:84:27:43:66 Powered: yes
[bluetooth]# scan on
Discovery started
[CHG] Controller 6C:0B:84:27:43:66 Discovering: yes
[NEW] Device FC:58:FA:A1:C2:70 OE-P51
[bluetooth]# pair FC:58:FA:A1:C2:70
Attempting to pair with FC:58:FA:A1:C2:70
[CHG] Device FC:58:FA:A1:C2:70 Connected: yes
[CHG] Device FC:58:FA:A1:C2:70 UUIDs: 00001101-0000-1000-8000-00805f9b34fb
[CHG] Device FC:58:FA:A1:C2:70 UUIDs: 00001108-0000-1000-8000-00805f9b34fb
[CHG] Device FC:58:FA:A1:C2:70 UUIDs: 0000110b-0000-1000-8000-00805f9b34fb
[CHG] Device FC:58:FA:A1:C2:70 UUIDs: 0000110e-0000-1000-8000-00805f9b34fb
[CHG] Device FC:58:FA:A1:C2:70 UUIDs: 0000111e-0000-1000-8000-00805f9b34fb
[CHG] Device FC:58:FA:A1:C2:70 ServicesResolved: yes
[CHG] Device FC:58:FA:A1:C2:70 Paired: yes
Pairing successful
[CHG] Device FC:58:FA:A1:C2:70 ServicesResolved: no
[CHG] Device FC:58:FA:A1:C2:70 Connected: no
[bluetooth]# connect FC:58:FA:A1:C2:70
Attempting to connect to FC:58:FA:A1:C2:70
[CHG] Device FC:58:FA:A1:C2:70 Connected: yes
Connection successful
[CHG] Device FC:58:FA:A1:C2:70 UUIDs: 00001101-0000-1000-8000-00805f9b34fb
[CHG] Device FC:58:FA:A1:C2:70 UUIDs: 00001108-0000-1000-8000-00805f9b34fb
[CHG] Device FC:58:FA:A1:C2:70 UUIDs: 0000110b-0000-1000-8000-00805f9b34fb
[CHG] Device FC:58:FA:A1:C2:70 UUIDs: 0000110c-0000-1000-8000-00805f9b34fb
[CHG] Device FC:58:FA:A1:C2:70 UUIDs: 0000110e-0000-1000-8000-00805f9b34fb
[CHG] Device FC:58:FA:A1:C2:70 UUIDs: 0000111e-0000-1000-8000-00805f9b34fb
[CHG] Device FC:58:FA:A1:C2:70 ServicesResolved: yes
[OE-P51]#
Do wiki do Arch , o emparelhamento funciona, mas a conexão não , seção:
Mas
pulseaudio-bluetooth
o nome do pacote estápulseaudio-module-bluetooth
no Ubuntu.Portanto, seu problema deve ser resolvido após a instalação:
E depois de instalar este pacote, reinicie o sistema para carregar alguns módulos de áudio de pulso como
module-bluetooth-policy
emodule-bluetooth-discover
.Atualizar:
Mas, se ainda assim, você recebe a mensagem abaixo após a reinicialização:
De acordo com esta resposta, você deve adicionar essas linhas ao
/etc/pulse/default.pa
arquivo. (Caso não exista):Mas essas linhas devem existir por padrão e após a reinicialização do sistema, esses módulos devem ser carregados.
Atualização2:
De acordo com este artigo no Arch wiki:
Portanto, emparelhe novamente seu dispositivo com estes comandos (ou você pode usar o método GUI):
Primeira corrida:
Em seguida, use estes comandos para mostrar dispositivos emparelhados:
E isso deve ter alguma saída como esta:
Em seguida, remova os dispositivos emparelhados com este comando:
E reinicie o serviço Bluetooth:
Em seguida, tente emparelhar o dispositivo novamente.
Desabilite o Gerenciador de Rede !
...ou gerenciamento de rede semelhante. É o que resolve a maioria dos problemas de rede em que você tenta controlar manualmente um serviço que o NetworkManager está programado para supervisionar.
No Kali Linux, edite /usr/sbin/update-rc.d que "desativa automaticamente o serviço que não queremos iniciar por padrão".
Encontre esta entrada na lista de permissões
e mova-o para a lista negra e altere ativado para desativado . Da mesma forma, mova o bluetooth para a lista de permissões e ative-o se quiser que ele permaneça ligado durante a reinicialização, se você ativá-lo manualmente. Em segundo lugar, não se esqueça de ligar o bluetooth para tornar a conexão persistente.
Você também pode desabilitar o NetworkManager para um único dispositivo em /etc/NetworkManager/NetworkManager.conf , mascará-lo por endereço MAC ou nome de interface:
Para encontrar o endereço MAC e o nome da interface do dispositivo bluetooth local, use o comando
Você pode querer reler o manual do seu dispositivo sobre como emparelhar. Perdi 3 horas apenas para esse problema específico e descobri que meu dispositivo tem instruções específicas sobre como emparelhar. Depois de seguir as instruções, posso emparelhá-lo sem problemas