หลังจากที่ได้ทำ
reverse DUN ระหว่าง linux laptop กับ Palm Treo 680 แล้ว คราวนี้ เป็นวิธีการทำ Treo 680 ให้กลายเป็น GPRS Modem กันบ้าง ซึ่งวิธีที่ง่ายที่สุด ที่ไม่ต้องหาโปรแกรมมาติดตั้งบน Treo เพิ่มเติมเลยก็คือ การใช้ bluetooth เชื่อมต่อแบบ dialup networking
- Ubuntu 8.04 ได้มีการติดตั้งโปรแกรมสำหรับ ใช้งาน bluetooth เอาไว้แล้ว ในกรณีที่ไม่ได้มีการติดตั้งเอาไว้ก่อน สามารถทำการติดตั้งได้ผ่านทางคำสั่ง
apt-get install bluez-libs bluez-utils bluez-sdp bluez-pan
- ทำการเปิด Discoverable mode ของ Treo 680
hcitool scan
- จด MAC address ของ Treo 680 เอาไว้
- edit file /etc/bluetooth/rfcomm.conf
เพิ่มบรรทัด
rfcomm0 {
bind yes;
device <MAC address ของ Treo>;
channel 1;
comment "Treo 680";
}
- restart bluetooth daemon โดยการ run
sudo /etc/init.d/bluetooth restart
- ตรวจสอบดูใน /dev ว่ามีไฟล์ที่ชื่อว่า rfcomm0 อยู่หรือไม่ ถ้ายังไม่มี สามารถสร้างโดยใช้คำสั่ง
sudo mknod /dev/rfcomm0 c 216 0
- เราจะสามารถ run คำสั่งเพื่อ bind port rfcomm0 ได้ทันทีโดยใช้คำสั่ง
sudo rfcomm bind /dev/rfcomm0 <MAC Address ของ Treo> 1
- สร้างไฟล์สำหรับ connect dialup network (ในที่นี้ใช้ DTAC)
/etc/ppp/peers/dtac
-----------
connect '/usr/sbin/chat -vf /etc/chatscripts/dtac-connect-chat'
/dev/rfcomm0
-detach
debug
idle 900
nopcomp
noaccomp
nobsdcomp
nodeflate
noccp
novj
usepeerdns
defaultroute
ipcp-accept-local
noauth
lcp-echo-failure 4
lcp-echo-interval 65535
-------------
ไฟล์ /etc/chatscripts/dtac-connect-chat
-----------
SAY 'Starting GPRS connect script\n'
TIMEOUT 10
ABORT 'NO DIAL TONE' ABORT 'NO ANSWER' ABORT DELAYED
'' ATZ
OK 'AT+cgdcont=1,"IP","www.dtac.co.th","",0,0'
SAY 'Dialing...\n'
OK ATD*99***1#
CONNECT ' '
------------
- เมื่อเสร็จเรียบร้อย พอต้องการต่อ GPRS กับ Treo ก็เพียงแต่ run คำสั่ง
pon dtac
อ้างอิง
https://help.ubuntu.com/community/BluetoothDialup------
9/8/08 edited: หลังจากการใช้งานพบปัญหาเรื่อง ถูก disconnect ทุก ๆ 2 นาที จาก error message:appear to have received our own echo-reply!appear to have received our own echo-reply!appear to have received our own echo-reply!No response to 4 echo-requestsSerial link appears to be disconnected.สามารถแก้ไขได้โดยเพิ่มบรรทัดlcp-echo-failure 4lcp-echo-interval 65535ลงไปใน /etc/ppp/peers/dtac ครับ