【鼎革‧革鼎】︰ Raspbian Stretch 《六之 G.2 》

比之於
W!o+ 的《小伶鼬工坊演義》︰樹莓派 3 三兩事之藍牙篇【上】

文本寫作那時,現下的 pi-bluetooth

pi@raspberrypi:~ apt-cache show pi-bluetooth Package: pi-bluetooth Version: 0.1.6 Architecture: armhf Maintainer: Serge Schneider <serge@raspberrypi.org> Installed-Size: 18 Depends: init-system-helpers (>= 1.18~), bluez, bluez-firmware, raspberrypi-sys-mods Homepage: https://github.com/RPi-Distro/pi-bluetooth Priority: optional Section: misc Filename: pool/main/p/pi-bluetooth/pi-bluetooth_0.1.6_armhf.deb </pre>    <span style="color: #666699;">小程式可是方便多了!</span>  <img class="alignnone size-full wp-image-78477" src="http://www.freesandal.org/wp-content/uploads/Add-New-Device_025.png" alt="" width="368" height="280" />    <pre class="lang:default decode:true ">pi@raspberrypi:~ apt-cache show bluez
Package: bluez
Version: 5.43-2+rpt2+deb9u2
Architecture: armhf
Maintainer: Debian Bluetooth Maintainers <pkg-bluetooth-maintainers@lists.alioth.debian.org>

 

pi@raspberrypi:~ systemctl status bluetooth ● bluetooth.service - Bluetooth service    Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)    Active: active (running) since Wed 2017-11-15 16:30:27 CST; 20s ago      Docs: man:bluetoothd(8)  Main PID: 500 (bluetoothd)    Status: "Running"    CGroup: /system.slice/bluetooth.service            └─500 /usr/lib/bluetooth/bluetoothd  11月 15 16:30:26 raspberrypi systemd[1]: Starting Bluetooth service... 11月 15 16:30:27 raspberrypi bluetoothd[500]: Bluetooth daemon 5.43 11月 15 16:30:27 raspberrypi systemd[1]: Started Bluetooth service. 11月 15 16:30:27 raspberrypi bluetoothd[500]: Starting SDP server 11月 15 16:30:27 raspberrypi bluetoothd[500]: Bluetooth management interface 1.14 initialized 11月 15 16:30:27 raspberrypi bluetoothd[500]: Failed to obtain handles for "Service Changed" characteristic 11月 15 16:30:27 raspberrypi bluetoothd[500]: Sap driver initialization failed. 11月 15 16:30:27 raspberrypi bluetoothd[500]: sap-server: Operation not permitted (1) 11月 15 16:30:27 raspberrypi bluetoothd[500]: Endpoint registered: sender=:1.5 path=/MediaEndpoint/A2DPSource 11月 15 16:30:28 raspberrypi bluetoothd[500]: Endpoint registered: sender=:1.5 path=/MediaEndpoint/A2DPSink pi@raspberrypi:~

 

不過要是已批配且信賴之藍牙鍵盤與或滑鼠,不能重啟後容易主動連接︰

pi@raspberrypi:~ bluetoothctl  [NEW] Controller B8:27:EB:68:1A:C4 raspberrypi [default] [NEW] Device F1:A3:00:00:60:1D Bluetooth 3.0 Keyboard [bluetooth]# power on Changing power on succeeded [bluetooth]# agent on Agent registered [bluetooth]# default-agent  Default agent request successful [bluetooth]# list Controller B8:27:EB:68:1A:C4 raspberrypi [default] [bluetooth]# devices  Device F1:A3:00:00:60:1D Bluetooth 3.0 Keyboard [bluetooth]# info F1:A3:00:00:60:1D Device F1:A3:00:00:60:1D 	Name: Bluetooth 3.0 Keyboard 	Alias: Bluetooth 3.0 Keyboard 	Class: 0x002540 	Icon: input-keyboard 	Paired: yes 	Trusted: yes 	Blocked: no 	Connected: no 	LegacyPairing: no 	UUID: Human Interface Device... (00001124-0000-1000-8000-00805f9b34fb) 	UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb) 	Modalias: usb:v04E8p7021d011B [CHG] Device F1:A3:00:00:60:1D Connected: yes [CHG] Device F1:A3:00:00:60:1D Connected: no [bluetooth]# connect F1:A3:00:00:60:1D Attempting to connect to F1:A3:00:00:60:1D [CHG] Device F1:A3:00:00:60:1D Connected: yes Connection successful [CHG] Device F1:A3:00:00:60:1D ServicesResolved: yes [Bluetooth 3.0 Keyboard]# quit Agent unregistered [DEL] Controller B8:27:EB:68:1A:C4 raspberrypi [default] pi@raspberrypi:~ 

 

實用上,豈非枉然耶??無怪乎早有『按時輪詢』之議也!!

Connect Bluetooth Keyboard at boot

clonmac

Tue Sep 06, 2016 11:19 pm

I am trying to configure the bluetooth on the RPi3 to automatically connect to my BT keyboard when it boots up, but am unable to get it to work. Currently I am using Raspbian and it boots to the login screen via GUI. Would anyone be able to help me out on how to configure it so it connects at bootup? The device is trusted via bluetoothctl and I can connect to it fine once I am logged in and I connect it manually.