Program to hunt for Sprint (or similar) wireless device. (tummy.com, ltd. Journal Entry)
tummy.com: we do linux

Saturday September 06, at 17:16
Subject: Program to hunt for Sprint (or similar) wireless device.
Keywords: Technical, Wireless
Posted by: Sean Reifschneider

Usually when I insert my Sprint cellular wireless card it shows up on /dev/ttyUSB3, but the other day it showed up on ttyUSB6. When you insert the card it creates 10 ttyUSB files, and I just want my card to work. So, I wrote a small python program (based off code I have previously written for talking to serial devices). Read on for how I solved it.

The correct device will respond to "AT" with "OK", just like an ancient Hayes modem. So, I took some code I had that talks to serial devices fairly conservatively but without getting hung up waiting for a response that will never come, and just walk through the likely devices looking for one that responds to AT with OK.

I've made this code available at ftp://ftp.tummy.com/pub/tummy/sprintfind including an example of it's use in my connection script.
(Post Reply)

Comment
Chris
Subject: udev
USB devices tend to have unique serial numbers, or at least unique vendor:product IDs. The standard way for doing what you're accomplishing is with a udev rule that matches on these and creates a symlink to an expected device path. For example, creating /dev/input/tablet-graphire/:

KERNEL=="event[0-9]*", SYSFS{idVendor}=="056a", SYSFS{idProduct}=="0010", SYMLINK+="input/tablet-graphire"

We can also create matches based on strings found in the product field, as shown here for /dev/pilot:

KERNEL=="ttyUSB*", ATTRS{product}=="Palm Handheld*|Handspring *|palmOne Handheld", SYMLINK+="pilot"

Or based on MAC address for the wlan0 interface:

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:13:e8:cc:XX:XX", ATTR{type}=="1", NAME="wlan0"

And you can run a script after setting up the device name:

KERNEL=="lp*", SUBSYSTEMS=="usb", SYSFS{idVendor}=="03f0", SYSFS{product}=="HP LaserJet 1020", SYMLINK+="hplj1020", RUN+="/usr/sbin/hplj1020"

Maybe you considered udev but couldn't use it for some reason? It's the right answer here, assuming you're using Linux.

- Chris.

Comment
Larry Hastings
Subject: Switch to a nice fresh Network Manager!
I'm running Ubuntu 8.10 (beta) on my main laptop, and the new builds of Network Manager support EDGE and CDMA cards out-of-the-box. You plug it in, pick "Auto cdma network connection" from the left-click drop-down list from Network Manager, and you're in business!

I've really been enjoying 8.10 on my laptop--apart from the e1000e bug, which never bit me but did get the device blacklisted for a while, and an Intel wireless kernel panic which bit me a zillion times.

Comment
Author: Sean Reifschneider
Subject: I was surprised 8.04 didn't have that in NetworkManager
Yeah, I was surprised since Fedora 9 had it that Ubuntu 8.04 did not. But, NetworkManager has been working fairly well for the WiFi connections.

Sean