Installing and using a T-Mobile ZTE MF626 USB 3G Mobile Broadband Dongle Under Linux

I bought a T-Mobile 3G USB Dongle from Tescos for £19.99. It's Pay as you Go so costs me nothing unless I use it, useful both as a backup and for if we go away. But surprise surprise, it needed a bit of tweaking to get it working on Linux.

As with so many other recent devices, the makers of the dongle (a ZTE MF626 ) have taken the USB and slightly bastardised it by using an internal modeswitch. So when you first plug the device in, all you get is a faux CDROM containing windows drivers. Really not a lot of use unless you happen to be running Windows!

Now you have 3 options;

  1. Take the P.O.S back and demand a refund
  2. Borrow a Windows Computer long enough to reconfigure it
  3. Roll your sleeves up and follow the rest of this guide

If you chose option 2 then install the software on Windows and use it to turn off the CDROM mode. Oh and thanks for reading this far!

If you're a true soldier and went for option 3, then let's begin.

Download Usb Modeswitch and install it;

tar jxvf
cd usb_modeswitch
[Enter Root Password]
make integrated_install

Obviously if you are running a *ubuntu you'll use sudo instead of su. Now as root do

nano /etc/usb_modeswitch.conf

Clear the entire file and then enter

DefaultVendor= 0x19d2
DefaultProduct= 0x2000

TargetVendor= 0x19d2
TargetProduct= 0x0031

Save the file and exit nano (Ctrl-o then Ctrl-x)

Now plug in your dongle and wait a few seconds, run dmesg and you should see the faux CDROM being detected. Run lsusb and you should see the Vendor ID 0x19d2 listed alongside product ID 0x2000.

Now to change the dongle to a modem use su to become root and run the following command.

/usr/sbin/usb_modeswitch -W -c /etc/usb_modeswitch.conf

If you run dmesg now you should see that the system has detected the modem. If it hasn't then try running (as root) modprobe option. If this fails then you need to compile the module for your kernel (which is way off on a tangent for this article!)

So your modem has now been detected, but if you unplug it, you'll have to run usb_modeswitch again to change it back to a modem. So lets tell the thing that we don't want its crappy CDROM emulation.

Make sure you have minicom installed (a sort of CLI version of Windows Hyperterminal)

[Enter root password]
Ctrl-A then Z
Press 0
Select Serial Port Setup and change settings to:

Speed: 115200
Data Bits: 8
Parity: None
Stop bits: 1
Flow Control: None

Set the serial port itself to /dev/ttyUSB0

Save Setup and exit


At this stage you should see minicom initialise the modem (an AT command will crawl across the screen). Once this has happened enter the following, followed by enter (you may wish to press Ctrl-A then Z and turn local echo on so you can see what you are typing!)


You should then receive a response containing 0:Fail 1:Success

You can then configure your network/dial up manager as you would any other modem. I personally prefer Wvdial, but most will do. There are a couple more details which you are likely to need, these are:

Number to Dial: **99*1#
Username: t-mobile
Password: pass
Modem Device: /dev/ttyUSB0

You should now be able to use your 3G mobile broadband dongle to your hearts (or your wallets) content. The dongle can send and receive text messages, and there's probably a way to do this from Linux, but I haven't delved quite that far just yet. I've also not yet tested whether the dongles ship with 'child protection' enabled by default, I know their phones do. If you find you can't access gambling sites etc. then you'll need to phone the Customer services and have it removed.