Your Linux Data Center Experts

Evelyn just got signed up with Cricket, because at $40/month she couldn't resist. Our Sprint WWAN cards are $60/month, and requires a 2 year commitment, which was over her threshold of pain. The Cricket plan is pretty tempting, considering it still offers unlimited data, includes a free modem, and apparently has no contract. It was a little tricky to get working, but only a little. Read on for more information.

I've put a tar file of these files up at ftp://ftp.tummy.com/pub/tummy/tummy-cricketnet/, and if I make any changes I'll push them up there as a new version.

Of course, as with all of them, you need to use Windows to activate the modem, before you can begin using it in Linux. This is just a one-time thing, you don't have to do it every time you reboot or anything.

The A600 modem is kind of unusual compared to the others that I've used in that when you plug it in it shows up as a CD-ROM drive. Under Windows, this contains the software to do the installation, and once installed Windows puts a driver in place which then tells the modem to switch to being a modem instead of being a CD-ROM.

Luckily, the usb_modeswitch folks have figured out how to do this switch under Linux. In Fedora 11 you can just download usb_modeswitch, on Ubuntu Intrepid you will need to download and build it.

The other thing my automation scripts rely on is cnetworkmanager which needs to be version 0.21 or higher. In Fedora 11 you will have to get the Rawhide version, in Ubuntu you again have to build and install from source (“python setup.py install”).

With those in place, I was able to set up the automation so the modem will come up automatically when it's plugged in. See my previous article for more details about that, but here are the files that I set up:

First is “/etc/udev/rules.d/tummy-cricket.rules”:

#  Cingular EVDO modem
ACTION=="add", SYSFS{idProduct}=="0021", SYSFS{idVendor}=="1f28", RUN+="/usr/local/sbin/tummy-cricketnet flipflop"

SUBSYSTEM=="tty", SYSFS{idProduct}=="0020", SYSFS{idVendor}=="1f28", RUN+="/usr/local/sbin/tummy-cricketnet $env{ACTION}"

Next is the “/usr/local/sbin/tummy-cricketnet” script:

#!/bin/bash
#
#  Start up the Cricket connection when it's plugged

#exec >>/tmp/cricketnet.out 2>&1
#echo Starting `date`
#set
#set -x

case "$1" in
   flipflop)
      (
      usb_modeswitch -v '0x1f28' -p '0x0021' -C 2 -m 0x08 -M 55534243b82e238c24000000800108df200000000000000000000000000000
      ) &
      ;;
   add)
      (
      for (( i=0; i < 30; i++ )); do
         cnetworkmanager --device-list | egrep -q 'CDMA.*DISCONNECTED' && break
         sleep 1
      done

      cnetworkmanager --online=1
      cnetworkmanager --wifi=0
      cnetworkmanager --activate-connection=user,'Auto Mobile Broadband (CDMA) connection',ttyACM0, &
      sleep 5
      kill %1
      ) &
      ;;

   remove)
      (
      cnetworkmanager --online=1
      cnetworkmanager --wifi=1
      ) &
      ;;
esac

Once these files are in place, plugging in the modem will switch it to modem mode, wait for the device to be recognized by NetworkManager, and then initiate the connection. See my previous article (linked in the header) for more details on this.

Thanks to this article on UbuntuGeek for getting me started.

comments powered by Disqus

Join our other satisfied clients. Contact us today.