USING THE GSM
- Ion Technical Information Manual
45
Surfing the Internet
In order to connect to the Internet using the internal GSM/GPRS moduel, you can use the
wvdial
program. Just edit its
configuration file named
/etc/wvdial.conf
as follow:
[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3 = AT+CGDCONT=1,"IP","<YOUR APN>"
Modem Type = Analog Modem
Baud = 115200
New PPPD = yes
Modem = /dev/ttyS1
ISDN = 0
Phone = "<YOUR PHONE NUMBER>"
Password = <YOUR PASSWORD>
Username = <YOUR USERNAME>
and replace parameters <YOUR APN>, <YOUR PHONE NUMBER>, <YOUR PASSWORD> and <YOUR USERNAME>
according to your network provider.
After having completed the modification of the configuration file, just type the
wvdial
command to start the
connection:
root@ion:~# wvdial
'--> WvDial: Internet dialer version 1.60
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
OK
--> Sending: AT+CGDCONT=1,"IP","web.omnitel.it"
AT+CGDCONT=1,"IP","web.omnitel.it"
OK
--> Modem initialized.
--> Sending: ATDT*99***1#
--> Waiting for carrier.
ATDT*99***1#
CONNECT
--> Carrier detected. Waiting for prompt.
Here the program may hang for a while but then the output continues:
--> Don't know what to do! Starting pppd and hoping for the best.
--> Starting pppd at Fri Oct 7 10:11:43 2011
--> Pid of pppd: 1949
--> Using interface ppp0
--> pppd: (~U[07][08]@~S[07][08]~H~[[07][08]
--> pppd: (~U[07][08]@~S[07][08]~H~[[07][08]
--> pppd: (~U[07][08]@~S[07][08]~H~[[07][08]
--> pppd: (~U[07][08]@~S[07][08]~H~[[07][08]
--> pppd: (~U[07][08]@~S[07][08]~H~[[07][08]
--> local IP address 109.114.117.107
--> pppd: (~U[07][08]@~S[07][08]~H~[[07][08]
--> remote IP address 109.114.126.226
--> pppd: (~U[07][08]@~S[07][08]~H~[[07][08]
--> primary DNS address 83.224.70.54
--> pppd: (~U[07][08]@~S[07][08]~H~[[07][08]
--> secondary DNS address 83.224.70.77
--> pppd: (~U[07][08]@~S[07][08]~H~[[07][08]
If you want, you can make the
wvdial
process run in background using the Ctrl+Z key combination and the
bg
command (as usual for Linux processes). That sequence will give you the possibility to use the same shell for further
commands instead of having the needs to open another one.
After that you can check the newly created
pppX
network adapter that correspond to the GSM/GPRS module:
root@ion:~# ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)