Thursday, January 23, 2014

[OpenWRT] Configure ZTE MF193E (Teletalk) to autoconnect on TP-Link MR3420 V2.0

WARNING: Anything you might do to your router / modem / computer, I can not be held responsible. This is just for referencial and educational purposes. This involves modifying certain core features of both the devices and they might not behave as you please afterwards.

As you might know, the new in thing is to buy a router and then, flash an after market firmware. And the very first one in line is OpenWRT.

Currently TL-MR3420 (here on referred to as the Router) has only snapshot / trunk build available of OpenWRT. You can get the V2 firmware here [ http://downloads.openwrt.org/snapshots/trunk/ar71xx/openwrt-ar71xx-generic-tl-mr3420-v2-squashfs-factory.bin ]. This is pre built one.

Flash using the normal process of "Firmware Upgrade". You'll lose WiFi communication. So, connect with a LAN cable that goes from your Laptop / PC to the routers LAN (not the blue WAN port) ports. Type in 192.168.1.1 and you got your OpenWRT running.
Set it up, secure the WiFi and Admin panel first. Look at the myriads of options you have now.

Now, for the modem. Well, this would not be an issue at all if the modem did not have a CD-Mode on it. The main problem in connecting is the CD-Mode. And this particular version of OpenWRT works pretty well at handling things as it has all the various packages needed, pre installed (hence leaves very little on your router, might consider expanding storage with an SD card?)

We have different choices to circumvent the issue
* USB Modeswitch
* Sdparm

Both have worked for me. It's your choice which one you want to apply.
First things first, detect and check if your device has come up on the system.
Log into your Wifi. Then open up a terminal (ubuntu will do) and type
ssh root@192.168.1.1
If you get issues with invalid ssh key just execute the command the message shows.
Type in your password and you'll be in the router (Trinity hack huh?)
Now type
dmesg | grep ZTE
It should show your Modem with a CD-ROM beside it.
Now, you need to know your vendor and product ID. Fortunately if you are using mine it is Vendor: 19d2 and Product: 1232. To find it yourself, type
cat /sys/kernel/debug/usb/devices
and look for your modem's name. Around it, somewhere you'll see Vendor and ProdID. Make a note of them.
Before we move on to switching the mode First one, USB Modeswitch
Basically you have to move the modem from 19d2:1232 to 19d2:2003. For that you can use
usb_modeswitch -c /etc/usb_modeswitch.d/19d2\:1013 -v 19d2 -p 1232
Or you can disable the CD-ROM mode using either 60-usb-rules or some init.d / rc.d hack or simply using the AT commands
AT+ZCDRUN=8 disable
AT+ZCDRUN=9 enable
How to use the AT commands? Do this
echo "<at command here>" >/dev/ttyUSB1
And then, go to Interfaces > 3G > Edit and choose /dev/ttyUSB3
Use APN as "wap" Protocol as "UMTS/GPRS/EV0" and Sevice type as "UMTS/GPRS" and Save it.

And to mount SD card and increase your storage first check if you have proper fs modules. My card couldn't take beyond ext2 so I used ext2 for fs. That part was confusing a bit at first since the version does not have warnings at all :P
Hope it comes handy :)
If you'd like to post about some of your own approaches I'd be happy to add them here :)
Just mail me if you have any or comment below.

Credits due:
1. http://www.semanticlab.net/index.php/UMTS_with_OpenWRT
2. http://askubuntu.com/questions/31477/use-a-newer-zte-modem-with-usb-modeswitch
3. http://forum.xda-developers.com/showthread.php?t=1735553

Connect Rapoo MT750S with Linux (Tested on Manjaro)

 I bought this obvious copy of MX Master 2S in hopes of having the device switching functionality along with a lightweight body because I ha...