GPRS EDGE and the Samsung t519 in Ubuntu Linux

I fell a little off the wagon recently, after exiting a long and very life changing relationship I've not updated my website in many months. Part of the reason for this being that prior to the break up I purchased a large sail boat and moved on to it. Internet access from a sail boat is sort of a problem, there are a number of solutions all of which have a series of issues. The one I decided to try first was GPRS…It's main issue was it was difficult to set up. And so I thought I would write down how I managed to do it.

This is less of a tutorial and more of an explanation of what was missing from the tutorials I did find for my particular configuration.

The tutorial I had followed (to an unsatisfactory and non-functioning configuration) can be found here.

The Nitty Gritty

System Crappy laptop (has USB!)
Communication Vehicle Data Cable
Communication Prototcol GPRS (EDGE)
Communication Device Samsung t519 "Trace"
Provider T-Mobile
Platform Ubuntu (Dapper/Edgy)

The pain of the data cable

There is minimal support for this. Now I had pretty much absolutely no luck getting the cellular phone to work as a modem using bluetooth in linux. I tried a number of bluetooth devices none of which successfully connected to the phone, authenticate and were able to talk to the phone. So I gave in after trying the 4th USB bluetooth dongle and bought a data cable. Turns out this means that I cannot charge my phone and use it to connect to the internet at the same time, thanks to the ingenious design of the samsung multiport.

Talking to your phone

Now the datacable certainly simplified everything other than the battery issue for me, and I no longer had to authenticate against the phone or anything else, I simply plugged it in and was greeted with this wonderful syslog message…

Nov  6 22:07:13 localhost kernel: [  470.110171] usb 1-2: new full speed USB dev
ice using uhci_hcd and address 2
Nov  6 22:07:13 localhost kernel: [  470.551550] usbcore: registered new driver 
cdc_ether
Nov  6 22:07:13 localhost kernel: [  470.642117] usb%%d: unregister 'rndis_host'
 usb-0000:00:1d.0-2, RNDIS device
Nov  6 22:07:13 localhost kernel: [  470.644118] rndis_host: probe of 1-2:1.1 fa
iled with error -110
Nov  6 22:07:13 localhost kernel: [  470.644212] usbcore: registered new driver 
rndis_host
Nov  6 22:07:13 localhost kernel: [  470.645232] cdc_acm 1-2:1.3: ttyACM0: USB A
CM device
Nov  6 22:07:13 localhost kernel: [  470.647293] usbcore: registered new driver 
cdc_acm
Nov  6 22:07:13 localhost kernel: [  470.647369] drivers/usb/class/cdc-acm.c: v0
.23:USB Abstract Control Model driver for USB modems and ISDN adapters
Nov  6 22:07:13 localhost kernel: [  470.692617] Initializing USB Mass Storage d
river...
Nov  6 22:07:13 localhost kernel: [  470.694400] scsi0 : SCSI emulation for USB 
Mass Storage devices
Nov  6 22:07:13 localhost kernel: [  470.694994] usbcore: registered new driver 
usb-storage
Nov  6 22:07:13 localhost kernel: [  470.695143] USB Mass Storage support regist
ered.
Nov  6 22:07:18 localhost kernel: [  948.774852]   Vendor: Agere     Model: MMCS
D Card        Rev: 1.00
Nov  6 22:07:18 localhost kernel: [  948.774880]   Type:   Direct-Access        
              ANSI SCSI revision: 00
Nov  6 22:07:18 localhost kernel: [  948.924728] Driver 'sd' needs updating - pl
ease use bus_type methods
Nov  6 22:07:19 localhost kernel: [  948.940218] sd 0:0:0:0: Attached scsi remov
able disk sda
Nov  6 22:07:19 localhost kernel: [  948.964608] sd 0:0:0:0: Attached scsi gener
ic sg0 type 0

PPP

This was probably the trickiest part of the endevour. I found a number of instructions for configuring and setting up pppd to speak to a GPRS phone, none of which actually worked for me. And so, after a lot of frustration I was reduced to tinkering and mucking with the ppp configuration (whilst watching it's debug messages). After a couple hours of tinkering, I figured out that pppd was unable to negotiate an async character map with the phone through LCP (the link configuration protocol).

Async character map is basically a range of characters which need to be escaped over the link. And so I had to comment out the asyncmap 0 option in /etc/pppd/options. I also only found this out after shutting off all flow control (first I tried software only, and then I tried none…and then it started to give me LCP errors). I also found that disabling the auth option despite the comment asking me not to allowed for a skipped step of failure, even though my peer configuration for the GPRS device had the noauth option enabled.

In addition to commenting out the asyncmap option, I had also had to uncomment the "-am" flag in this configuration file in order to instruct pppd to just escape all control characters. I found I was then getting IPCP errors which were work-aroundable by just telling the phone to accept the remote address coming back over IPCP dispite it's lack of sanity (ipcp-accept-remote)

Last but not least, I commented out lcp-echo-interval and friends. Magically my link started working, but not until a detail I'll mention in the next section.

Chat Script

I found a number of suggestions for how to set this up, and most of them were almost right and none of them quite did the trick for this particular phone. I also found a very detailed document INSERT LINK HERE which outlined all of the available options in GPRS initialization strings. I then commented out a series of the ones which looked less important until the negotiation was happening successfully, but then I got caught on a last snag - I can't send anything to the modem after CONNECT is sent back from my peer. If I do, things simply fail to work smoothly. And so here is the chat script I ended up with when all was said and done (oh, and after spending 1.5 hours on the phone with T-Mobile techsupport in order to get the correct CGDCONT string).

ABORT BUSY ABORT 'NO CARRIER' ABORT VOICE ABORT 'NO DIALTONE' ABORT 'NO DIAL TON
# modeminit
'' ATZ

OK 'ATE1'
OK 'AT&F'
OK 'AT+CGDCONT=1,"IP","internet2.voicestream.com"'

# dial
ABORT 'NO CARRIER'
SAY "Dialing...\n"
OK 'ATD*99#'

# connected?
CONNECT

Short, sweet, and works. This chatscript is also attached to this page in it's original form.

Error: Failed to load processor AddComment
No macro or processor named 'AddComment' found

Attachments