RaspberryPI ZeroのBluetooth接続でPairingできなくなった。
以下を参考に対応。
現象
Bluetoothctlを使ってPairingしようとすると、Failedでconnectがnoになる。
$ sudo systemctl status bluetooth.service でチェックすると、
上記と同じエラーが出ている。
上記に従い
# バックアップ
$ mv /lib/systemd/system/bluetooth.service /lib/systemd/system/bluetooth.service.org
# 設定値作成
$ sudo su -
$ mkdir -p /root/services/bluetooth
$ cp /lib/systemd/system/bluetooth.service.org /root/services/bluetooth/bluetooth.service
viで/root/services/bluetooth/bluetooth.serviceを修正
修正前:ExecStart=/usr/libexec/bluetooth/bluetoothd
修正後:ExecStart=/usr/libexec/bluetooth/bluetoothd --noplugin=sap
$ chmod -R 600 /root/services
# シンボリックリンク作成
$ ln -s /root/services/bluetooth/bluetooth.service /lib/systemd/system/bluetooth.service
# 再起動
$ systemctl daemon-reload
$ systemctl restart bluetooth.service
$ systemctl status bluetooth.service
上記のとおり、以下のエラーだけになる。
Failed to set privacy: Rejected (0x0b)
引き続き、以下を実行(rootで行う)
$ mkdir -p /root/configs/bluetooth/bthelper@.service.d
viで/root/configs/bluetooth/bthelper@.service.d/override.conf を作成
[Unit]
After=hciuart.service bluetooth.service
Before=
[Service]
ExecStartPre=/bin/sleep 5
$ chmod -R 600 /root/configs
$ mkdir /etc/systemd/system/bthelper@.service.d/
$ ln -s /root/configs/bluetooth/bthelper@.service.d/override.conf /etc/systemd/system/bthelper@.service.d/override.conf
$ reboot now
これにより、RN41は接続できるようになった。
でも、格安BT SlaveのHC-06は接続できず。こちらはさらに深い闇があった。