个人工具

通过蓝牙连接Hoary和诺基亚手机

来自Ubuntu中文

跳转至: 导航, 搜索

通过蓝牙连接Hoary和诺基亚手机


原文出处:Ubuntu中文论坛

原文作者:

授权许可:

翻译人员:yonggi

校对人员:

贡献者:

适用版本: 文章状态:[完成]


This how to is tested with Hoary and Nokia 6630 and a Dongle Bluetooth (Usb Bluetooth)

这个how to已经用Hoary、诺基亚6630和一个道尔芯片(Dongle)蓝牙(Usb蓝牙)测试过了。

With this How To you could :

  • Send Files via Bluetooth from your Pc to your Nokia Phone
  • Send Files via Bluetooth from your Nokia Phone to your Pc
  • Do everything you want with Bluetooth

通过这个How to,你可以:

  • 通过蓝牙,从你的电脑发送文件到你的诺基亚手机
  • 通过蓝牙,从你的诺基亚手机发送文件到你的电脑
  • 用蓝牙做任何你需要的事情

Let's Start

让我们开始吧!

Open Synaptics

打开新立得软件包管理器

 
sudo synaptic 

Install this packages and their dependences

安装这些软件包和他们的依赖

 
gnome-bluetooth 
obexserver 
bluez-utils 

Load this modules into the kernel : l2cap, rfcomm

加载这个模块到核心:l2cap, rfcomm

sudo modprobe l2cap 
 
sudo modprobe rfcomm 

Create the new device of the Dongle. We create a virtual bind from the Usb to the Serial Device

建立一个新的Dongle设备。我们建立一个由Usb到串口设备的虚拟绑定

 
sudo mknod /dev/rfcomm0 c 216 0 

Activate the Bluetooth in your Phone . For the Nokia 6630 : 激活你手机的蓝牙。对于诺基亚6630:

 
Menu -> Connect. -> Bluetooth -> On 
 
Menu -> Connect. -> Bluetooth -> My phone's visibility -> Shown to all 
 
Menu -> Connect. -> Bluetooth -> My Phone's Name -> "Insert a name for your phone" 

Scan for your phone

搜索你的手机

hcitool scan 

This utils will scan the devices's Bluetooth ... it'll show something like this :

这个应用将扫描蓝牙的设备。它会显示一些像这样的信息:

 
Scanning ... 
00:11:9F:C0:FE:21 YOUR_PHONE_NAME 

The first number is your Phone's Address. Obviously yours will be different ! Copy your Address on a post-it !

Edit your /etc/bluetooth/rfcomm.conf

开始的数字就是你手机的地址。显然,你的会不同! 复制你的地址到粘贴板!

编辑 /etc/bluetooth/rfcomm.conf:

 
sudo gedit /etc/bluetooth/rfcomm.conf 

Cancell all and insert this :

取消所有内容,并输入这些:

 
rfcomm0 { 

device ADDRESS_OF_YOUR_PHONE; 
channel 10; 
comment "What you want "; 

} 

In ADDRESS_OF_YOUR_PHONE you must insert the Address wich you have write in the Post it For example :

在“你的手机地址”,你必须输入你已经写在粘贴板的那个地址。例如:

 
rfcomm0 { 

device 00:11:9F:C0:FE:21; 
channel 10; 
comment "My Nokia Phone"; 

} 

Add the Nokia Channel (10) to communicate with your phone

添加诺基亚频道(10),用来与你的手机通讯

 
sudo sdptool add --channel=10 OPUSH 

Do the binding

绑定

 
sudo rfcomm bind /dev/rfcomm0 ADDRESS_OF_YOUR_PHONE 10 

for example : rfcomm bind /dev/rfcomm0 00:11:9F:C0:FE:21 10

例如

Now we can test the connectivity

现在我们可以测试一下连通性

To Send from the PC to your Nokia Phone

从电脑到你的诺基亚手机的传送

 
gnome-obex-send filename 

for example

例如: gnome-obex-send /home/massi/Desktop/Video.3gp It'll show a prompt with the Bluetooth Device. Select your Phone and Click OK.

To Send from Your Nokia Phone to your PC Activate the ObexServer on your PC to accept connections from other Bluetooth Devices : 它将会提示有蓝牙设备。选择你的手机,确定。


从你的诺基亚到你电脑的传送 激活你电脑上的ObexServer去接受来自其他蓝牙设备的连接:

 
obexserver 

Go to your Gallery of the Phone and do Send file with Bluetooth. For Nokia 6630 :

去到你手机的图库,然后利用蓝牙传送文件。对于诺基亚6630:

 
Menu -> Gallery -> Images -> NamePhoto.jpg -> Options -> Send -> Via Bluetooth 

and Select your Pc and click SELECT You can find your files into the temp directory /tmp/

接着选择你的电脑,并点击选择 你可以在临时文件夹 /tmp/里找到你的文件。 Tips

This works perfectly on Nokia 6630 but i think it could works on ALL Nokia Phone with Bluetooth because we use the Channel number 10 which is the default channel of all Nokia Phone. I think also that if you know the channel number of your Phones which isn't Nokia you could replace in the How To and it could works !

这在诺基亚6630上工作得很完美,但我认为使用蓝牙,可以在全部诺基亚手机上工作。因为我们使用的频道号码10是诺基亚手机默认频道。

如果你的手机不是诺基亚,但你知道了你手机的频道号码,你可以在How To里替换,我想它也可以工作的!

Everytime that you reboot you must re apply this things (which you could insert into a boot-script)

每一次重启,你都必须重新应用这些(这些你可以写入一个启动脚本(boot-script))

 
modprobe l2cap 
sudo modprobe rfcomm 
sudo mknod /dev/rfcomm0 c 216 0 
sdptool add --channel=10 OPUSH 
sudo rfcomm bind /dev/rfcomm0 YOUR_PHONE_ADDRESS 10 

Have Fun Ubuntu's user !!!

玩得开心,Ubuntu的用户!!!