2007/11/14

Eee PC 之藍芽支援

[同時張貼於 Blog 及 xepc.org ]

在 Eee PC 上,藍芽其實已經有八成的支援了。
最可惜的是 Eee PC 本身的系統沒有執行 "dbus" 和 "bluetooth" 服務,還有就是和藍芽電話之間的 "配對" 動作很難做到。

要試試看的話可以這樣做, 插入USB藍芽後:
1. 開終端機: Ctrl-Alt-T
2. 變身成為 super user: sudo -s
當然,要打密碼。
3. 打開原本沒打開的服務, 包括 dbus 和 bluetooth:
/etc/init.d/dbus start
/etc/init.d/bluetooth start
4. 差不多了!試試打開手機的藍芽,然後再輸入這指令:
hcitool scan
應該會找到手機,顯示為 "xx:xx:xx:xx:xx:xx PhoneName"。

但是配對... 因為 Eee PC 沒有 gnome 也沒有 kde, 沒程式做 GUI 配對,只能在 /etc/bluetooth/hcid.conf 裡面寫一個 pin 碼來配對用。

配對指令(前者是要連線才配對,後者是先配對):
rfcomm bind xx:xx:xx:xx:xx:xx
rfcomm connect xx:xx:xx:xx:xx:xx
配對了以後就能用 wvdial 連線上網了,但是 Eee PC 沒有 wvdial 套件,要拿 debian 4.0 的 deb 包暫用。

wvdial 的設定跟普通 modem 差不多, 在 /etc/wvdial.conf

[Modem0]
Modem = /dev/rfcomm0
Baud = 115200
SetVolume = 0
Dial Command = ATDT
Init1 = ATZ
Init3 = ATM0
FlowControl = crtscts

[Dialer utms]
Username = guest
Password = guest
Phone = *99***1#
Stupid Mode = 1
Inherits = Modem0


配對不到的話 ,要修正 /etc/bluetooth/hcid.conf:

options {
autoinit yes;
security user;
pairing multi;
}

device {
name "%h";
class 0x3e0100;
iscan enable; pscan enable;
lm accept;
lp rswitch,hold,sniff,park;
auth enable;
encrypt enable;
}