My Departement Of Nerdcore Enthusiasm

Tutorials and the like. Things which I have committed myself to. Often linux/UNIX-related.

onsdag den 11. juli 2012

To make 3g USB modem work on Android

++++++++++++
The Liberty Tab journey -reports from my process towards making a 10.1 inch tablet computer become my primary computer.
The product i use for this is a Packard Bell Liberty Tab G100. Please note that:
Packard Bell Liberty Tab G100
and
Acer Iconia A500 TAB
are identical products and that i will use the two product names synonymous.
++++++++++++

To make 3g USB modem (mobile broardband) work

Packard Bell Liberty Tab G100 comes with build in WI-FI but not with built in 3g modem (SIM Card) function. I wanted to use my 3g USB dongle modem (mobile broadband) to go on the internet. My 3G modem is a Huawei E1750.
The mobile broadband solution I have used for some years now in Linux as my everyday internet connection. I have several time spent some time to get it to the work under various Linuxes. Huawei E1750 and indeed all the various Huawei 3G modem are made in such a manner that they themselves have the drivers for eg Windows on board. The way it works is that when you first put the modem in the Windows computer the modem reports to the system as a CD-ROM containing the installation program. After installation is complete the installed software sends a signal to the modem that it must now change from being a CD-ROM to be a Modem. It is this shift operation which is causing some problems under Linux, and therefore also under Android (Android is Linux based). A German guy named Draisberghof has developed a Linux tool for this switching operation. This tool is called USB_modeswitch. All Android tablet computer that I know of are driven by a process type called ARM. Draisberghof have compiles a version of usb_modeswitch for the ARM processor.
. And he has compiled it STATIC. That is, he has compiled a version of usb_modeswitch that can run without any further dependencies on most android devices, smart phones, tablets, etc. Will need this version of usb_modeswitch for making the 3g modem work on our Android tablet. It can be downloaded from here.

http://www.draisberghof.de/usb_modeswitch/#download

Look for the text
"Upon a recent request I Provide a static binary for ARM: usb_modeswitch-1.1.9-arm static.bz2."
Under the Download headings on the page and download it.

I'll have to say now that before you can even do the following, you must first have installed a costume ROM on your device. The stuck ROM (also called firmwire) that ships with the Packard Bell Liberty Tab G100 does not support 3G USB modem. It does in fact not support USB devices at all. I will talk about the process of installing costume ROM in another post. For this post we'll assume you have already installed a costume ROM that supports 3G modem and that your tablet is rooted witch it will propel be if you have installed a costume ROM.

You need an android terminal for the next step. I have been very happy about a terminal called ConnectBot It's free (Android marked). But otherwise you can just use Terminal Emulator also from Android marked.

OK let's say you have downloaded usb_modeswitch-1.1.9-arm-static.bz2 to your PC. A easy way to get it on your tablet could be pulling the mini-sd-card out of the tablet. Putting it in a card reader on your PC. Add usb_modeswitch-1.1.9-arm-static.bz2 onto the card and put the card back into the tablet computer. So you need a good file manager. Astro (app) is good. (Total commandor app is even better). With your file manager find usb_modeswitch-1.1.9-arm-static.bz2 on external_sd. If you click and hold usb_modeswitch-1.1.9-arm.static.bz2 in Astro you can unpacks the bz2 archives and so you'll get the pure binary file usb_modeswitch-1.1.9-arm-static. usb_modeswitch-1.1.9-arm-static should now be maneuvered into a specific directory on your tablet PC for

/data/local

You can do this by opening your terminal

and then:

su

to become root

cd /data/local

and

cp /mnt/external_sd/usb_modeswitch-1.1.9-arm-static .

now you just make sure that usb_modeswitch-1.1.9-arm-static is executable

chmod 0755 usb_modeswitch-1.1.9-arm-static

Now you're actually ready to initiate your modem by giving a very long command to usb_modeswitch-1.1.9-arm-static. This command is so vast that it must be in a script if you want to use it many times and you must if you use this method.

You must therefore have made a small shell script which shall also be
/data/local/
The shell it self is nothing but a plain text file with a few lines of text in. The text lines are here.

--------------------------------------
#!/bin/sh
/data/local/usb_modeswitch-1.1.9-arm-static -v 0x12d1 -p 0x1446 -V 0x12d1 -P 0x1001 -s 20 -M "5553
4243000000000000000000000011060000000000000000000000000000"
--------------------------------------

How you'll make this small text file and gets it into
/data/local
I will leave it up to you for now. But when you have done it you must also make sure that it is executable

chmod 0755 mymodeswitch # or whatever name you gave your little script

You can now put your modem into the USB port on your tablet computer and then run your script

by typing
/data/local/mymodeswitch
in your terminal.
You can see what usb_modeswitch-1.1.9-arm-static "answer". If it finds a modem and it succeed with the switch operation it will answer that it succeeded.

If you have another Huawei modem than E1750 it may be you need another mode line. The mode line is the long number line that you can see the script text above.

Try to search google with your Huawei your-model usb_modeswitch

I had to even adjust some of the values to get to the values that i use here. Her the tool:

lsusb

Is a good help. Just tupe "lsusb" in the terminal and see what it says.

If you manage to switch your modem, you must have it set up in your Android system settings
as well.
Go to settings turn of WI-FI. Find the settings for mobile broadband. Enter or choose two pieces of information. Your access point and your network. It is in my case:

network: Telia
accespoint: websp

After that it worked for me.

Every time I turn on the tablet computer and wants to use internet will I open a terminal and execute my modem initiation script

su
/data/local/mymodeswitch

So it takes a few minutes when the modem initialize and connect and after this I'm ready to go on facebook and email and surf the Internet.