@allen 发表于 2016-3-23 11:31:35

蓝牙与手机传输文件(GUI 桌面环境)

本帖最后由 @allen 于 2017-4-6 21:05 编辑

1 .开启蓝牙apt-get update
apt-get installbrcm-patchram-plus-nexus7   // debian 没有这个包,但cubieez 自带有了这个包
apt-get installbluez-utils bluez-compat obexftpobexfslibbluetooth3 libbluetooth-dev1.1 CT-linaro-server or CT-debian-server
vi /usr/bin/open-bluetooth.sh#!/bin/bash
brcm_patchram_plus -d --patchram /lib/firmware/ap6210/bcm20710a1.hcd --enable_hci
--bd_addr aa:22:33:44:55:66 --no2bytes --tosleep 1000 /dev/ttyS1 &
a=(`ps -ef | grep brcm_patchram_p | awk '{printf $2}' | cut -b 1-4`)
echo $a
kill $a
sleep 3
brcm_patchram_plus -d --patchram /lib/firmware/ap6210/bcm20710a1.hcd --enable_hci
--bd_addr aa:22:33:44:55:66 --no2bytes --tosleep 1000 /dev/ttyS1 &

chmod 777 /usr/bin/open-bluetooth.sh确保在sys_config.fex 打开uart 2,
echo "/usr/bin/open-bluetooth.sh & " >> /etc/init.d/rc.local开机就打开蓝牙。
注意是一条命令brcm_patchram_plus 是条长命令。因为前面uart 0打开了,uart0 对应ttyS0,uart 1 没有打开,uart 2打开的就对应ttyS2



1.2CT cubieez
CT cubieez   自带有个/usr/bin/open-bluetooth.sh,执行就可以。
但不要串口中执行这命令,要么像上面的开机就执行,要么显示器,桌面打开终端执行。


CT上传蓝牙固件经常失败,失败率高

1.3CC-A80 linaro-deskto
终端执行brcm_patchram_plus --tosleep=50000 --no2bytes --enable_hci --baudrate 1500000
--use_baudrate_for_download --patchram /lib/firmware/ap6330/bcm40183b2.hcd
/dev/ttyS2 &
注意是一条命令,A80的uart2 使能后,叫固定ttyS2,这个和CT区别的地方

1.4 CT+sudo start-bt.shhttp://cubie.cc/forum.php?mod=image&aid=3747&size=300x300&key=770b0635aeef7a49&nocache=yes&type=fixnone

有打印,证明上传成功。没有则需要重新执行或重启。



可以先发 小文件到配对的手机上,试下是否成功。
手机端点击文件分享,通过蓝牙可以发送到板子上。注意设置文件接受的位置,如图。




sudo pcmanfm /mnt/bluetooth

打开窗口,可也拷贝数据。如果有权限问题,换成root 登录。





天草 发表于 2016-5-2 20:45:44

这个不错,正好要实验下~~~!!!!!!!!

天草 发表于 2016-5-3 09:23:10

楼主的教程很不错,照着1.3CC-A80 linaro-desktop 那个试了下,果然可以连上。但是貌似每次都得运行一遍才能在blueman里搜索得到蓝牙音响之类的设备。。。。

还有就是楼主知道连上蓝牙音响后怎么切换到用蓝牙音响播发音频吗?我试了无论是蓝牙的耳麦模式还是发送音频,都不行。。。在alsamixer里也没看到有蓝牙设备,应该是要把蓝牙设备添置到alsa里吗?
页: [1]
查看完整版本: 蓝牙与手机传输文件(GUI 桌面环境)