[Wylug-help] Linux and GPRS

James Holden (Wylug) wylug at jamesholden.net
Wed Oct 22 19:25:25 BST 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

lists at mungewell.org wrote:

|Hi All,
|I've got a new toy and want to get it working with Linux.

New blower then?

|I think I understand the basics of bring the link up with
|ppp and 'atdt*99#', but I'd like to know a little more detail
|about how the link really works.

OK, for the phone to connect through GPRS, it needs an APN (access point
name) setting in it. The phone will come with several pre-programmed in,
usually one for Internet access and one for WAP, and maybe MMS, which
don't route to the outside world. Your box should use a 'chat' script to
establish a connection through the phone's modem, then pppd to get
TCP/IP going over the serial link.

There's a few things to note:

* pppd doesn't do any authentication, the phone network takes care of
that. pppd therefore needs the "noauth" option passing, but this means
you can only bring the link up as root. There are ways around this
though (sudo).
* The PC GPRS connection uses the same connection profiles as the phone.
You just select the right one with appropriate AT commands.
* The ppp host at the other end of the link is probably buggy and
broken, and you're best off disabling things like compression to begin
with so as not to confuse it.

|Once working can you use the link as if it was a normal network
|connection, i.e. what ever port/service you want...

Yes... pretty much.

|I assume that the phone allocates an IP for the PC end of the ppp link,
|is this a public IP - can it be reached from the outside world?

Not normally, well not on Orange anyway. You get shovelled through a NAT
gateway, eg; future-is.orange.co.uk (Ah ha... ha, ha).

|Is there anything that would prevent a 'evil doer' from ramping up your
|phone bill by sending loads of (unwanted) data to you (i.e flood ping)?

The NAT gateway should put a stop to this.

|
|Cheers,
|Simon.
|
|PS. at 0.75p/KB its not much good for P2P Music, but IM might work quite
|nicely.... and be a lot cheaper than SMS :-)

Orange is cheapest for GPRS in this country. In the USA you can have
unmetered GPRS for 20 USD per month. Grrr!

Here are my config files:

/etc/ppp/chat-gprs :
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         12
OK              ATZ
OK              ATE1
OK              ATD*99***1#
CONNECT         ''

The "1" in the ATD command refers directly to the CID of the connection
profile you want to use. You can find this out by looking in the
settings on your phone. It's normally 1, though.

There is advice floating around the 'Net to use
AT+CGCONT=1,"IP","apnname" but this isn't necessary because it's already
permanently set in the phone, and the +CGCONT command will *permanently*
overwrite those settings.


/etc/ppp/peers/gprs :

/dev/rfcomm0 57600
connect '/usr/sbin/chat -f /etc/ppp/chat-gprs'
noauth
defaultroute
debug
nodetach
nodeflate
novj
nobsdcomp
noipdefault
usepeerdns

/dev/rfcomm0 is the BlueTooth serial device, you could replace this with
the SIR device or plain on serial port.


/usr/sbin/gprs :

#!/bin/sh
/usr/bin/rfcomm release 0
/usr/bin/rfcomm bind 0 00:0A:D9:xx:xx:xx 1
/usr/sbin/pppd call gprs
/usr/bin/rfcomm release 0

This crufty script binds the tty device to the service on my phone, and
releases it afterwards. The hex address is my phone's BlueTooth address.
I have an icon on my Gnome menu to run this via sudo. The kernel modules
for the BlueTooth adaptor and protocols are loaded through modules.conf.

If you need any help, let me know. I had a bit of a time getting this
working properly and got to know it quite well.

James

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE/lsrJmHdHQoNYhjoRAqBLAJ9ktEfAPmjVL9Z0cm7VC3PNvOlWVgCgy6Tq
DAHWJFaT9InwGWnPQNw8ylg=
=YG5w
-----END PGP SIGNATURE-----






More information about the Wylug-help mailing list