CubieBoard中文论坛

 找回密码
 立即注册
搜索
热搜: unable
查看: 7020|回复: 2

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

[复制链接]
发表于 2016-3-23 11:31:35 | 显示全部楼层 |阅读模式
本帖最后由 @allen 于 2017-4-6 21:05 编辑

1 .  开启蓝牙
  1. apt-get update
  2. apt-get install  brcm-patchram-plus-nexus7     // debian 没有这个包,但cubieez 自带有了这个包
  3. apt-get install  bluez-utils bluez-compat obexftp  obexfs  libbluetooth3 libbluetooth-dev
复制代码
1.1 CT-linaro-server or CT-debian-server

  1. vi /usr/bin/open-bluetooth.sh
复制代码
  1. #!/bin/bash
  2. brcm_patchram_plus -d --patchram /lib/firmware/ap6210/bcm20710a1.hcd --enable_hci
  3. --bd_addr aa:22:33:44:55:66 --no2bytes --tosleep 1000 /dev/ttyS1 &
  4. a=(`ps -ef | grep brcm_patchram_p | awk '{printf $2}' | cut -b 1-4`)
  5. echo $a
  6. kill $a
  7. sleep 3
  8. brcm_patchram_plus -d --patchram /lib/firmware/ap6210/bcm20710a1.hcd --enable_hci
  9. --bd_addr aa:22:33:44:55:66 --no2bytes --tosleep 1000 /dev/ttyS1 &

复制代码
  1. 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.2  CT cubieez
CT cubieez   自带有个/usr/bin/open-bluetooth.sh,执行就可以。
但不要串口中执行这命令,要么像上面的开机就执行,要么显示器,桌面打开终端执行。


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

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

1.4 CT+
  1. sudo start-bt.sh
复制代码


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



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




sudo pcmanfm /mnt/bluetooth

打开窗口,可也拷贝数据。如果有权限问题,换成root 登录。
P60318-150504.jpg P60318-150533.jpg P60318-150548.jpg P60318-150607.jpg P60318-150713.jpg




P60318-150555.jpg
P60318-150637.jpg
P60318-151202.jpg
P60318-151204.jpg
P60318-151348.jpg
回复

使用道具 举报

发表于 2016-5-2 20:45:44 | 显示全部楼层
这个不错,正好要实验下~~~!!!!!!!!
回复 支持 反对

使用道具 举报

发表于 2016-5-3 09:23:10 | 显示全部楼层
楼主的教程很不错,照着1.3  CC-A80 linaro-desktop 那个试了下,果然可以连上。但是貌似每次都得运行一遍才能在blueman里搜索得到蓝牙音响之类的设备。。。。

还有就是楼主知道连上蓝牙音响后怎么切换到用蓝牙音响播发音频吗?我试了无论是蓝牙的耳麦模式还是发送音频,都不行。。。在alsamixer里也没看到有蓝牙设备,应该是要把蓝牙设备添置到alsa里吗?
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|粤ICP备13051116号|cubie.cc---深刻的嵌入式技术讨论社区

GMT+8, 2024-5-3 17:06 , Processed in 0.028291 second(s), 18 queries .

Powered by Discuz! X3.4

© 2001-2012 Comsenz Inc. | Style by Coxxs

返回顶部