[Voyage-linux] 3G / GPRS
Mathias Bavay
(spam-protected)
Wed Mar 12 16:46:12 HKT 2008
On Tuesday, 11. March 2008 16:01, Robert Rawlins wrote:
> I've just ordered a couple of different modules from the internet to see
> which is going to suite me best. Can you give me a little bit more
> information as to how they implement?
Hi!
The serial GPRS modem is handled by pppd. A bunch of chat scripts will then do
the job of connecting you with the right parameters. That means that you need
to create/edit the following files:
*the file /etc/ppp/peers/provider contains:
# This is the default configuration used by pon(1) and poff(1).
# See the manual page pppd(8) for information on all the options.
# MUST CHANGE: replace myusername at realm with the PPP login name given to
# your by your provider.
# There should be a matching entry with the password
# in /etc/ppp/pap-secrets
# and/or /etc/ppp/chap-secrets.
user "myusername at realm"
# The /etc/chatscripts/gprs-connect-chat chat script may be modified
# to change the
# modem initialization string.
connect "/usr/sbin/chat -v -f /etc/chatscripts/gprs-connect-chat"
# Serial device to which the modem is connected.
/dev/ttyUSB0
# Speed of the serial line.
115200
# Assumes that your IP address is allocated dynamically by the ISP.
noipdefault
# Try to get the name server addresses from the ISP.
usepeerdns
# Use this connection as the default route.
defaultroute
# Makes pppd "dial again" when the connection is lost.
persist
# Do not ask the remote to authenticate.
noauth
*the file /etc/chatscripts/gprs-connect-chat contains:
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'
SAY "\ndefining PDP context...\n"
"" AT&F
OK AT&C1
OK AT&D2
OK 'AT+CGDCONT=1,"IP","gprs.swisscom.ch","",0,0'
OK ATD*99***1#
SAY "\nwaiting for connect...\n"
CONNECT ""
SAY "\nConnected."
In order to connect, you issue the command "pppd call provider" (or
equivalent, "pon provider"). If the connection is very slow, it can come from
a low baudrate between the modem and the computer. This is set up with the AT
command AT+IPR=115200 for example (a screen connection to the modem is a way
to submit AT commands to the modem: screen /dev/ttyUSB0 115200). You can find
a list of GPRS settings for various countries at
http://www.unlocks.co.uk/gprs_settings.php .
In order to disconnect, run the script poff (available in Voyage Linux).
I hope this helps!
Mathias
More information about the Voyage-linux
mailing list