About Archive Tags RSS Feed


Did you feel it in your knees

10 May 2009 21:50

This post is being made from my EEEEEeeee PC, using a 3G modem plugged into the USB port. The fact that I'm sat on my sofa, within easy reach of both a network cable and multiple WiFi access points is irrelevant!

I started my adventure yesterday evening, getting pretty annoyed along the way that that it wasn't just plug and go. It turns out I was suffering from two problems:

  • The USB device itself alternates between being a modem and being a dumb USB storage device (full of Windows software).
  • My copy of Network-Manager was too old.

In short from my Lenny installation I had to upgrade to Sid to get a copy of Network Manager with a "Mobile Broadband" section in its preferences. (I looked for backports, to no avail, and I didn't have the patience to make one mysefl). The new connection looks like this:


Once I added the connection discovered the USB modem device (/dev/ttyUSB0) just didn't work - and I learned about the dual-nature of the device. Thankfully switching is nice and easy "apt-get install usb-modeswitch" then:

# disable storage
usb_modeswitch -v 12d1 -p 1003 -d 1
# enable modem
usb_modeswitch -v 12d1 -p 1003 -H 1

Once that was done the connection worked almost immediately. (I just had to upgrade to a 2.6.29 kernel because I got panics on the Lenny kernel; something the upgrade installed but I'd previously ignored. Kernels: Bane of my life.)

Update: I do see some kernel weirdness talking about timeouts talking to the USB-serial device. Perhaps something to investigate in the future.

Anyway running a 3G O2 PAYG (pay as you go) modem on Debian, on an EEEPC is possible, it is justfiddlier than I had expected, and it required an upgrade to Sid - since Lenny didn't have a network manager with mobile broadband support.

For google's benefit the modem is described by O2 as a "mobile broadband USB modem - E160". This appears under lsusb as :

Bus 001 Device 005: ID 12d1:1003 Huawei Technologies Co., Ltd.
E220 HSDPA Modem / E270 HSDPA/HSUPA Modem

Hope that helps somebody else spend less than 5 hours getting it working. I guess the friends who said "It just worked" were running Ubuntu and so had a slightly newer network manager by default - and possibly their modems didn't need to toggle between "dumb storage" and "actual modem" modes.

Anyway it works now, and even though it was fiddly the issue wasn't insurmountable. I'm just a little grumpy because I've gotten used to a world in which Debian just works - the last time I struggled to get new hardware toys playing nice was .. a long time ago.

ObFilm: Pretty In Pink



Comments on this entry

icon Tim at 23:10 on 10 May 2009
gnome-ppp works fine as a nice front-end and it's in Lenny. I just started using the new network manager myself on my main laptop (new network manager is in testing now; I won't use sid on this machine), and it's a better solution for gnome users since dbus notifies everyone that a network connection is up (eg evolution). But I used gnome-ppp (or wvdial) for months, very happily. I have a Hauwei E220 (big and ugly by today's standards) which works with no problems at all in 2.6.26 (which testing is still using). It doesn't need the modeswitch workaround, but newer modems do. As an aside: On three prepay in Australia, the APN is different to the three subscription service. Ubuntu has a nice wizard based on your provider, but it doesn't know the difference between the prepay and postpay APN settings (defaults to the postpay), so there is fiddling for Ubuntu users as well :-)
icon Steve Kemp at 10:06 on 11 May 2009

Thanks for the feedback Tim - although I realised that ppp would be used under the hood it didn't even occur to me to try gnome-ppp.

I guess if I'd done that I'd have saved myself a fair amount of effort.

I did hear from a friend that Ubuntu's Jaunty service has a wizard with settings for O2 (the UK provider I'm using) but it doesn't have a "pay as you go/PAYG" option, just a couple of different settings for paid accounts.

icon Marius Gedminas at 22:10 on 11 May 2009
The USB mode switch is usually needed, but I suspect Ubuntu's udev ships the rules to do that automatically. Or perhaps the kernel itself? I've heard that usb-storage knows about some of the 3G modems. I used a Huawei E220 in Ubuntu, and I didn't need to do the mode switch manually, just wait several seconds for two ttyUSBx devices to appear. The connectivity was crappy, and I couldn't find a way to tell Network Manager to "keep trying until it bloody works", so I used Debian's /etc/ppp/peers and 'pon huawei-3 debug updetach persist holdoff 1 maxfail 0', and then usually had to kill it and restart because it would usually pick up just an IP and gateway addresses the first time (after 30 minutes of trying, mind), and would forget about DNS.
Sorry for ranting on your blog.
Anyway, I see a /lib/udev/rules.d/77-nm-probe-modem-capabilities.rules which invokes a mysterious and undocumented ("No manual entry for nm-modem-probe") command called nm-modem-probe. Maybe it's the one responsible for USB mode switching. dpkg -S tells me it came with network-manager 0.7.1~rc4.1.cf199a964-0ubuntu2.