3G USB Stick on Ubuntu

I am in London for work, and my hotel wants me to pay £ 17 per day for accessing internet. But I found an internet café which is offering Internet connection on a 3G USB stick for £ 19.99 per week ( reload.com 197 Praed Street, Paddington ). The USB stick is from Three, like the one that can be found here.
When you plug it in, Linux will mount a storage device which contains the drivers for OSX/Windows/Linux. The ones for Linux, of course, do not work: there are some files (zte drivers) precompiled for some version of Fedora, and other stuff which doesn't compile on Ubuntu.
The good news is that you don't need any driver in Linux; just some hacking. The kernel of Ubuntu is built with support of the most common 3G drivers.

Below I explain how to make it work.

Disable the USB storage

When the USB stick is behaving as USB storage it won't work as 3G modem. The first thing to do is to disable that.

Locate the device assigned to the USB stick:

luigi@hal9000:~$ df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda3            199024992 113153688  75761392  60% /
udev                   2018164       296   2017868   1% /dev
none                   2018164       340   2017824   1% /dev/shm
none                   2018164       324   2017840   1% /var/run
none                   2018164         0   2018164   0% /var/lock
none                   2018164         0   2018164   0% /lib/init/rw
/dev/sr1                 26330     26330         0 100% /media/3Connect        

The 3Connect one is the USB stick, so let's unmount it, to be able - later - to unload the usb_storage kernel module.

luigi@hal9000:~$ sudo eject /dev/sr1
[sudo] password for luigi: ***** 

now let's unload the usb_storage kernel module.

luigi@hal9000:~$ lsmod | grep usb_storage
usb_storage            66016  0 
luigi@hal9000:~$ sudo rmmod usb_storage
luigi@hal9000:~$ lsmod | grep usb_storage

The first command (lsmod) checks that usb_storage is loaded, and see if there are other modules depending on it. There aren't, so we can remove the module (rmmod command). Last command (lsmod) is to verify that the module is successfully unloaded; if it doesn't display anything means that the usb_storage module is gone, so it's ok!

Load the usbserial kernel module

Now we can load the usbserial kernel module and we can associate that to the USB stick.

First of all, let's check how the module is loaded:

luigi@hal9000:~$ lsmod | grep usbserial
usbserial              43248  1 option

We see that there's the "option" module depending on the usbserial, so we need to first unload option then usbserial.
Let's do that with rmmod command.

luigi@hal9000:~$ sudo rmmod option usbserial
luigi@hal9000:~$ lsmod | grep usbserial

The lsmod at the end is just to ensure that usbserial is successfully unloaded. This time it should not display anything.

Now we need to know the manufacturer id and the product id of the usb device. Let's do that with lsusb command:

luigi@hal9000:~$ lsusb
Bus 004 Device 003: ID 05ac:8213 Apple, Inc. 
Bus 004 Device 002: ID 0a5c:4500 Broadcom Corp. 
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 05ac:8507 Apple, Inc. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 003: ID 05ac:0237 Apple, Inc. 
Bus 003 Device 002: ID 05ac:8242 Apple, Inc. 
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 006: ID 19d2:0031 ONDA Communication S.p.A. 
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Our device is the 19d2:0031 ONDA Communication S.p.A. I found that after some tries, pluggin and unplugging the USB stick and checking the differences printed by lsmod. Notice that if the usb_storage module is active the product id will be different, while the manufacturer id will be the same. The output of lsmod is not very informative and helping to understand the nature of the usb device, unfortunately.

Now we can load the usbserial device specifying the vendor id and product id of the USB stick.

luigi@hal9000:~$ sudo modprobe usbserial vendor=0x19d2 product=0x0031

If there are no error displayed, and the command ends silently, then it means that the module is loaded successfully.

Configuring the 3G connection

Clicking on the NetworkManager we should now be able to see the New Mobile BroadBand (GSM) Connection:
new-mobile-broadband.png

Click on it to configure. It will result in a Wizard dialog that will ask you information to "Set up a Mobile Broadband Connection". In my case I filled following information:
Country: I selected "Britain (UK)" ... I took some time to find it: I was looking for "UK" or "United Kingdom" or "England" or some other name...
Select your provider form a list: 3
Select your plan: Internet
Confirm.

After that, the connection is ready and you should be able to browse the internet. Clicking on the NetworkManager tray icon you'll see that you are now connected through it:
3-internet.png

Improving the connection reliability

The connection is quite bad through the 3 network. Sometime you keep being connected but internet stops working. I thought to DNS problem so I set up OpenDNS following these instructions, and now it seems more reliable and usable, but still sometime the connection stops working, and you need to unplug the stick and restart from with the procedure described above.
I don't know why... if somebody knows, please leave a comment.

I'd like to buy a 3G USB Stick or 3G modem; if somebody have some hints on a good supported device, and stable, (easier to set up), please leave a comment.


One Response to “3G USB Stick on Ubuntu”  

  1. 1 Bryn

    Thanks, this was just what I needed! I’m headed to London tomorrow and was wondering what my options would be.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>



Calendar

January 2010
M T W T F S S
« Dec   Apr »
 123
45678910
11121314151617
18192021222324
25262728293031

Follow me

twitter flickr LinkedIn feed

Subscribe by email

Enter your email address:

Archives


Categories

Tag Cloud


Listening