proXL GPRS

現在、ジャカルタではLANのあるホテルに宿泊しているのだが、折角 Nokia N70 を持っているので、bluetooth でPCに接続し、モデムとして使ってみる実験をしてみた。電話回線は、XL bebas。まずは、N70からGPRSで接続するよう XL に登録して、接続を確認してみる。

以下、PC (Gentoo Linux on MSI S271)での設定。

bluetoothの設定は、一部古い情報があるものの、Gentooのガイドを参考にした。カーネルの設定や必須アプリケーションは、上記ページを参考されたい。

僕の場合、/etc/bluetooth/hcid.confはこんな。

# HCI daemon configuration file.
## HCId options
options {
 # Automatically initialize new devices
 autoinit yes;
 # Security Manager mode
 #   none - Security manager disabled
 #   auto - Use local PIN for incoming connections
 #   user - Always ask user for a PIN
 #	security user;
 # Pairing mode
 #   none  - Pairing disabled
 #   multi - Allow pairing with already paired devices
 #   once  - Pair once and deny successive attempts
 pairing multi;
 # Default PIN code for incoming connections
 #passkey "0987";
}
# Default settings for HCI devices
device {
 # Local device name
 #   %d - device id
 #   %h - host name
 name "BlueZ at %h (%d)";
 # Local device class
 #class 0x000100;
 class 0x3e0100;
 # Default packet type
 #pkt_type DH1,DM1,HV1;
 # Inquiry and Page scan
 iscan enable; pscan enable;
 # Default link mode
 #   none   - no specific policy
 #   accept - always accept incoming connections
 #   master - become master on incoming connections,
 #            deny role switch on outgoing connections
 lm accept;
 # Default link policy
 #   none    - no specific policy
 #   rswitch - allow role switch
 #   hold    - allow hold mode
 #   sniff   - allow sniff mode
 #   park    - allow park mode
 lp rswitch,hold,sniff,park;
}

/etc/bluetooth/rfcomm.conf はこんな

## RFCOMM configuration file.#
rfcomm0 {
 # Automatically bind the device at startup
 #bind no;
 bind yes;
#
 # Bluetooth address of the device
 device XX:XX:XX:XX:XX:XX;
##
 # RFCOMM channel for the connection
 channel	3;
##
 # Description of the connection
 comment "Nokia N70";
}

ペアリングのところで、pin_helperに関して、やや混乱した。Gentoo Guide では、明確に書かれていない。まず、

% rfcomm show /dev/rfcomm0rfcomm0: 00:1B:EE:0B:1D:BD channel 3 clear

となっている必要がある。もし

% rfcomm show /dev/rfcomm0rfcomm0: XX:XX:XX:XX:XX:XX channel 3 closed

となったら、

% sudo rfcomm release /dev/rfcomm0% sudo rfcomm bind /dev/rfcomm0

とすれば、望んでいる状態になるはず。

ここで、

% passkey-agent 1234 XX:XX:XX:XX:XX:XX(←ここはN70のbluetooth address)

としたうえで、別のコンソールから

% sudo rfcomm connect 0

とすれば、N70 側でPIN(上記の例では、1234)を要求してくる。N70側でPINを打てば、ペアリングができる。

次はpppの設定。僕は、 pppconfig を使った。

  • Provider Name: proXL (適当に)
  • DNS: Dynamic
  • Authentification Method: PAP
  • User Name: xlgprs
  • Password: proxl
  • Speed: 115200
  • Pulse or Tone: Tone
  • Phone No.: *99#
  • Choose Modem Config Method → Yes → manual → /dev/rfcomm0

