[wiki]通过蓝牙连接Hoary和诺基亚手机
- oneleaf
- 论坛管理员
- 帖子: 10441
- 注册时间: 2005-03-27 0:06
- 系统: Ubuntu 12.04
[wiki]通过蓝牙连接Hoary和诺基亚手机
This how to is tested with Hoary and Nokia 6630 and a Dongle Bluetooth (Usb Bluetooth)
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
Let's Start
- Open Synaptics
Quote:
sudo synaptic
- Install this packages and their dependences
Quote:
gnome-bluetooth
obexserver
bluez-utils
- Load this modules into the kernel : l2cap, rfcomm
Quote:
sudo modprobe l2cap
Quote:
sudo modprobe rfcomm
- Create the new device of the Dongle. We create a virtual bind from the Usb to the Serial Device
Quote:
sudo mknod /dev/rfcomm0 c 216 0
- Activate the Bluetooth in your Phone . For the Nokia 6630 :
Quote:
Menu -> Connect. -> Bluetooth -> On
Quote:
Menu -> Connect. -> Bluetooth -> My phone's visibility -> Shown to all
Quote:
Menu -> Connect. -> Bluetooth -> My Phone's Name -> "Insert a name for your phone"
- Scan for your phone
Quote:
hcitool scan
This utils will scan the devices's Bluetooth ... it'll show something like this :
Quote:
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
Quote:
sudo gedit /etc/bluetooth/rfcomm.conf
Cancell all and insert this :
Quote:
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 :
Quote:
rfcomm0 {
device 00:11:9F:C0:FE:21;
channel 10;
comment "My Nokia Phone";
}
- Add the Nokia Channel (10) to communicate with your phone
Quote:
sudo sdptool add --channel=10 OPUSH
- Do the binding
Quote:
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
Quote:
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 :
Quote:
obexserver
Go to your Gallery of the Phone and do Send file with Bluetooth. For Nokia 6630 :
Quote:
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/
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 !
Everytime that you reboot you must re apply this things (which you could insert into a boot-script)
Quote:
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 !!!
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
Let's Start
- Open Synaptics
Quote:
sudo synaptic
- Install this packages and their dependences
Quote:
gnome-bluetooth
obexserver
bluez-utils
- Load this modules into the kernel : l2cap, rfcomm
Quote:
sudo modprobe l2cap
Quote:
sudo modprobe rfcomm
- Create the new device of the Dongle. We create a virtual bind from the Usb to the Serial Device
Quote:
sudo mknod /dev/rfcomm0 c 216 0
- Activate the Bluetooth in your Phone . For the Nokia 6630 :
Quote:
Menu -> Connect. -> Bluetooth -> On
Quote:
Menu -> Connect. -> Bluetooth -> My phone's visibility -> Shown to all
Quote:
Menu -> Connect. -> Bluetooth -> My Phone's Name -> "Insert a name for your phone"
- Scan for your phone
Quote:
hcitool scan
This utils will scan the devices's Bluetooth ... it'll show something like this :
Quote:
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
Quote:
sudo gedit /etc/bluetooth/rfcomm.conf
Cancell all and insert this :
Quote:
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 :
Quote:
rfcomm0 {
device 00:11:9F:C0:FE:21;
channel 10;
comment "My Nokia Phone";
}
- Add the Nokia Channel (10) to communicate with your phone
Quote:
sudo sdptool add --channel=10 OPUSH
- Do the binding
Quote:
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
Quote:
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 :
Quote:
obexserver
Go to your Gallery of the Phone and do Send file with Bluetooth. For Nokia 6630 :
Quote:
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/
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 !
Everytime that you reboot you must re apply this things (which you could insert into a boot-script)
Quote:
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 !!!
上次由 oneleaf 在 2005-06-01 10:15,总共编辑 1 次。
当净其意如虚空,远离妄想及诸取,令心所向皆无碍
-
- 帖子: 3025
- 注册时间: 2005-05-07 23:57
- 联系:
通过蓝牙连接Hoary和诺基亚手机
这个how to已经用Hoary、诺基亚6630和一个道尔芯片(Dongle)蓝牙(Usb蓝牙)测试过了。
通过这个How to,你可以:
-通过蓝牙,从你的电脑发送文件到你的诺基亚手机
-通过蓝牙,从你的诺基亚手机发送文件到你的电脑
-用蓝牙做任何你需要的事情
让我们开始吧!
-打开新立得软件包管理器
-安装这些软件包和他们的依赖
-加载这个模块到核心:l2cap, rfcomm
-建立一个新的Dongle设备。我们建立一个由Usb到串口设备的虚拟绑定
-激活你手机的蓝牙。对于诺基亚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"
菜单->连接->蓝牙->我的手机名称->输入一个你手机的名称
-搜索你的手机
这个应用将扫描蓝牙的设备。它会显示一些像这样的信息:
开始的数字就是你手机的地址。显然,你的会不同!
复制你的地址到粘贴板!
-编辑 /etc/bluetooth/rfcomm.conf:
取消所有内容,并输入这些:
在“你的手机地址”,你必须输入你已经写在粘贴板的那个地址。例如:
-添加诺基亚频道(10),用来与你的手机通讯
-绑定
例如:
-现在我们可以测试一下连通性
从电脑到你的诺基亚手机的传送
例如:
它将会提示有蓝牙设备。选择你的手机,确定。
从你的诺基亚到你电脑的传送
激活你电脑上的ObexServer去接受来自其他蓝牙设备的连接:
去到你手机的图库,然后利用蓝牙传送文件。对于诺基亚6630:
Menu -> Gallery -> Images -> NamePhoto.jpg -> Options -> Send -> Via Bluetooth
菜单->图库->图像->图片名.jpg->选项->发送->通过蓝牙
接着选择你的电脑,并点击选择
你可以在临时文件夹 /tmp/里找到你的文件。
技巧:
这在诺基亚6630上工作得很完美,但我认为使用蓝牙,可以在全部诺基亚手机上工作。因为我们使用的频道号码10是诺基亚手机默认频道。
如果你的手机不是诺基亚,但你知道了你手机的频道号码,你可以在How To里替换,我想它也可以工作的!
每一次重启,你都必须重新应用这些(这些你可以写入一个启动脚本(boot-script))
玩得开心,Ubuntu的用户!!!
通过这个How to,你可以:
-通过蓝牙,从你的电脑发送文件到你的诺基亚手机
-通过蓝牙,从你的诺基亚手机发送文件到你的电脑
-用蓝牙做任何你需要的事情
让我们开始吧!
-打开新立得软件包管理器
代码: 全选
sudo synaptic
代码: 全选
gnome-bluetooth
obexserver
bluez-utils
-加载这个模块到核心:l2cap, rfcomm
代码: 全选
sudo modprobe l2cap
sudo modprobe rfcomm
代码: 全选
sudo mknod /dev/rfcomm0 c 216 0
-激活你手机的蓝牙。对于诺基亚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"
菜单->连接->蓝牙->我的手机名称->输入一个你手机的名称
-搜索你的手机
代码: 全选
hcitool scan
代码: 全选
扫描中 ...
00:11:9F:C0:FE:21 你手机名称
开始的数字就是你手机的地址。显然,你的会不同!
复制你的地址到粘贴板!
-编辑 /etc/bluetooth/rfcomm.conf:
代码: 全选
sudo gedit /etc/bluetooth/rfcomm.conf
取消所有内容,并输入这些:
代码: 全选
rfcomm0 {
device 你的手机地址;
channel 10;
comment "What you want ";
}
在“你的手机地址”,你必须输入你已经写在粘贴板的那个地址。例如:
代码: 全选
rfcomm0 {
device 00:11:9F:C0:FE:21;
channel 10;
comment "My Nokia Phone";
}
-添加诺基亚频道(10),用来与你的手机通讯
代码: 全选
sudo sdptool add --channel=10 OPUSH
代码: 全选
sudo rfcomm bind /dev/rfcomm0 你手机地址 10
代码: 全选
rfcomm bind /dev/rfcomm0 00:11:9F:C0:FE:21 10
-现在我们可以测试一下连通性
从电脑到你的诺基亚手机的传送
代码: 全选
gnome-obex-send 文件名
代码: 全选
gnome-obex-send /home/massi/Desktop/Video.3gp
从你的诺基亚到你电脑的传送
激活你电脑上的ObexServer去接受来自其他蓝牙设备的连接:
代码: 全选
obexserver
去到你手机的图库,然后利用蓝牙传送文件。对于诺基亚6630:
Menu -> Gallery -> Images -> NamePhoto.jpg -> Options -> Send -> Via Bluetooth
菜单->图库->图像->图片名.jpg->选项->发送->通过蓝牙
接着选择你的电脑,并点击选择
你可以在临时文件夹 /tmp/里找到你的文件。
技巧:
这在诺基亚6630上工作得很完美,但我认为使用蓝牙,可以在全部诺基亚手机上工作。因为我们使用的频道号码10是诺基亚手机默认频道。
如果你的手机不是诺基亚,但你知道了你手机的频道号码,你可以在How To里替换,我想它也可以工作的!
每一次重启,你都必须重新应用这些(这些你可以写入一个启动脚本(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
玩得开心,Ubuntu的用户!!!
独自看一看大海
总想起身边走在路上的朋友
Lenovo E290-420[Celeron-M420/256M/60G/Intel GMA950]
总想起身边走在路上的朋友
Lenovo E290-420[Celeron-M420/256M/60G/Intel GMA950]
- oneleaf
- 论坛管理员
- 帖子: 10441
- 注册时间: 2005-03-27 0:06
- 系统: Ubuntu 12.04
- oliver
- 帖子: 775
- 注册时间: 2005-10-05 11:31
- 联系:
- firehare
- 帖子: 2625
- 注册时间: 2005-04-10 16:54
- 来自: 温州大学
- 联系:
- oliver
- 帖子: 775
- 注册时间: 2005-10-05 11:31
- 联系:
- oliver
- 帖子: 775
- 注册时间: 2005-10-05 11:31
- 联系:
- firehare
- 帖子: 2625
- 注册时间: 2005-04-10 16:54
- 来自: 温州大学
- 联系:
- oliver
- 帖子: 775
- 注册时间: 2005-10-05 11:31
- 联系:
firehare兄,谢谢!~如果买错了蓝牙适配器导致和手机硬件不兼容我只能够自认晦气,破财。但是蓝牙适配器和电脑之间的驱动问题应该不成问题。蓝牙适配机附带windows驱动,我在windows平台也试过了,手机能够识别蓝牙适配器,但是计算机就是不能够通过兰芽适配器识别手机。而且我在windows的硬件管理里头看过,蓝牙适配器已经安装。
我最怕的是硬件不兼容,那就是我的问题了,就是我买错了东西,网上买的,退换时很麻烦的。
但是我想通讯协议应该是向下兼容的,我的手机蓝牙版本是1.1,而蓝牙适配器的蓝牙协议版本是1.2,我google了下,
在IBM蓝牙技术部分看到如下一段内容
我最怕的是硬件不兼容,那就是我的问题了,就是我买错了东西,网上买的,退换时很麻烦的。
但是我想通讯协议应该是向下兼容的,我的手机蓝牙版本是1.1,而蓝牙适配器的蓝牙协议版本是1.2,我google了下,
在IBM蓝牙技术部分看到如下一段内容
于是我放心了,但愿是我设置有问题吧,但是我设置似乎没有问题。我担心是否刚买的东西是个坏的……那岂不是麻烦了目前市场上设备中运行的蓝牙协议有三个版本 —— 分别是版本 1.1、1.2 AFH 和 2.0+EDR。这没给开发人员带来任何问题,因为新版本的协议与以前的版本兼容。表 1 显示了目前可用的蓝牙版本的一些相似性与区别。
- firehare
- 帖子: 2625
- 注册时间: 2005-04-10 16:54
- 来自: 温州大学
- 联系:
- oliver
- 帖子: 775
- 注册时间: 2005-10-05 11:31
- 联系:
- oliver
- 帖子: 775
- 注册时间: 2005-10-05 11:31
- 联系:
- firehare
- 帖子: 2625
- 注册时间: 2005-04-10 16:54
- 来自: 温州大学
- 联系:
- oliver
- 帖子: 775
- 注册时间: 2005-10-05 11:31
- 联系:
有进展了~ 我的手机型号是Nokia7610 ,输入命令:“*#2820#”取得手机的蓝牙设备号,然后直接在计算机上面添加这个地址的远端蓝牙设备(我先在windows上通过ivt程序操作,然后竟然发现手机设备了!)
曙光来了…… 选择配对……提示超时,重复几次依旧……
于是我切换到linux操作,添加频道,邦定手机……然后尝试从计算机向手机传送文件……
于是我激活obexserer,尝试用手机连接计算机。
手机能够搜索到计算机"ubuntu-0",然后提示“正在等待ubuntu-0",最后还是失败了——失败提示“无法和ubuntu配对“。
不定什么时候就能够搞定了…… ^_^ 先搁置。
曙光来了…… 选择配对……提示超时,重复几次依旧……
于是我切换到linux操作,添加频道,邦定手机……然后尝试从计算机向手机传送文件……
查询结束,难道也是超时?oliver@ubuntu:~$ gnome-obex-send ~/Desktop/test bluetooth.txt
** Message: inquiry complete
于是我激活obexserer,尝试用手机连接计算机。
.oliver@ubuntu:~$ obexserver
Waiting for connection..
手机能够搜索到计算机"ubuntu-0",然后提示“正在等待ubuntu-0",最后还是失败了——失败提示“无法和ubuntu配对“。
不定什么时候就能够搞定了…… ^_^ 先搁置。
- oliver
- 帖子: 775
- 注册时间: 2005-10-05 11:31
- 联系:
这个问题搁置了好长时间。一直找不到解决的方法(windows下也用不了,不知道是我的手机问题还是蓝牙适配器问题亦或是蓝牙协议问题)。一个礼拜以前我还是与商家联系,添了钱换了一个更高协议的蓝牙适配器。
拿到手以后我在图形界面的蓝牙设备管理器里面能够搜索到手机了,然后我按照说明在命令行终端配置了下,提示不能连接,然后根据错误信息,我更改频道号为9(我的手机型号是Nokia7610)。然后能够成功连接上。于是我在文本界面尝试发送一个测试用文本文件:test.txt,于是手机上收到了一条蓝牙信息,文件发送成功了。
^_^
不过依旧还存在些问题,用手机不能够连接计算机。手机连接计算机要求输入配对密码,随便输入一个,提示不能配对。于是目前为止还只能从计算机往手机发送资料。另外,Applications->System Tools->Bluetooth File sharing是用来接受手机发送文件,而Bluetooth Manager则是用来管理蓝牙设备。难道没有用来向蓝牙手机发送文件的图形化界面程序么?如果发送文件能够更加便利就好了(例如右键选中文件然后选择“send to”直接能够通过蓝牙发送文件就好了)
拿到手以后我在图形界面的蓝牙设备管理器里面能够搜索到手机了,然后我按照说明在命令行终端配置了下,提示不能连接,然后根据错误信息,我更改频道号为9(我的手机型号是Nokia7610)。然后能够成功连接上。于是我在文本界面尝试发送一个测试用文本文件:test.txt,于是手机上收到了一条蓝牙信息,文件发送成功了。
^_^
不过依旧还存在些问题,用手机不能够连接计算机。手机连接计算机要求输入配对密码,随便输入一个,提示不能配对。于是目前为止还只能从计算机往手机发送资料。另外,Applications->System Tools->Bluetooth File sharing是用来接受手机发送文件,而Bluetooth Manager则是用来管理蓝牙设备。难道没有用来向蓝牙手机发送文件的图形化界面程序么?如果发送文件能够更加便利就好了(例如右键选中文件然后选择“send to”直接能够通过蓝牙发送文件就好了)