Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> สมาร์ทโฟน >> Linux

Tethering อินเทอร์เน็ต Nokia N95 ไปยัง Laptop ผ่าน Bluetooth บน Linux

หมายเหตุ: บทความปี 2008 ใช้ wvdial/RFCOMM แบบ Manual ปัจจุบัน NetworkManager/ModemManager/BlueZ รองรับ Bluetooth Tethering แบบ Native แล้ว

⚠ คำเตือน: ใช้ข้อมูล 3G ผ่าน Bluetooth อาจช้ากว่า USB และมีค่าใช้จ่ายสูง ตรวจสอบ Data Plan!

เตรียมการ (ร่วมทั้ง 2 วิธี)

  1. จับคู่ (Pair) N95 กับ Laptop ผ่าน Bluetooth (GNOME Bluetooth / Blueman)
  2. ติดตั้งแพ็กเกจ: sudo dnf install ppp wvdial bluez / sudo apt install ppp wvdial bluez
  3. หา MAC Address ของ N95:
    $ hcitool scan
    Scanning ...
    00:22:66:9F:83:37  N95
  4. หา Channel DUN (Dial-Up Networking):
    $ sdptool browse 00:22:66:9F:83:37 | grep -A5 "Dial-Up Networking"
    Channel: 2
  5. ตั้งค่า RFCOMM persistent (/etc/bluetooth/rfcomm.conf):
    rfcomm0 {
        bind yes;
        device 00:22:66:9F:83:37;
        channel 2;
    }
  6. รีสตาร์ท Bluetooth: sudo systemctl restart bluetooth
  7. จะมี /dev/rfcomm0 พร้อมใช้งาน

วิธี Command Line (wvdial)

  1. แก้ /etc/wvdial.conf ใช้ Modem = /dev/rfcomm0 และ Dialer ชื่อ Bluetooth
  2. สร้าง /etc/ppp/ip-up.local เหมือนวิธี USB
  3. เชื่อมต่อ: sudo wvdial Bluetooth

วิธี GUI (NetworkManager - แนะนำ)

  1. Settings → Network → + → Mobile Broadband
  2. เลือก Modem: /dev/rfcomm0 (หรือให้ NM Detect เอง)
  3. ตั้งค่า APN/Username/Password ตาม ISP
  4. เชื่อมต่อจาก Network Menu

วิธี Modern (BlueZ 5 + ModemManager)

ไม่ต้องตั้งค่า rfcomm.conf เอง ModemManager จะจัดการ RFCOMM เอง:

# ตรวจสอบ Modem
$ mmcli -L
# เปิด Modem
$ mmcli -m 0 --enable
# สร้าง Connection Profile
$ nmcli connection add type gsm ifname "*" con-name "N95-BT" apn "internet" user "user" password "pass"
# เชื่อมต่อ
$ nmcli connection up "N95-BT"

แก้ปัญหา

  • Pairing ล้มเหลว: ลบ Pairing เก่า จับคู่ใหม่ ใส่ PIN ให้ตรงกัน
  • ไม่เจอ DUN Channel: ใช้ sdptool records 00:22:66:9F:83:37 ดูทั้งหมด
  • ตัดการเชื่อมต่อบ่อย: ตรวจสอบ Bluetooth Power Management (btmgmt power off ปิด power saving)
  • ช้า: Bluetooth 2.0 EDR ~2-3 Mbps เท่านั้น ใช้ USB 2.0 เร็วกว่ามาก