the one with slackware linux and dialing gprs/3g network via bluetooth phone
There's time when you carry around your laptop and do wireless scanning but *darn it* as not a single (free) access point is nowhere to be found. I need to send this bloody email to my client immediately or I wont have anything to eat for weeks. Then I realise that I have my Sony Ericsson M600i mobile phone which is indicating that it has a good GPRS/3G signal. So here goes the steps to dial the M600i's modem via bluetooth.
First configure the file /etc/bluetooth/hcid.conf. This file represents your laptop.
== content of /etc/bluetooth/hcid.conf ==
options {
autoinit yes;
security user;
pairing multi;
passkey "4321"; # change to whatever the PIN
}
device {
name "karousel"; # the device name
class 0x000100;
iscan enable;
pscan enable;
lm accept;
lp rswitch,hold,sniff,park;
}
You'd need to enable bluetooth service on both devices (the laptop and the phone obviously). Then start the bluetooth network service in your slackware machine by running:
# chmod a+x /etc/rc.d/rc.bluetooth
# /etc/rc.d/rc.bluetooth start
Check that your bluetooth device is listed:
# hciconfig
hci0: Type: USB
BD Address: 00:16:CF:E8:4D:5A ACL MTU: 1017:8 SCO MTU: 64:8
UP RUNNING PSCAN ISCAN
RX bytes:8151888 acl:270883 sco:0 events:2218 errors:0
TX bytes:635484 acl:6392 sco:0 commands:30 errors:0
Scan for other bluetooth devices around:
# hcitool scan
00:16:B8:96:9B:66 kiara
Cool a phone has been found, and it has 00:16:B8:96:9B:66 as the network address. Now since we want only the dial-up networking (DUN) service from the phone, we've got to find which channel the DUN is being served:
# sdptool search DUN
Inquiring ...
Searching for DUN on 00:16:B8:96:9B:66 ...
Service Name: Dial-up Networking
Service Description: Symbian OS,UIQ phone
Service Provider: Sony Ericsson
Service RecHandle: 0x10006
Service Class ID List:
"Dialup Networking" (0x1103)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 7
Language Base Attr List:
code_ISO639: 0x656e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"Dialup Networking" (0x1103)
Version: 0x0100
We found out that kiara (00:16:B8:96:9B:66) serves DUN on channel 7. Open up /etc/bluetooth/rfcomm.conf with a text editor and fill up the value according to your phone information. This file represents your mobile device.
== content of /etc/bluetooth/rfcomm.conf ==
rfcomm0 {
bind yes;
device 00:16:B8:96:9B:66; # the phone network address
channel 7; # the channel that serves DUN
comment "Kiara SE-M600i DUN";
}
Now we need to create dialing scripts. These scripts deal with sending raw commands to communicate with the phone's modem via bluetooth. These scripts must be located in directory /etc/ppp/peers, so create this directory if it doesn't yet exist:
# mkdir -p /etc/ppp/peers
# touch /etc/ppp/peers/gprs3g{,.on,.off}
Content of the scripts:
== content of /etc/ppp/peers/gprs3g ==
lcp-echo-failure 0
lcp-echo-interval 0
nodetach
debug
show-password
connect /etc/ppp/peers/gprs3g.on
disconnect /etc/ppp/peers/gprs3g.off
/dev/rfcomm0 115200 crtscts
local
:10.0.0.1
noipdefault
ipcp-accept-local
defaultroute
usepeerdns
novj
nobsdcomp
novjccomp
nopcomp
noaccomp
#noauth # uncomment this line if no authentication is needed
user "indosat@durasi" # comment this line if no authentication is needed
== content of /etc/ppp/peers/gprs3g.on ==
exec /usr/sbin/chat -V -s -S \
TIMEOUT 5 \
ECHO ON \
ABORT '\nBUSY\r' \
ABORT '\nERROR\r' \
ABORT '\nNO ANSWER\r' \
ABORT '\nNO CARRIER\r' \
ABORT '\nNO DIALTONE\r' \
ABORT '\nRINGING\r\n\r\nRINGING\r' \
'' \rAT \
TIMEOUT 15 \
OK ATH \
OK ATE1 \
OK 'AT+CGDCONT=1,"IP","indosatgprs","",0,0' \
OK ATD*99***1# \
TIMEOUT 25 \
CONNECT "" \
SAY "\n[ok] Connection established.\n" \
== content of /etc/ppp/peers/gprs3g.off ==
exec /usr/sbin/chat -V -s -S \
ABORT "BUSY" \
ABORT "ERROR" \
ABORT "NO DIALTONE" \
"" "\K" \
"" "\K" \
"" "\K" \
"" "+++ATH" \
"" "+++ATH" \
"" "+++ATH" \
SAY "\n[ok] Connection terminated.\n"
That's all folks. To connect to the DUN, just run this command:
# pppd call gprs3g
There might be some issue with the new DNS setting the first time you make a connection. A simple solution is just add the new DNS addresses to /etc/resolv.conf:
# cp /etc/resolv.conf /etc/resolv.conf-bak
# cat /etc/ppp/resolv.conf > /etc/resolv.conf
First configure the file /etc/bluetooth/hcid.conf. This file represents your laptop.
== content of /etc/bluetooth/hcid.conf ==
options {
autoinit yes;
security user;
pairing multi;
passkey "4321"; # change to whatever the PIN
}
device {
name "karousel"; # the device name
class 0x000100;
iscan enable;
pscan enable;
lm accept;
lp rswitch,hold,sniff,park;
}
You'd need to enable bluetooth service on both devices (the laptop and the phone obviously). Then start the bluetooth network service in your slackware machine by running:
# chmod a+x /etc/rc.d/rc.bluetooth
# /etc/rc.d/rc.bluetooth start
Check that your bluetooth device is listed:
# hciconfig
hci0: Type: USB
BD Address: 00:16:CF:E8:4D:5A ACL MTU: 1017:8 SCO MTU: 64:8
UP RUNNING PSCAN ISCAN
RX bytes:8151888 acl:270883 sco:0 events:2218 errors:0
TX bytes:635484 acl:6392 sco:0 commands:30 errors:0
Scan for other bluetooth devices around:
# hcitool scan
00:16:B8:96:9B:66 kiara
Cool a phone has been found, and it has 00:16:B8:96:9B:66 as the network address. Now since we want only the dial-up networking (DUN) service from the phone, we've got to find which channel the DUN is being served:
# sdptool search DUN
Inquiring ...
Searching for DUN on 00:16:B8:96:9B:66 ...
Service Name: Dial-up Networking
Service Description: Symbian OS,UIQ phone
Service Provider: Sony Ericsson
Service RecHandle: 0x10006
Service Class ID List:
"Dialup Networking" (0x1103)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 7
Language Base Attr List:
code_ISO639: 0x656e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"Dialup Networking" (0x1103)
Version: 0x0100
We found out that kiara (00:16:B8:96:9B:66) serves DUN on channel 7. Open up /etc/bluetooth/rfcomm.conf with a text editor and fill up the value according to your phone information. This file represents your mobile device.
== content of /etc/bluetooth/rfcomm.conf ==
rfcomm0 {
bind yes;
device 00:16:B8:96:9B:66; # the phone network address
channel 7; # the channel that serves DUN
comment "Kiara SE-M600i DUN";
}
Now we need to create dialing scripts. These scripts deal with sending raw commands to communicate with the phone's modem via bluetooth. These scripts must be located in directory /etc/ppp/peers, so create this directory if it doesn't yet exist:
# mkdir -p /etc/ppp/peers
# touch /etc/ppp/peers/gprs3g{,.on,.off}
Content of the scripts:
== content of /etc/ppp/peers/gprs3g ==
lcp-echo-failure 0
lcp-echo-interval 0
nodetach
debug
show-password
connect /etc/ppp/peers/gprs3g.on
disconnect /etc/ppp/peers/gprs3g.off
/dev/rfcomm0 115200 crtscts
local
:10.0.0.1
noipdefault
ipcp-accept-local
defaultroute
usepeerdns
novj
nobsdcomp
novjccomp
nopcomp
noaccomp
#noauth # uncomment this line if no authentication is needed
user "indosat@durasi" # comment this line if no authentication is needed
== content of /etc/ppp/peers/gprs3g.on ==
exec /usr/sbin/chat -V -s -S \
TIMEOUT 5 \
ECHO ON \
ABORT '\nBUSY\r' \
ABORT '\nERROR\r' \
ABORT '\nNO ANSWER\r' \
ABORT '\nNO CARRIER\r' \
ABORT '\nNO DIALTONE\r' \
ABORT '\nRINGING\r\n\r\nRINGING\r' \
'' \rAT \
TIMEOUT 15 \
OK ATH \
OK ATE1 \
OK 'AT+CGDCONT=1,"IP","indosatgprs","",0,0' \
OK ATD*99***1# \
TIMEOUT 25 \
CONNECT "" \
SAY "\n[ok] Connection established.\n" \
== content of /etc/ppp/peers/gprs3g.off ==
exec /usr/sbin/chat -V -s -S \
ABORT "BUSY" \
ABORT "ERROR" \
ABORT "NO DIALTONE" \
"" "\K" \
"" "\K" \
"" "\K" \
"" "+++ATH" \
"" "+++ATH" \
"" "+++ATH" \
SAY "\n[ok] Connection terminated.\n"
That's all folks. To connect to the DUN, just run this command:
# pppd call gprs3g
There might be some issue with the new DNS setting the first time you make a connection. A simple solution is just add the new DNS addresses to /etc/resolv.conf:
# cp /etc/resolv.conf /etc/resolv.conf-bak
# cat /etc/ppp/resolv.conf > /etc/resolv.conf
Labels: 3g, bluetooth, dial up network, dun, gprs, modem, slackware

0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home