Skip to Content

Verificações básicas

# Bluetooth service status systemctl status bluetooth # Bluetooth adapter information (hciconfig is deprecated; use bluetoothctl/btmgmt) bluetoothctl show bluetoothctl list # List all adapters # RF switch status rfkill list bluetooth

Se o Bluetooth estiver desativado:

sudo rfkill unblock bluetooth sudo systemctl restart bluetooth

Usando bluetoothctl

sudo bluetoothctl

Comandos comuns:

power on # Turn on Bluetooth agent on # Enable agent default-agent # Set as default agent scan on # Scan for devices devices # List discovered devices pair XX:XX:XX:XX:XX # Pair trust XX:XX:XX:XX:XX # Trust device connect XX:XX:XX:XX:XX # Connect info XX:XX:XX:XX:XX # View device info remove XX:XX:XX:XX:XX # Remove device quit # Exit

Problemas comuns

Não é possível descobrir dispositivos

# Confirm the Bluetooth adapter is powered on bluetoothctl power on # Rescan sudo bluetoothctl scan on

Se os dispositivos ainda não forem encontrados, verifique o log do kernel:

sudo dmesg | grep -i bluetooth sudo dmesg | grep -i "hci\|btusb"

Falha no emparelhamento

  1. Remova o registro de emparelhamento anterior e emparelhe novamente:
sudo bluetoothctl remove XX:XX:XX:XX:XX:XX scan on pair XX:XX:XX:XX:XX:XX
  1. Alguns dispositivos exigem a inserção de um código PIN, normalmente 0000 ou 1234

  2. Limpe o cache do Bluetooth:

sudo rm -rf /var/lib/bluetooth/* sudo systemctl restart bluetooth

Emparelhado, mas não é possível conectar

# Trust the device first sudo bluetoothctl trust XX:XX:XX:XX:XX:XX connect XX:XX:XX:XX:XX:XX

Se você receber “Falha ao conectar: ​​org.bluez.Error.Failed”:

# Restart the Bluetooth stack sudo systemctl restart bluetooth sudo modprobe -r btusb && sudo modprobe btusb

Desconexões frequentes após a conexão

# View Bluetooth logs journalctl -u bluetooth -f # Disable Bluetooth power management sudo nano /etc/bluetooth/main.conf

Adicione ou modifique na seção [Policy]:

[Policy] AutoEnable=true [General] FastConnectable=true

Reinicie o serviço:

sudo systemctl restart bluetooth

Má qualidade de áudio do fone de ouvido Bluetooth

Os fones de ouvido Bluetooth podem usar o protocolo SCO/HSP (modo de chamada) em vez de A2DP (áudio de alta qualidade).

# Check the current audio protocol wpctl status # Switch to A2DP in PipeWire # In GNOME Sound settings, select the output profile as "High Fidelity Playback (A2DP Sink)"

Latência do teclado/mouse Bluetooth

hcitool está obsoleto; os parâmetros de conexão agora são negociados automaticamente pelo kernel e pelo BlueZ. Para solucionar problemas de latência, primeiro confirme a conexão com bluetoothctl info XX:XX:XX:XX:XX:XX e, em seguida, inspecione/gerencie o adaptador com btmgmt:

# View adapter info and current connections btmgmt info btmgmt con # List current connections

Atualizando BlueZ

Ubuntu 26.04 vem com a pilha BlueZ Bluetooth. Confira a versão:

bluetoothd --version

Se você encontrar problemas de compatibilidade, instale uma versão mais recente (se disponível):

sudo apt update sudo apt install --only-upgrade bluez

Adaptadores Bluetooth USB

Se o Bluetooth integrado for problemático, você pode usar um adaptador USB Bluetooth:

# Confirm detection lsusb | grep -i bluetooth # Load driver sudo modprobe btusb # If there are multiple adapters, list and choose which one to use bluetoothctl list # List all adapters and their MACs bluetoothctl select XX:XX:XX:XX:XX:XX # Select a specific adapter bluetoothctl power on # Power on that adapter

Depuração de log Bluetooth

# Enable verbose logging sudo nano /etc/systemd/system/bluetooth.service.d/override.conf
[Service] ExecStart= ExecStart=/usr/libexec/bluetooth/bluetoothd -d
sudo systemctl daemon-reload sudo systemctl restart bluetooth journalctl -u bluetooth -f