Tentando ativar o bluetooth na inicialização (Debian)

Tentando ativar o bluetooth na inicialização (Debian)

Já emparelhei e conectei alguns dispositivos com sucesso. Para fazer isso, tive que usar o rfkill.

$ sudo bluetoothctl
[bluetooth]# power on
Failed to set power on: org.bluez.Error.Blocked
[bluetooth]# exit
$ sudo rfkill unblock bluetooth
$ sudo bluetoothctl
[bluetooth]# power on
Changing power on succeeded

No entanto, isso não persiste durante as reinicializações. Então, depois de pesquisar no Google, tentei criar um serviço.

$ sudo cat /etc/systemd/system/rfkill-unblock.service 
[Unit]
Description=RFKill-Unblock Bluetooth Devices
After=bluetooth.service
Requires=bluetooth.service

[Service]
Type=oneshot
ExecStart=/usr/sbin/rfkill unblock bluetooth
ExecStop=
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

Após a reinicialização, ainda preciso chamar manualmente rfkill unblock bluetooth antes de poder ligar o bluetoothctl. Aqui está minha saída do status systemctl

$ sudo systemctl status rfkill-unblock.service
● rfkill-unblock.service - RFKill-Unblock Bluetooth Devices
   Loaded: loaded (/etc/systemd/system/rfkill-unblock.service; enabled)
   Active: active (exited) since Wed 2015-07-15 02:26:18 UTC; 9min ago
  Process: 286 ExecStart=/usr/sbin/rfkill unblock bluetooth (code=exited, status=0/SUCCESS)
 Main PID: 286 (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/rfkill-unblock.service

Acho que também deve ser observado que estou usando ssh para conectar-me a esta máquina, pois ela está sendo usada como um centro de mídia.

Responder1

Instale e configure urfkill. Isso parece funcionar para mim:

# cat /etc/urfkill/urfkill.conf |grep '^[[:alpha:]]\|\['
[general]
user=root
master_key=true
force_sync=true
persist=true

informação relacionada