How to connect T-Mobile Wireless Internet in Linux

I recommend you use this updated guide I’ve written which is easier. The below information is useful, but it is covered a little more accurately and simply in the link.

(Note: This blog was appended on Feb. 23, 2008. Information for Sprint phones was added as well as a minor modification to the wvdial.conf for T-Mobile phones example have been made).

I recently took on the challenge of getting an old PC up and running with Xubuntu 7.10. My father recently purchased the T-Mobile Internet package, which allows him to connect his computer to unlimited mobile Internet for $20 a month. Setting this up proved to be easier than I anticipated.

Laptop attached to a mobile phone

  1. The first thing you need to do is change the USB configuration in your phone. On my phone (a Motorola K1) and many other T-Mobile phones, you have to make your default USB connection a data connection. By default, most phones are configured to be in “Memory Card” mode.
  2. Next, you need to install a piece of software in Ubuntu called “wvdial“. To do this, click on Applications>Accessories>Terminal. Once your terminal window is open, type in the following: sudo apt-get install wvdial
  3. Edit your wvdial.conf file. Type sudo gedit /etc/wvdial.conf in a terminal window to do this.

Once you have your wvdial.conf file open, paste in the following text over all the contents of the file:

[Dialer Defaults]
Init1 = AT+CGDCONT=1,"IP","internet2.voicestream.com"
Modem Type = USB Modem
Phone = *99***1#
Password = pass
Username = user
Modem = /dev/ttyACM0
Baud = 460800

Take note of the “ttyACM0″ part. This may not be the same on your PC. To find out what yours is, attach your phone to your PC, and then type the following into the terminal:

$ dmesg | fgrep acm

You should see something like this returned in the output:

[ 9168.949496] cdc_acm 2-3:1.0: ttyACM0: USB ACM device

This ACM device is your phone, and it is now an accessible piece of hardware. For wvdial to use it, you must make sure the above configuration file points wvdial to the right device name. If the above dmesg output produces a different ttyACM#, change it accordingly to match your PC. (Note, if you don’t get any dmesg results at all, try typing this in first: sudo modprobe cdc_acm).

After your wvdial.conf file is created and you’re sure your Modem = /dev/tty line is correct, save the file and close gedit. Then simply run wvdial from the terminal:

$ wvdial

Wvdial will then access your phone as it is directed to do so by the wvdial.conf file, and essentially dial T-mobiles Internet Service Provider. No real username or password is required for this, so leave the user/pass in the above config file as it is written. You’ll see some output on the screen that looks like this:

user@user-desktop:~$ wvdial
WvDial<*1>: WvDial: Internet dialer version 1.56
WvModem<*1>: Cannot get information for serial port.
WvDial<*1>: Initializing modem.
WvDial<*1>: Sending: AT+CGDCONT=1,”IP”,”wap.voicestream.com”
WvDial Modem<*1>: AT+CGDCONT=1,”IP”,”wap.voicestream.com”
WvDial Modem<*1>: OK
WvDial<*1>: Modem initialized.
WvDial<*1>: Sending: ATDT*99#
WvDial<*1>: Waiting for carrier.
WvDial Modem<*1>: ATDT*99#
WvDial Modem<*1>: CONNECT
WvDial<*1>: Carrier detected. Waiting for prompt.

At this point, the program will pause as it handshakes and establishes a connection using PPP. After about 10 or 20 seconds, the output will continue on and look similar to this:

WvDial<Notice>: Don’t know what to do! Starting pppd and hoping for the best.
WvDial<Notice>: Starting pppd at Thu Jan 17 17:50:28 2008
WvDial<Err>: Warning: Could not modify /etc/ppp/pap-secrets: Permission denied
WvDial<Err>: –> PAP (Password Authentication Protocol) may be flaky.
WvDial<Err>: Warning: Could not modify /etc/ppp/chap-secrets: Permission denied
WvDial<Err>: –> CHAP (Challenge Handshake) may be flaky.
WvDial<Notice>: Pid of pppd: 13530
WvDial<*1>: Using interface ppp0
WvDial<*1>: pppd: ?06][08]?06][08]??[06][08]
WvDial<*1>: pppd: ?06][08]?06][08]??[06][08]
WvDial<*1>: pppd: ?06][08]?06][08]??[06][08]
WvDial<*1>: pppd: ?06][08]?06][08]??[06][08]
WvDial<*1>: pppd: ?06][08]?06][08]??[06][08]
WvDial<*1>: local IP address 10.38.225.200
WvDial<*1>: pppd: ?06][08]?06][08]??[06][08]
WvDial<*1>: remote IP address 192.168.100.101
WvDial<*1>: pppd: ?06][08]?06][08]??[06][08]
WvDial<*1>: primary DNS address 66.94.9.120
WvDial<*1>: pppd: ?06][08]?06][08]??[06][08]
WvDial<*1>: secondary DNS address 66.94.25.120
WvDial<*1>: pppd: ?06][08]?06][08]??[06][08]

Congrats! You are now connected to the Internet using your cellphone. And all you have to do to establish a connection is open a terminal window and type wvdial.

To end your connection, you can simply close the terminal window containing the above mess, or hit CTRL-C while the terminal window is open. So be careful and don’t close the window by accident, or your connection will be dropped and you’ll have to run wvdial all over again. Oh, the agony of typing that one command over again!!

Anyway, enjoy your T-Mobile Wireless Internet connection! You should see a steady downstream of about 20 to 30 KB per second, which is about 5 times faster than dial up. And it’s unlimited! It’s not DSL or Cable, but that’s still not a bad deal for 20 bucks a month.

Additional Information for Sprint users:

You may need to make your wvdial.conf file look more like this to get your phone to work:

[Dialer Defaults]
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = USB Modem
Phone = #777
ISDN = 0
Username = NONE
Init1 = ATZ
Password = NONE
Modem = /dev/ttyACM0
Baud = 460800
Auto DNS = 1
Stupid Mode = 1

In addition, you will want to do a sudo gedit /etc/ppp/peers in a terminal window and add the following two lines to the file:

lcp-echo-failure 0
lcp-echo-interval 0

I do not have a Sprint phone, but according to this guide it is confirm to work on a Sprint Samsung MM-920.

2 Responses to “How to connect T-Mobile Wireless Internet in Linux”

  1. Benjamin T Says:

    That 10 or 20 second pause isn’t the handshake. As it says, it’s waiting for a prompt. Recieving none, it times out, hence the ” Don’t know what to do! Starting pppd and hoping for the best.” line. Eliminating this step would shorten the connect time a lot…

  2. Benjamin T Says:

    Sorry for double-posting, but I just found out that the step you’re recommending for others, putting “Stupid Mode = 1″ in wvdial.conf, eliminates this 10-20 second wait. Try it out, It’ll speed up your connecting time.

Leave a Reply