Description of personal experience

воскресенье, 29 июня 2008 г.

How to setup GPRS or CDMA connection

Will be useful for the mobile linux-fans

If you buy a 2G or 3G-card in Europe, you will certainly get a good
user support. However, this support will be (almost certainly :-) be
limited to Windows and Mac OS. Seller may say -- Linux does not work,
therefore we do not give support :-) Of course, you can get an Internet
connection with your 2G or 3G-cards under Linux. However, you should
be the guy who sets it up.

The most windows-like way to setup the connection is to use the
program kppp-dialer. The most general way, is to use the
ppp-daemon directly.

I. KPPP -- the most windows-like way to setup the connection

1. Install kppp-dialer for your particular Linux-flavor.

2. Start kppp. If you get the message about permissions to run pppd,
then set a SUID-bit doing as root

chmod u+s /usr/sbin/pppd

3. Probable you will get no connection setted in your kppp.
Thus, push the button "Configure" to setup one connection.

4. You will get a window "KPPP Configuration - KPPP" with several
inlets. The cover-inlet "Accounts" shall be setup first.
Thus, push the button "New..."

5. Choose "Manual setup".

6. Set an arbitrary connection name, say "vodafone.fr" in
the cover-inlet "Dial"

7. Push "Add..." and enter a strange phone number *99***1#

8. Push "Customize ppp Arguments..." and add there
replacedefaultroute
persist
novj
novjccomp
usepeerdns

9. Save all these settings and go back to the window
"KPPP Configuration - KPPP"

10. Choose the inlet "Modems"

11. Push "New..." and set an the "Modem name:" of your choice

12. "Modem device:" you can see by doing as root

tail -f /var/log/messages

and inserting your card to an usb-port or pcmcia-slot.
Probable you will see from two to four device-names ttyUSB0,
ttyUSB1 etc. If you do not see any messages with "tty" substring,
then you don't have a proper module set. Still, you should get
a message from kernel about a new low-speed device, for instance

Jun 29 14:10:08 laptop-01 kernel: usb 4-2: new low speed USB device using uhci_hcd and address 4
Jun 29 14:10:09 laptop-01 kernel: usb 4-2: new device found, idVendor=1267, idProduct=0201

Load the module usbserial, by doing as root

modprobe usbserial vendor=0x1267 product=0x0201

After the module usbserial is load, connect the modem again and
see the device-name in /var/log/messages

If not, you may start troubleshooting. This page may help you
http://www.cl.cam.ac.uk/~dnc25/vodafone3g.html

13. Choose one of the device names in the inlet "Modems".
Most probable it should be /dev/ttyUSB0

14. Choose the inlet "Modem"

15. Push the button "Modem Commands..." and enter in the "Initialization string 2:"
AT+CGDCONT=1,"IP","websfr"
The part websfr applies to the SFR 3G+ connection in France. Other operators
have their own APN names. Here, I collect some names for starting purpose.
Other details can be found in a search engine.

Country | Carrier | Plan | APN/Phone | User/Password

Estonia | Elisa
| Any | internet
Estonia | EMT
| Any | internet.emt.ee
Finland | Saunalahti
|Any | internet.saunalahti
Finland
| Sonera | Any | internet
Finland
| Sonera |Any | prointernet
France
| SFR | | websfr
France
| SFR | | wapsfr
France
| Orange | | orange.fr
Germany | E-Plus
| | internet.eplus.de | eplus gprs
Germany | T-Mobile
| | internet.t-mobile
Germany | Vodafone Any, behind NAT web.vodafone.de
New Zealand | Vodafone Any live.vodafone.com / *99***2#
Norway
| Netcom Any internet.netcom.no
Norway
| Telenor Any telenor
Switzerland
| Swisscom behind NAT gprs.swisscom.ch
Russia
| Beeline Any internet.beeline.ru beeline beeline
Russia
| Megafon Any internet gdata gdata
Russia
| MTS Any internet.mts.ru
Russia
| Skylink Any AT+CRM=1;&C0 / #777 mobile internet.
UK
| T-Mobile general.t-mobile.uk
UK
| Virgin goto.virginmobile.uk user
UK
| Other consult http://www.filesaveas.com/gprs.html
USA
| Cingular (AT&T) Less than full internet wap.cingular / may require *99***1#
USA
| T-mobile Anything less than full internet wap.voicestream.com
USA
| T-mobile Regular internet plan internet2.voicestream.com
USA
| T-mobile "VPN" internet plan internet3.voicestream.com

[1] Connected through a WAP proxy (slower, but the only way to access Vodafone live! and SFR portal)
[2] Unless stated otherwise the phone number to call is "*99#"

16. You may need to add your account to the group uucp in order to
be able to lock the modem device. Please, do as root

usermod -A uucp

17. Another problem, which can hamper your try is the PIN number in your SIM-card.
Probable, you would reset this security feature in favor of convenience.
In order to do this, you should submit an AT-command to the modem (your 3G-card)
AT+CPIN="XXXX"
AT+CLCK="SC",0,"XXXX"
where "XXXX" is your PIN number.
The simplest way to do it with kppp, is to use the internal terminal, which
you can start from the inlet Edit Modem. Please choose
Configure...->Modems->Edit->Modem->Terminal
and enter the commands by hand.

II.
PPPD -- the most general way to setup the connection

KPPP-dialer is graphical-shell for a peer-to-peer protocol daemon pppd.
Indeed, if you don't kppp-dialer, or for some reason it does not function
well, you can use the pppd directly, from the terminal.

1. Create the pppd script, say vodafone in the directory /etc/ppp/peers/
#
# This is the script for pppd-deamon
#
#!/bin/sh
SPEED=460800
TTY=/dev/ttyUSB0
ISP=anyname
USER=anyname
pppd $TTY $SPEED \
defaultroute \
noipdefault \
usepeerdns \
replacedefaultroute \
persist \
lock \
modem \
novjccomp \
novj \
name $ISP \
user $USER \
debug kdebug 1 \
connect '/usr/sbin/chat -v -s -f /etc/ppp/vodafone.chat'

2. Create the vodafone.chat file in the directory
/etc/ppp/
#
# vodafone.chat file
#
TIMEOUT 10
ABORT 'BUSY'
ABORT 'NO ANSWER'
ABORT 'NO CARRIER'
SAY 'Starting CDMA connect script\n'

# Get the modem's attention and reset it.
'' 'ATZ'

# E0=No echo, V1=English result codes
OK 'ATE0V1'
OK 'AT+CGDCONT=1,"IP","websfr"'
OK 'AT+CFUN=1'
OK 'AT+COPS'

# Dial the number
SAY 'Dialing...\n'
OK 'ATD*99***1#'
CONNECT ''

you may note the familiar strings like

the phone number *99***1#

the APN-name 'AT+CGDCONT=1,"IP","websfr"'

3. The work is done. running the script /etc/ppp/peers/vodafone
most probable will open the desired internet connection.

III. VODAFONE driver -- the obsolete way to setup the connection

Python script vodafone-mobile-connect-card-driver...
exists in the net, however, I could not properly installed it.
The problems arose because this driver demands other python-packages.
In particular, the package pytz (python time zone) I could not install
on my SuSE 10.3. Thus, I sort this way as obsolete and don't recommend it.

Комментариев нет: