実際のところ
bluetoothctlコマンドをたたくと、対話形式のウィザードがでます
$ sudo bluetoothctl Agent registered [bluetooth]#
電源ON
[bluetooth]# power on Changing power on succeeded
検索可能に
[bluetooth]# discoverable on Changing discoverable on succeeded [CHG] Controller B8:27:EB:4E:F6:C9 Discoverable: yes
この状態で、WindowsのBluetoothデバイス追加から、RaspberryPiがいれば成功
接続
無事うまくいくと、こんな感じで出るはず
[bluetooth]# discoverable on Changing discoverable on succeeded [CHG] Controller B8:27:EB:4E:F6:C9 Discoverable: yes [NEW] Device 98:AF:65:2C:BA:8B DESKTOP-F902L8T [CHG] Device 98:AF:65:2C:BA:8B UUIDs: 0000110c-0000-1000-8000-00805f9b34fb [CHG] Device 98:AF:65:2C:BA:8B UUIDs: 0000110e-0000-1000-8000-00805f9b34fb [CHG] Device 98:AF:65:2C:BA:8B Modalias: bluetooth:v0006p0001d0A00 [CHG] Device 98:AF:65:2C:BA:8B UUIDs: 00001000-0000-1000-8000-00805f9b34fb [CHG] Device 98:AF:65:2C:BA:8B UUIDs: 0000110a-0000-1000-8000-00805f9b34fb [CHG] Device 98:AF:65:2C:BA:8B UUIDs: 0000110c-0000-1000-8000-00805f9b34fb [CHG] Device 98:AF:65:2C:BA:8B UUIDs: 0000110e-0000-1000-8000-00805f9b34fb [CHG] Device 98:AF:65:2C:BA:8B UUIDs: 00001115-0000-1000-8000-00805f9b34fb [CHG] Device 98:AF:65:2C:BA:8B UUIDs: 0000111e-0000-1000-8000-00805f9b34fb [CHG] Device 98:AF:65:2C:BA:8B UUIDs: 0000111f-0000-1000-8000-00805f9b34fb [CHG] Device 98:AF:65:2C:BA:8B UUIDs: 00001200-0000-1000-8000-00805f9b34fb [CHG] Device 98:AF:65:2C:BA:8B UUIDs: c7f94713-891e-496a-a0e7-983a0946126e [CHG] Device 98:AF:65:2C:BA:8B ServicesResolved: yes [CHG] Device 98:AF:65:2C:BA:8B Paired: yes [CHG] Device 98:AF:65:2C:BA:8B ServicesResolved: no [CHG] Device 98:AF:65:2C:BA:8B Connected: no
"/etc/systemd/system/dbus-org.bluez.service"を編集
[Unit] Description=Bluetooth service Documentation=man:bluetoothd(8) ConditionPathIsDirectory=/sys/class/bluetooth [Service] Type=dbus BusName=org.bluez ExecStart=/usr/lib/bluetooth/bluetoothd ...
を
[Unit] Description=Bluetooth service Documentation=man:bluetoothd(8) ConditionPathIsDirectory=/sys/class/bluetooth [Service] Type=dbus BusName=org.bluez ExecStart=/usr/lib/bluetooth/bluetoothd ...
$ sudo systemctl daemon-reload $ sudo systemctl restart bluetooth
sdpに権限
$ sudo chmod 777 /var/run/sdp
ポートを設定
$ sudo sdptool add --channel=22 SP Serial Port service registered
ポートを受信状態に
$ sudo rfcomm listen /dev/rfcomm0 22 Waiting for connection on channel 22 Connection from 98:AF:65:2C:BA:8B to /dev/rfcomm0 Press CTRL-C for hangup
/var/run/sdpなんてフォルダがないが?
bluetoothの設定を反映し、リロードしないとデフォでは存在しません。