と設定する。(参考ページ

/etc/ppp/peers/proXLは、

# This optionfile was generated by pppconfig 2.3.17.
 #
 #
hide-password noauth
connect "/usr/sbin/chat -v -f /etc/chatscripts/proXL"
debug
/dev/rfcomm0
115200
defaultroute
noipdefault
user "xlgprs"
remotename proXL
ipparam proXL
usepeerdns

/etc/chatscripts/proXLは、(ちょっと手書きで修正したけど)

# This chatfile was generated by pppconfig 2.3.17.
# Please do not delete any of the comments. Pppconfig needs them.
#
# ispauth PAP
# abortstring
ABORT BUSY ABORT 'NO CARRIER' ABORT VOICE ABORT 'NO DIALTONE' ABORT 'NO DIAL TONE' ABORT 'NO ANSWER' ABORT DELAYED
# modeminit
'' ATZOK-AT-OK "ATQ0 V1 E1 S0=0 &C1 &D2"
# SetupPDP? in +CGDCONT
OK-AT-OK 'AT+CGDCONT=1,"IP","www.xlgprs.net","0.0.0.0",0,0'
# ispnumber
OK-AT-OK "ATDT*99#"
# ispconnect
CONNECT dc
# prelogin
# ispname
# isppassword
# postlogin
# end of pppconfig stuff

僕の場合は、pdnsdを使っているので、/etc/pdnsd/pdnsd.conf に以下を加える。

server {
 label= "proXL";
 ip = 202.152.254.245,202.152.254.246;
 proxy_only=on;
 timeout=10;
 uptest=none;
 interface=any;
 interval=600;
 purge_cache=off;
}

接続は、pon proXL。ログはこんな感じになるはず。

Mar  8 05:13:35 [pppd] pppd 2.4.4 started by xxxxxx, uid 1000
Mar  8 05:13:39 [hcid] link_key_request (sba=XX:XX:XX:XX:XX:XX, dba=YY:YY:YY:YY:YY:YY)
Mar  8 05:13:41 [chat] abort on (BUSY)
Mar  8 05:13:41 [chat] abort on (NO CARRIER)
Mar  8 05:13:41 [chat] abort on (VOICE)
Mar  8 05:13:41 [chat] abort on (NO DIALTONE)
Mar  8 05:13:41 [chat] abort on (NO DIAL TONE)
Mar  8 05:13:41 [chat] abort on (NO ANSWER)
Mar  8 05:13:41 [chat] abort on (DELAYED)
Mar  8 05:13:41 [chat] send (ATZ^M)
Mar  8 05:13:42 [chat] expect (OK)
Mar  8 05:13:42 [chat] ATZ^M^M
Mar  8 05:13:42 [chat] OK
Mar  8 05:13:42 [chat] -- got it_
Mar  8 05:13:42 [chat] send (ATQ0 V1 E1 S0=0 &C1 &D2^M)
Mar  8 05:13:42 [chat] expect (OK)
Mar  8 05:13:42 [chat] ^M
Mar  8 05:13:42 [chat] ATQ0 V1 E1 S0=0 &C1 &D2^M^M
Mar  8 05:13:42 [chat] OK
Mar  8 05:13:42 [chat] -- got it_
Mar  8 05:13:42 [chat] send (AT+CGDCONT=1,"IP","www.xlgprs.net","0.0.0.0",0,0^M)
Mar  8 05:13:42 [chat] expect (OK)
Mar  8 05:13:42 [chat] ^M
Mar  8 05:13:42 [chat] AT+CGDCONT=1,"IP","www.xlgprs.net","0.0.0.0",0,0^M^M
Mar  8 05:13:42 [chat] OK
Mar  8 05:13:42 [chat] -- got it_
Mar  8 05:13:42 [chat] send (ATDT*99#^M)
Mar  8 05:13:42 [chat] expect (CONNECT)
Mar  8 05:13:42 [chat] ^M
Mar  8 05:13:44 [chat] ATDT*99#^M^M
Mar  8 05:13:44 [chat] CONNECT
Mar  8 05:13:44 [chat] -- got it_
Mar  8 05:13:44 [chat] send (d)
Mar  8 05:13:45 [pppd] Serial connection established.
Mar  8 05:13:45 [pppd] Using interface ppp0
Mar  8 05:13:45 [pppd] Connect: ppp0 <--> /dev/rfcomm0
Mar  8 05:13:47 [pppd] PAP authentication succeeded
Mar  8 05:13:48 [pppd] local  IP address 172.26.51.60
Mar  8 05:13:48 [pppd] remote IP address 10.6.6.6
Mar  8 05:13:48 [pppd] primary   DNS address 202.152.254.245
Mar  8 05:13:48 [pppd] secondary DNS address 202.152.254.246
Mar  8 05:13:50 [rc-scripts] Configuration not set for ppp0 - assuming DHCP
Mar  8 05:13:50 [dhcpcd] ppp0: dhcpcd 3.1.5 starting
Mar  8 05:13:50 [dhcpcd] ppp0: interface is not Ethernet, FireWire, InfiniBand or Token Ring

切断は poff。そのときのログは、

Mar  8 05:16:11 [pppd] Terminating on signal 15
Mar  8 05:16:11 [pppd] Connect time 2.4 minutes.
Mar  8 05:16:11 [pppd] Sent 39932 bytes, received 212284 bytes.
Mar  8 05:16:11 [pppd] Connection terminated.
Mar  8 05:16:11 [pppd] Exit.

みたいになるはず。