下面是在一個?8Bitdo NES30 Pro 手柄上測試的其他藍(lán)牙手柄應(yīng)該也可以.
8Bitdo 藍(lán)牙手柄不會自動配對. 因此必須利用ssh進行命令控制進行配對圣絮。?
打開藍(lán)牙
再Services里面找到藍(lán)牙選項输涕,并打開庶灿。
下面要用ssh進行控制
打開終端(mac晋渺,linux煞额;windows請度娘)
sudo ssh root@樹莓派ip地址
如果秘鑰出問題
sudo rm -rf /var/root/.ssh/known_hosts
然后再連接
檢查藍(lán)牙服務(wù)狀態(tài)
systemctl status bluetooth
應(yīng)該能夠看到下面的信息
Mar 08 02:28:49 Lakka systemd[1]: Started Bluetooth service.
Mar 08 02:28:49 Lakka bluetoothd[522]: Bluetooth daemon 5.43
Mar 08 02:28:49 Lakka bluetoothd[522]: Starting SDP server
Mar 08 02:28:49 Lakka bluetoothd[522]: kernel lacks bnep-protocol support
Mar 08 02:28:49 Lakka bluetoothd[522]: System does not support network plugin
Mar 08 02:28:49 Lakka bluetoothd[522]: Bluetooth management interface 1.14 initialized
Mar 08 02:28:49 Lakka bluetoothd[522]: Failed to obtain handles for "Service Changed" characteristic
Mar 08 02:28:49 Lakka bluetoothd[522]: Failed to set privacy: Rejected (0x0b)
Mar 08 02:32:54 Lakka bluetoothd[522]: No agent available for request type 0
Mar 08 02:32:54 Lakka bluetoothd[522]: device_request_pin: Operation not permitted
如果出現(xiàn)下面信息:
● bluetooth.service - Bluetooth service
? Loaded: loaded (/usr/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
? Active: inactive (dead)
Condition: start condition failed at Tue 2015-04-07 19:35:48 UTC; 1min 59s ago
? ? ? ? ? ConditionPathExists=/storage/.cache/services/bluez.conf was not met
嘗試手動開啟藍(lán)牙服務(wù)
systemctl enable bluetooth
systemctl start bluetooth
再檢查藍(lán)牙狀態(tài)重復(fù)上面的步驟
如果藍(lán)牙還是報錯袭景,請創(chuàng)建配置文件并重啟藍(lán)牙服務(wù)
touch /storage/.cache/services/bluez.conf
systemctl start bluetooth
配對藍(lán)牙
運行藍(lán)牙控制模塊
bluetoothctl
一個藍(lán)牙提示符[bluetooth]#將會出現(xiàn)挡育,輸入下面的命令
agent on
default-agent
power on
discoverable on
pairable on
scan on
打開你的8Bitdo 控制器模式1. 將會顯示下面的信息
Discovery started
[CHG] Controller B8:27:EB:48:30:22 Discovering: yes
[NEW] Device E4:17:D8:3E:6A:7D 8Bitdo NES30 Pro
連接手柄绒瘦,輸入下面的命令
connect <device_addr>
將會顯示下面的信息
[bluetooth]# connect E4:17:D8:3E:6A:7D
Attempting to connect to E4:17:D8:3E:6A:7D
[CHG] Device E4:17:D8:3E:6A:7D Connected: yes
[CHG] Device E4:17:D8:3E:6A:7D Modalias: usb:v3820p0009d0100
[CHG] Device E4:17:D8:3E:6A:7D UUIDs: 00001124-0000-1000-8000-00805f9b34fb
[CHG] Device E4:17:D8:3E:6A:7D UUIDs: 00001200-0000-1000-8000-00805f9b34fb
[CHG] Device E4:17:D8:3E:6A:7D Paired: yes
Connection successful
信任設(shè)備
trust <device_addr>
完工称簿。
測試再重啟開機后手柄會自動連接。如果失去連接請重啟手柄和樹莓派惰帽。再不行就重新連接憨降。
connect <device_addr>