2011-07-19

Using a Vodafone K4511 3G USB Dongle on Linux

There's plenty out there for those with Vodafone's previous stick, the Huawei K4505, but they've recently switched to providing a new model, the K4511. Although the dongle comes with support for Windows and Mac, I haven't found any pre-configured support for Linux.

Rather annoyingly I'm now using a fairly odd choice of distro, based around RHEL 6.1. Which means most people who might chance across this post will inevitably have to do something different. But as a pointer anyway, here's what I needed to do to get it working:

  • On insertion, "lsusb" will present Vendor=0x12d1, Product=0x14b7. There are currently no provided usb_modeswitch configs for this, so no device class will manifest. 
  • Make sure you've installed the latest "usb_modeswitch" and (if separate) "usb_modeswitch-data" packages for your distro.
  • Create the file /etc/usb_modeswitch.d/12d1:14b7 (hint: the colon needs escaping. Try "vi /etc/usb_modeswitch.d/12d1\:14b7" to create it)
  • Make the contents of this file as follows:
# Huawei, newer modems

DefaultVendor= 0x12d1
DefaultProduct=0x14b7

TargetVendor= 0x12d1
TargetProduct= 0x14cc

CheckSuccess=20

MessageContent="55534243123456780000000000000011062000000100000000000000000000"

(Note: I copied the existing 12d1:1446 file and modified only the "DefaultProduct" and "TargetProduct" values to get this output. What I'd have done if a different "MessageContent" was required, I have no idea...)

  • Edit the existing /lib/udev/rules.d/40-usb_modeswitch.rules file. Add a (single) line:
ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="14b7", RUN+="usb_modeswitch '%b/%k'"

(Note: Again, I copied & modified the existing line for device 12d1:1446)


  • For debugging purposes, you may want to set "EnableLogging=1" in /etc/usb_modeswitch.conf. If you do, files will be produced in /var/log/, in particular usb_modeswitch_3-4:1.0 will show the results of the switch, and you'll also get usb_modeswitch_ttyUSB[0-4] if it works.
  • Now insert the USB Dongle. After a short pause, it should be re-configured as a Modem *AND* a CD-ROM device - I get the file "10.2.102_RC1" appearing on the desktop as that's the firmware version loaded as a virtual CD device.
  • Configure NetworkManager as normal for a "Mobile Broadband" connection - I found the wizard supplied all the right defaults
  • Connect as normal - click the NetworkManager icon, select the Mobile Broadband connection you configured, and it should connect. After connection, click again and you'll see the service type (GPRS/EDGE/3G) and current network strength bars.
  • It's probably best to right-click the virtual CD device and "Eject" or "Safely Remove Drive" it before unplugging the stick, although I haven't had anything nasty happen to me yet when I've forgotten.
For Distros with no /etc/usb_modeswitch.d directory and/or files, you should get the same results by editing whatever's driving udev on your platform and adding something like:



usb_modeswitch -v 0x12d1 -p 0x14b7 -V 0x12d1 -P 0x14cc -M 55534243123456780000000000000011062000000100000000000000000000 -s 20

It's possible you might have to add some voodoo to ensure the option module is loaded to handle the /dev/ttyUSB[0-4] devices; I didn't have to bother as udev handled that for me automatically.

1 comment:

  1. This was useful! Have you considered contributing the info to http://www.draisberghof.de/usb_modeswitch/

    ReplyDelete