logIt Log Around The Clock

Modem usb_modeswitch in Raspberry Pi

USB modem these days are plug-and-play as CD-ROM first allowing driver and internet dialer application installations and then as modem afterwards. This Windows-behavior is handled by USB_ModeSwitch in Linux. Likely three years ago we did eject and other driver attachment by writing udev rules.

Now it’s almost automatically attached as modem after insertion and people have been contributing to list of device-and-target device after mode-switching (find it as /usr/share/usb_modeswitch/configPack.tar.gz). At least for Raspberry Pi (RPi), I have one device list from August 2012 when playing around with XBian 0.8.3 and one from May 2012 in when using Raspbian Wheezy (2012-08-16).


Huawei E220 requires no mode-switch from vendor-product ID 12d1:1003 to function as modem

There is still wrapper for udev in /lib/udev/rules.d/40-usb_modeswitch.rule and my Huawei E153 HSDPA stick recognized and switched successfully as shown:

usb_modeswitch: switching device 12d1:1446 on 001/005
logger: usb_modeswitch: switched to 12d1:14ac on 001/006

But I didn’t get there in the first place. Because of USB power problem (detailed in previous post), I used to plug USB devices before powering up so that I could use Y-cable injected by separate power source without powered USB-hub. It turned out that if I had plugged the USB before powering up the RPi the mode-switching didn’t occur.

The HSDPA USB modem used is Huawei E153 appearing in lsusb with vendor-product ID 12d1:1446. Using aforementioned XBian and target device 12d1:140c (suggested in Santinoli’s post), I arbitrarily succeeded to switch to modem and dial internet with pppd.

[root]$ usb_modeswitch -v 12d1 -p 1446 -P 140c

(I placed Santinoli’s config in /etc/usb_modeswitch.conf)
This wasn’t stable however (also note that XBian consumed CPU above 50% for xbmc).

Later I find out that it will automatically switch to 12d1:14ac instead when plugged in after RPi is up. However, since it also won’t switch if plugged before power-up, I also try to mode-switch manually using config file found inside /usr/share/usb_modeswitch/configPack.tar.gz archive named 12d1:1446.

[root]$ usb_modeswitch -v 12d1 -p 1446 -c 12d1\:1446

It doesn’t seem to work. Modification to something close to my previous config also fails. Hence, consistent result only occurs if the stick is plugged in after RPi up. Then I decide to use USB-hub (also detailed in previous post) to tackle power issue (it will reboot anyway if you plug in without adequate powering). However, after successful mode-switch what’s being reported in eLinux Wiki often happens: it slows down, try lsub command for example.

Currently I give up the idea of using that modem and choose older Huawei E220:

  1. No usb_modeswitch. Driver attached directly by the kernel as option.ko device (this device has been on the list for long)
  2. Stable. No slowing down

The E153 modem itself has been implemented to stream video using the higher ARM type BeagleBoard-xM without significant stability issue (check my YouTube demo). It mode-switched when powering up Ubuntu on the Beagle.

2 thoughts on “Modem usb_modeswitch in Raspberry Pi

Leave a Reply