Thursday, April 7, 2011

HUAWEI E220 3G HSDPA USB MODEM Support in Linux

HUAWEI E220 Workaround for kernels < 2.6.20

HUAWEI E220 is supported natively by Linux, over usbserial.ko (usbserial-generic) interface. Linux kernel versions prior to 2.6.20 have some problems with it, as the SCSI CDROM fakevolume with drivers for Microsoft systems gets automounted by usbstorage.ko module, preventing serial device /dev/ttyUSB0 from working properly. Try out my workaround-kit!

Simply download the package and do the following:

$ tar xjvf huawei.tar.bz2
$ cd huawei
$ su
# make info
...


Latest version 0x0008 works fine with SUSE 10.1, openSUSE 10.2, Fedora Core 5, Ubuntu 6.06, 6.10, 7.04, Mandriva Free2007Spring, and many many more! Check your system!

OOZIE 28/06/2007
  
FAQ

What is this supposed to do on my system?

The package contains an udev rule 99-huawei.rules. This rule tells the system to ignore the pseudo SCSI CDROM with the drivers and assigns usbserial.ko driver tothe modem and a PC user interface device. If the udev works, you should find two ttyUSB* devices in your /dev directory (sometimes 3 if usb_storage.ko is not active). If you don't have any other USB serial devices connected to your PC at the moment, modem should be assigned to /dev/ttyUSB0 and the user interface device to /dev/ttyUSB1

I have a 2.6.20 and later kernel. Do I still need huawei.tar.bz2?

No, on kernels newer than 2.6.19 both usb_storage.ko and usbserial.ko are aware of HUAWEI E220 modem and no further action needs to be taken. You should find three /dev/ttyUSB* devices directly after you plug E220 into a usb port. I recommend you, however, to take a look at the configuration files regardless of your kernel version. Configuration files for pppd and wvdial are included.

What is /dev/ttyUSB2 ? Do I need it?

No, it's just a leftover after the pseudo scsi disc. It should come up only if usb_storage.ko is not active (or is aware that it's not supposed to be active in kernels after 2.6.19

I do have a kernel newer than 2.6.19 but when I try to plug the modem into a USB port there is only ttyUSB0 in the /dev dir? The modem wokrs only when I boot up with it plugged in. Why?

It looks like option.ko module does its job here.
run lsmod|grep option to find out
To resolve this issue you can blacklist the option module. However, if your udev persistently loads it up you can remove option.ko and perform depmod afterwards.

Tuesday, September 29, 2009

Troubleshooting "AtCommandError: +CMS ERROR: 500"

If AtCommandError exception is thrown with "+CMS ERROR: 500" output, it literally means "SMS could not be sent" (which you must have figured out by now). Those are the possible reasons:
  • You lost coverage.
    In this case, the modem will typically seem to hang for 10-15 seconds. The delay is caused by an attempt to scan and associate with the cellular network. Run get_networks() on humodem.Modem's instance to see what networks are in range.
  • You use wrong Service Senter.
    Run get_service_center() on a humod.Modem's instance to see your service center; you can set a new value with set_service_center().
  • Potentially everything that prevents an SMS from being sent.

Sunday, September 13, 2009

PyHumod 0.03 released for downloads.

Latest PyHumod can be downloaded from:

The changes include:

Sunday, September 6, 2009

DevelGuide updated + some changes in the source.

I found some time to update PyHumod Developer's Guide. The wikidoc has been extended by the event handling section. I also worked on the source code in the mercurial repository and today's changes include:
  • deprecation of *_pbent, all SMS-related and entering Text/PDB mode commands. I will update the documentation reflecting it as soon as pyhumod-0x03 is available for download. I must admit I didn't put a lot of thought initially into the naming of the methods and they were a little random. From version 0.03 on, all SMS related Modem() methods will start with sms_* prefix, the phone book related ones with pbent_* prefix and so on.
  • Code cleanup to avoid repetition. See _common_enable for details.
  • Enabling CLIP (Calling line identification presentation). This will be useful in conjunction with event handler, as it tells you who (what number) is actually calling you.

Monday, August 31, 2009

PyHumod Developers Guide ...

A very short developers guide has been published in response to mistletoe's request on the mailing list. I hope you'll find it useful.

http://code.google.com/p/pyhumod/wiki/DevelGuide


Saturday, August 1, 2009

PyHumod 0.02 is out and up for grabs.

The final version of PyHumod 0.02 with SIM Phonebook manipulation support has been released. Some of the interesting changes include:
  • I tried to clean up some code by removing duplication,
  • enforced installation of /etc/ppp/options file (required by pppd),
  • list_messages() does not return a list of strings anymore, but a nested list of 5-element lists containing: message index, message status, sender number, ??, date+time.

You can get the source here:

Sunday, July 19, 2009

PyHumod 0.02-beta with Event Handling out!

New PyHumod 0.02-beta with improved support for MacOS X and event handling is out and up for grabs at: