ubuntu爬坑
该blog用来记录在使用ubuntu的过程中出现的坑。
使用蓝牙搜索不到蓝牙设备
参考blog
https://askubuntu.com/questions/547552/bluetooth-not-working-on-14-10-with-bcm43142
发现问题
使用下面命令
$ dmesg | grep -i blue
出现
[ 18.505736] Bluetooth: Core ver 2.22
[ 18.505761] Bluetooth: HCI device and connection manager initialized
[ 18.505768] Bluetooth: HCI socket layer initialized
[ 18.505771] Bluetooth: L2CAP socket layer initialized
[ 18.505780] Bluetooth: SCO socket layer initialized
[ 18.822995] bluetooth hci0: Direct firmware load failed with error -2
[ 18.823006] bluetooth hci0: Falling back to user helper
[ 18.823767] Bluetooth: hci0: BCM: patch brcm/BCM.hcd not found
[ 28.385656] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 28.385661] Bluetooth: BNEP filters: protocol multicast
[ 28.385669] Bluetooth: BNEP socket layer initialized
[ 28.850708] Bluetooth: RFCOMM TTY layer initialized
[ 28.850718] Bluetooth: RFCOMM socket layer initialized
[ 28.850725] Bluetooth: RFCOMM ver 1.11
[ 384.623505] Bluetooth: hci0 command 0x1003 tx timeout
说明没有驱动程序,需要从windows下面找一个.hex文件,然后哦编译为hcd文件
解决思路
1.复制 windows下的文件C:\Windows\System32\drivers\BCM43142A0_001.001.011.0197.0231.hex;
2.编译hex2hcd
git clone git://github.com/jessesung/hex2hcd.git
cd hex2hcd
make
hex2hcd /....../BCM43142A0_001.001.011.0197.0231.hex BCM.hcd (这里需要注意下,这边编译后在当前目录下面生成的是一个空的BCM.hcd文件,然后找到BCM43142A0_001.001.011.0197.0231.hex所在目录,生成了一个BCM43142A0_001.001.011.0249.0271.hcd文件,把这个文件重命名然后复制,这个名称是( dmesg | grep -i blue )输出的那个名称BCM.hcd 有的名称是需要版本号的。 )
3.复制BCM文件到/lib/firmware/brcm/目录下面
4.然后重启reboot