Using the ZTE MF626 on Ubuntu and T-Mobile
The ZTE MF626 is a 3G modem stick resold by T-Mobile in the UK. They call it the “USB stick 120”; other networks likely call it something different. Rumour had it that it ought to work under Ubuntu; Google brought me to http://ubuntuforums.org/showthread.php?t=1147685 which contains some useful info for Jaunty (9.04) but turns out to be a bit out of date with regard to Karmic (9.10).
The USB ZeroCD oddity
The MF626 is not your average USB device. It’s one of a growing trend of ZeroCD devices: when you plug them in, they report themselves as being of type USB mass storage (in this case, 19d2:2000 - check it with lsusb), with an autorun.inf which installs the drivers and other paraphernalia. When you have the driver, it issues a magic command to the device, which causes it to magically change its USB product ID to that of the real modem device (in this case, 19d2:0031).
ZeroCD on Ubuntu
It used to be the case that you had to install a program called usb_modeswitch which sent the magic command to the device. (It’s in the Ubuntu archive.) Unfortunately, this didn’t work reliably for me; on one machine, I eventually had it working most of the time, but there was no such luck on my laptop.
Almost by accident, I tripped over some steps which seem to work every time:
- Insert the USB stick
- Watch /var/log/messages to get the device node for the SCSI CDROM it thinks you just inserted (sr1 usually). This takes a few seconds to come in as the device boots up and udev figures out what it appears to be.
- sudo eject /dev/sr1
- Wait a few more seconds - watch messages if you like - then run lsusb to confirm the device is now 19d2:0031.
Geeky side note: Once you have successfully mode-switched, the device appears as three ttyUSB devices. You can fire up minicom at this point on at least two of the three - 115200 8N1 with hardware flow control works - and send it AT commands :-)
Obsolete usb_modeswitch notes:
- The package in karmic comes with /etc/udev/rules.d/usb_modeswitch.rules which have the ZTE MF620 enabled by default. You'll have to edit it and comment out that stanza; I did try the stanza for the MF626 but couldn't get it to work at all.
- Editing /etc/usb_modeswitch.conf to uncomment the relevant lines for the ZTE MF626 allowed it to work from the command line (sudo usb_modeswitch [-W]) - most of the time, on one machine, but not at all on the other. I found I did need to be patient and wait several seconds between insertion of the device and invoking the program; this might be what stops the udev rule from working.
- USB modeswitch home page
Reportedly the NetworkManager is a bit flakey with USB modems in jaunty, but I had no problem in karmic.
- Ensure modemmanager is installed.
- Create the file /usr/share/hal/fdi/information/20thirdparty/20-zte-mf626.fdi as described at step 10 of http://ubuntuforums.org/showthread.php?t=1147685.
- (Remove and re)insert the device and “eject” it as described above
- Be sure to wait for the modem device to settle down. I found this can take up to 15 seconds from issuing the eject.
- Click on the NetworkManager icon in the menubar. If the device has been recognised, you will see menu items for Mobile Broadband, and the option to create a new connection. (If not, wait a few more seconds and try again.)
- The wizard asks you pertinent questions; thankfully, under T-Mobile there is only the one price plan and no need to enter a username or password. You should now be ready to dial up.
Once the connection is set up, the steps boil down to:
- Insert stick;
- wait a bit;
- “eject” it;
- wait a bit;
- select the connection name from the NetworkManager drop-down list;
- wait until NetworkManager tells you you’re connected, and a couple more seconds for resolv.conf to be updated (also see below).
Alternatives to NetworkManager
Anecdotally from the forums, wvdial is said to be more reliable than NetworkManager. There are also some people in the Ubuntu world who refuse to use NetworkManager, preferring to do things the old way; for them, wvdial is obviously the way. (I used to be one such person. I have to say, it has been ten years since I last used wvdial, and I found it rock solid back then, so if I had had problems with NetworkManager then wvdial would be my next port of call.)
I haven’t tried it myself, but the ubuntu forums link above does mention wvdial as a viable alternative. The device appears to present itself as an AT-compatible modem; NetworkManager seems to have it dial
Getting online with T-Mobile
I’ve found that, once in a while (and in fact the very first time I connected), NetworkManager doesn’t manage to set up /etc/resolv.conf correctly when it connects.
At the time of writing, T-Mobile’s nameservers for mobile broadband users are 188.8.131.52 and 184.108.40.206. I also noted that 220.127.116.11 (Google’s public DNS service) also worked just fine.
If this turns out to happen frequently, NetworkManager does let you set the connection to be PPP “addresses only” with manually-specified nameservers.
Escaping the PAYG walled garden (registering a payment card)
My USB stick is on a pay-as-you-go account. This means that when you first dial up, www requests are redirected to the T-Zones site. (You can also access t-mobile.co.uk, but that seems to be about the limit.) You have to use T-Zones to select how many days usage you want to pay for; naturally, the week and month bundles work out better if you’re going to use them.
So far so good. Unfortunately, the initial credit on the account had expired so I needed to top-up. I wanted to top-up online as this was much more convenient than finding my nearest top-up retailer or ATM. To do this, you have to first register yourself with T-Mobile and register the device with your account; then you can add a payment card and make a top-up.
The fun came in registering the device to my online account: you enter the device phone number and it sends you an SMS with a 4-digit confirmation “PIN”. Right. Yes. This is a lighthouse USB stick, and I don’t have SMS software installed. (Aside: Hello? surely you can tell that I’m connected from a tmo line and skip that step?)
Side note: A package called wader exists and claims to be a more fully featured mobile broadband connection manager, doing SMS as well, though it conflicts with the modemmanager package; I haven’t tried it.
There was nothing else for it; I reluctantly booted into Windows and let the device install its own driver. The connection manager it installs is functional, if obviously cheaply developed, and allows you to receive SMSes. Great. But the SMS containing the code was apparently lost into the ether, and the T-Mobile site wouldn’t resend it … Thankfully, I was able to work around this by removing the device from my online account and re-adding it. At last, I was able to register a payment card, put some credit on the account and actually spend my £2 to get online!
Once you have selected a package and debited your PAYG account appropriately, it seems you can disconnect and reconnect as many times as you like during the connection period you’ve paid for and not be troubled by the walled garden. Nevertheless you can go back to www.t-zones.co.uk at any time to see your remaining credit.
By accident, I happened to trip over ContentLock. This is T-Mobile’s attempt to do their bit to prevent children from accessing content deemed unsuitable, including “social networking sites” and sites with “user-generated content”, which includes Flickr, that dangerous bastion of … er … something. You’ll know if you hit ContentLock, because you get redirected to a message which tells you that access is blocked and purports to tell you how you switch it off. Unfortunately, actually switching it off took some doing…
(If the next few paragraphs are tl;dr, you essentially have two options: to take proof of ID into a T-Mobile store, or to put the SIM into a regular mobile, dial 1818 and provide credit card details.)
- The you-are-blocked message offers to allow you to remove the lock on the spot, if you have a credit card to "prove" you're 18: they propose to charge and immediately refund £2. Unfortunately, this didn't work; the site took my card details then claimed to be unable to determine what phone number I was accessing it from, which didn't exactly leave me brimming with confidence.
- (Err, hello? Have these people never heard of authorised user cards?)
- Side note: The ContentLock portion of their infrastructure is obviously a quickly-written afterthought - it's plain HTML with no CSS.
- Apparently - going on ContentLock's say-so - I could switch off the lock via my T-Mobile account. So I went there and it wanted me to select my "phone" model before it could show me the options... but USB sticks were not in the list! To summarise my googling, this doesn't seem to work for PAYG accounts. Sigh.
- Next, I tried ringing T-Mobile customer services. (The number is 150 from T-Mobile, or 07953966150 from other networks.) The call centre operator asked the number I was calling about, then apologetically said she couldn't access PAYG accounts and put me through to the PAYG people. The PAYG "people" turned out to be an automated menu system. There is an option for ContentLock... but it only provides information and tells you to ring 1818.
- I tried ringing 1818 from my mobile, but (surprise surprise) that system only works if you're calling from the line you want to en/disable it for. How are you expected to dial 1818 from a USB stick?!
- I noted at this point that I could take proof of ID to a T-Mobile store in person, but I didn't want the hassle of going into town.
- On a whim, I removed the SIM card from the USB stick and put it into my mobile. It powered up and connected to the network happily; I dialled 1818; keyed in my credit card details and voilà, after a delay, the voice told me it had removed ContentLock from the line. Sure enough, on popping the SIM back into the stick, I could access Flickr.
Conclusion: ContentLock is a hastily-developed addition to their network, probably added to pay lip service to some regulatory requirements, to legal due diligence or to “think-of-the-children” pressure. It seems to go a bit far with the sites it blocks, but was at least relatively straightforward to switch off.
- Be able to receive SMSes under Linux. This is important in case you get close to your fair-use quota / data cap / whatever your telco calls it. (Sending would be nice but is optional for me as I have a regular mobile, and T-Mobile users can also send texts via their website.) There might be some mileage in gnome-phone-manager.