Airtel 4G LTE on Linux
I recently purchased airtel 4G internet for its reasonable cost and high speed. You get a constant download speed of 10 Mbps here in b'lor. My problem with this usb device was I couldn’t get this working on linux! Yes, they did provide software setup for windows/linux, all those were x86 based. I have this ARM chromebook and who will provide that piece of software with connect and disconnect button!
The modem is basically from ZTE, ZTE MF825A. The documentation provided by zte is (in)dispensable for the fact that this product is not listed anywhere in their website. If you provide a good looking GUI with connect/disconnect button and not say how it works, how can it satisfy a linux guy
Ok. So this is what happens. When you connect the device it is detected as usb storage device. Then udev kicks in and mode switches it to 1408 from 1225. cdc_ether module picks up this device and creates an ethernet connection. Check the below dmesg log
[ 104.025283] usb 2-1: new high-speed USB device number 4 using s5p-ehci
[ 104.183421] usb 2-1: New USB device found, idVendor=19d2, idProduct=1225
[ 104.183498] usb 2-1: New USB device strings: Mfr=2, Product=3, SerialNumber=4
[ 104.183562] usb 2-1: Product: ZTE WCDMA Technologies MSM
[ 104.183616] usb 2-1: Manufacturer: ZTE,Incorporated
[ 104.183667] usb 2-1: SerialNumber: MF8250ZTED000000
[ 104.327876] usbcore: registered new interface driver libusual
[ 104.380155] Initializing USB Mass Storage driver…
[ 104.383780] scsi0 : usb-storage 2-1:1.0
[ 104.388458] usbcore: registered new interface driver usb-storage
[ 104.388518] USB Mass Storage support registered.
[ 105.395342] scsi 0:0:0:0: CD-ROM CWID USB SCSI CD-ROM 2.31 PQ: 0 ANSI: 2
[ 105.407270] scsi 0:0:0:1: Direct-Access ZTE MMC Storage 2.31 PQ: 0 ANSI: 2
[ 105.463160] sd 0:0:0:1: [sda] Attached SCSI removable disk
[ 105.553641] sr0: scsi-1 drive
[ 105.553668] cdrom: Uniform CD-ROM driver Revision: 3.20
[ 105.554806] sr 0:0:0:0: Attached scsi CD-ROM sr0
[ 110.415922] usb 2-1: USB disconnect, device number 4
[ 110.790178] usb 2-1: new high-speed USB device number 5 using s5p-ehci
[ 110.948539] usb 2-1: New USB device found, idVendor=19d2, idProduct=1408
[ 110.948614] usb 2-1: New USB device strings: Mfr=2, Product=3, SerialNumber=4
[ 110.948677] usb 2-1: Product: ZTE WCDMA Technologies MSM
[ 110.948730] usb 2-1: Manufacturer: ZTE,Incorporated
[ 110.948780] usb 2-1: SerialNumber: MF8250ZTED000000
[ 110.976822] scsi1 : usb-storage 2-1:1.2
[ 111.139335] cdc_ether 2-1:1.0: eth0: register ‘cdc_ether’ at usb-s5p-ehci-1, CDC Ethernet Device, 34:4b:50:b6:ab:3c
[ 111.141926] usbcore: registered new interface driver cdc_ether
and ifconfig
eth0 Link encap:Ethernet HWaddr 34:4b:50:b6:ab:3c
inet addr:192.168.0.144 Bcast:192.168.0.255 Mask:255.255.255.0
………………………………………………………………..
Although an internal ip is assigned, there is no internet at this point. What surprised me was how can usb modem get an ethernet connection? how? I went to linux, ubuntu forums, no help! I assumed that kernel wrongly detected this device. I forced QMI module to load driver for this device by editing the kernel. Although it loaded the qmi driver, /dev/cdc-wdm0 was not usable. Finally I contacted Bjorn(author of qmi-wwan.c in linux tree). After looking at the logs, he told that this device is probably not a qmi device. He asked me to check with cdc_ether connection and open gateway ip(192.168.0.1) in the browser. “Page not found”!
My last resort was to go to a linux x86 m/c and trace what that connect/disconnect 'GUI’ was doing using wireshark. Take it. So simple. Connect button called http://192.168.0.1/goform/goform_set_cmd_process using post method with goformId=“CONNECT_NETWORK” as parameter. Thats all and you are connected to internet. Here is a small html snippet that imitates the GUI
<form action = "http://192.168.0.1/goform/goform_set_cmd_process" method = "post">
<input type="checkbox" name="goformId" value="CONNECT_NETWORK" checked style="display:none;">
<BUTTON name="submit" type="submit"> Connect </BUTTON>
</form><form action = "http://192.168.0.1/goform/goform_set_cmd_process" method = "post">
<input type="checkbox" name="goformId" value="DISCONNECT_NETWORK" checked style="display:none;">
<BUTTON name="submit" type="submit"> Disconnect </BUTTON>
</form>
The green led blinks after connecting to internet
Above html snippet can be downloaded from https://drive.google.com/file/d/0ByAtbw9O9wYyc2JCbzVwa2RZNTQ/edit?usp=sharing
Update 1:
Good news. This method works on android too. I just received my new Moto G and it works
First turn off edge/hspa/wifi, or in simple terms no ip is assigned to the system. Connect the dongle to phone using an OTG cable. Wait for sometime until red led turns green. This means kernel has detected the device. Goto settings->About->Status and check ip address. If 192.168.0.144/192.168.0.145 ip is assined you are good to go. Restart once if you don’t get the ip.
Download above html page and open it in chrome (default html viewer doesn’t work) file:///sdcard/path/to/html/file and connect
4G internet on a 3G phone :)