Saturday 15 December 2007

GPRS in Debian GNU/Linux with mobile phone Siemens ME45

Problem: connect to the Internet via mobile phone and GPRS using USB-adapter Prolific PL2303 under Linux.
Solve: there are enough tools in Debian to do so.


What we have
All above mentioned will have show in my notebook Asus M5200AE under Debian GNU/Linux and Siemens ME45, adapter and local Beeline cellphone provider.


Before starting
For work to be done, PPP in kernel is required:

Networking options->
TCP/IP networking ->
Network device ->
PPP (point-to-point protocol) support

monolith or as module. Besides it, in kernel support of phone link adapter must be activated:
USB support->
Support for USB ->
USB Serial Converter support->
USB Serial Converter support
[m] USB Generic Serial Driver
[m] USB Prolific 2303 Single Port Serial Driver
If this is done, plug phone link USB adapter into USB and look at logs:
usb 3-1: new full speed USB device using uhci_hcd and address 3
drivers/usb/serial/usb-serial.c: USB Serial support registered for pl2303
pl2303 3-1:1.0: pl2303 converter detected
usb 3-1: pl2303 converter now attached to ttyUSB0
usbcore: registered new driver pl2303
drivers/usb/serial/pl2303.c: Prolific PL2303 USB to serial adaptor driver

That's all, adapter is found and recognized by kernel, new port /dev/ttyUSB0 which will be pointed to dial program.


Tune GPRS

Only thing to do is to point to dialer right parameters, and one can use GPRS without problems. Gaining root privileges and go to /etc/ppp/peers/ to create file beeline with following contents:
/dev/ttyUSB0
57600
noauth
defaultroute
usepeerdns
persist
noipdefault
lock
connect '/usr/sbin/chat -v -f /etc/chatscripts/beeline-connect'
novjccomp
nopcomp
noaccomp
noipdefault
nodeflate
novj
Don't set too big speed of connection, it can be cause of connection breakage. One more file, beeline-connect, one ought to make in directory /etc/chatscripts/ and write in it:
TIMEOUT 45
ABORT 'NO ANSWER'
ABORT 'BUSY'
ABORT 'NO CARRIER'
SAY 'Starting GPRS connection\n'
ABORT ERROR
"" 'ATZ'
"" 'ATE1'
OK AT+CGDCONT=1,"IP","internet.beeline.ru"
OK ATD*99***1#
CONNECT c
If you use different operator, change the line AT+CGDCONT=1,"IP","internet.beeline.ru" to that which is written on a website of you cellphone provider.


Connecting to the Internet via GPRS
All necessary tweaks are done and now one can use GPRS in Linux - let's enter the command from root:
pppd call beeline
or
pon beeline
A few seconds of waiting and it is possible to work as usual:



To disconnect from the internet, type:
killall pppd
or
poff beeline
That's all.


If something goes wrong...
Not everything can be done from first trying, and if GRPS doesn't work properly, you must look up in logs, and concretely - /var/log/syslog. This file in being red only root, so gaining root privileges and reading logs:

Aug 14 08:30:37 localhost chat[7715]: timeout set to 45 seconds
Aug 14 08:30:37 localhost chat[7715]: abort on (NO ANSWER)
Aug 14 08:30:37 localhost chat[7715]: abort on (BUSY)
Aug 14 08:30:37 localhost chat[7715]: abort on (NO CARRIER)
Aug 14 08:30:37 localhost chat[7715]: abort on (ERROR)
Aug 14 08:30:37 localhost chat[7715]: send (ATZ^M)
Aug 14 08:30:37 localhost chat[7715]: send (ATE1^M)
Aug 14 08:30:37 localhost chat[7715]: expect (OK)
Aug 14 08:30:37 localhost chat[7715]: g^?ATZ^MAT^M
Aug 14 08:30:37 localhost chat[7715]: OK
Aug 14 08:30:37 localhost chat[7715]: -- got it
Aug 14 08:30:37 localhost chat[7715]: send (AT+CGDCONT=1,"IP","internet.beeline.ru"^M)
Aug 14 08:30:38 localhost chat[7715]: expect (OK)
Aug 14 08:30:38 localhost chat[7715]: ^M
Aug 14 08:30:38 localhost chat[7715]: EAT+CGDCONT=1,"IP","internet.beeline.ru"^M^M
Aug 14 08:30:38 localhost chat[7715]: OK
Aug 14 08:30:38 localhost chat[7715]: -- got it
Aug 14 08:30:38 localhost chat[7715]: send (ATD*99***1#^M)
Aug 14 08:30:38 localhost chat[7715]: expect (CONNECT)
Aug 14 08:30:38 localhost chat[7715]: ^M
Aug 14 08:30:38 localhost chat[7715]: ATD*99***1#^M^M
Aug 14 08:30:38 localhost chat[7715]: CONNECT
Aug 14 08:30:38 localhost chat[7715]: -- got it
Aug 14 08:30:38 localhost chat[7715]: send (c^M)
Aug 14 08:30:38 localhost pppd[7314]: Serial connection established.
Aug 14 08:30:38 localhost pppd[7314]: Using interface ppp0
Aug 14 08:30:38 localhost pppd[7314]: Connect: ppp0 <--> /dev/ttyUSB0
Aug 14 08:30:41 localhost pppd[7314]: PAP authentication succeeded
Aug 14 08:30:44 localhost pppd[7314]: Cannot determine ethernet address for proxy ARP
Aug 14 08:30:44 localhost pppd[7314]: local IP address 10.0.103.11
Aug 14 08:30:44 localhost pppd[7314]: remote IP address 192.168.254.254
Aug 14 08:30:44 localhost pppd[7314]: primary DNS address 217.118.66.243
Aug 14 08:30:44 localhost pppd[7314]: secondary DNS address 217.118.66.244

After that strings I gained network interface ppp0

notebeast:/home/beast# ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:84 errors:0 dropped:0 overruns:0 frame:0
TX packets:84 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:5483 (5.3 KiB) TX bytes:5483 (5.3 KiB)

ppp0 Link encap:Point-to-Point Protocol
inet addr:10.1.193.83 P-t-P:192.168.254.254 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:204 errors:0 dropped:0 overruns:0 frame:0
TX packets:273 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:109516 (106.9 KiB) TX bytes:27628 (26.9 KiB)

through which Internet is being shed like a broad river.

0 comments: