Thursday, January 22, 2009

How to use your Moto Q as a modem

So, I have the awesome (and now-discontinued) Spring SERO phone plan, which basically gives me unlimited text/data/everything for less than I paid for Verizon's cheapest plan. The only problem I've had until now:
How to tether my Motorola Q phone to my computer, so that I can use it as a modem when I'm not in range of a wireless network?
I read a whole lot of stupid forum posts on this topic, mostly by seriously confused people, and I was under the mistaken impression that (a) it's really hard to do, (b) it requires special software, and (c) Sprint has removed the features enabling tethering from the phone.

Well, it ain't true. In the course of a few hours, I figured out not how to tether my Moto Q in two different ways: first, using a USB cable, and second, via Bluetooth. So I'm going to explain how to do it both ways under Ubuntu Linux 8.10. It should be pretty much the same under other Linux variants.

Using a USB cable

You need to have pppd, chat, and pon/poff commands installed. Under Debian or Ubuntu, just do apt-get install ppp to install them.
  • First, on the phone go to: Start Menu | Accessories | Modem Link. Check that the Connection type is set to USB. Then press Activate.
  • A screen will pop up telling you to press OK before plugging in the USB cable. Do it, then plug in the cable. (Linux is apparently smart enough to not get confused if you keep the cable plugged in the whole time, so you can basically ignore this part.)
  • Okay, now go to your computer. You should now have a new device node, /dev/ttyACM0. The Linux kernel makes the phone look just like a good ol' fashioned serial modem using this driver.
  • Now let's make a configuration file for pppd. Some of you may remember this from the dark ages of dial-up-modems. From the command line, start up an editor as root:
  • $ sudo nano /etc/ppp/peers/motoq_usb
    
    And enter the following contents of this file:
    /dev/ttyACM0        # connect to the serial port /dev/ttyACM0
    460800              # ... at 460800 bps (as fast as possible)
    
    usepeerdns          # get DNS servers from the phone
    defaultroute        # and use this as the default internet connection
    
    crtscts             # use hardware flow control
    lcp-echo-failure 0  # if you forget this, ppp will drop the connection
    # (ask me if you want the gory details)
    
    # This explains to pppd how to talk to the "modem"
    # to set things up.  Really simple!  Just dial a
    # made-up number and then you're done.
    #
    connect "chat '' ATZ OK 'ATDT#777' CONNECT ''"
    
    
  • Under recent versions of Linux, you should now disable NetworkManager because it may get confused when you monkey with the Internet connection manually. So right-click on the Network applet in GNOME and un-check Enable Networking before you continue.
  • Now we're ready to fire it up! To start the connection for the first time, use:
    $ pon motoq_usb nodetach
    
    If all goes well, you'll see something like this:
    Serial connection established.
    Using interface ppp0
    Connect: ppp0 <--> /dev/ttyACM0
    Cannot determine ethernet address for proxy ARP
    local  IP address 68.246.162.72
    remote IP address 68.28.113.69
    primary   DNS address 68.28.114.91
    secondary DNS address 68.28.122.93
    
    
  • Fire up your web browser, email program, or whatever... check that you're online, and everything's working.
  • To close the connection, press Ctrl-C in the window where pon is running.
  • Now you can easily start and stop the connection to the phone:
    $ pon motoq_usb # to connect
    $ poff motoq_usb # to disconnect
And... there you have it! Your phone works as a modem.... just don't forget to re-activate Modem Link before you use it in this way. I get speeds of about 8 kB/s, which is just great for email and web browsing. Disclaimer: I am not responsible for high usage bills, exploding phones, or any airborne eel attacks that may result from following this procedure.

Using Bluetooth

In my next installment, I'll explain how to use the Moto Q as a Bluetooth modem. Obviously, you need a Bluetooth adapter on your computer to do this. I got a tiny one for $3 and it works great. With the phone as a Bluetooth modem, things are really überl33t. You can keep the phone in your pocket and use it as a modem without ever messing with any cables :-)

Coming soon...

No comments:

Post a Comment