Power to the People of Iran



Hello...
..and welcome to eeeGadgets! This blog is dedicated to everything associated with the wide (and interesting) field of mobile computing. The main focus is on presenting all the various hardware modifications I made to my eeePC, but I will also give short reviews of other interesting Mobile Internet Devices I come across. Further I want to share some tips and tricks I found out to be helpful in getting the most performance out of Ubuntu linux...
On the right side under "LABELS" you can navigate between various assorted article categories. Also, on the very bottom of the site you will find some useful weblinks, as well as a small broadband connection speed test (which can be very useful sometimes).
If you want to, you can subscribe to my RSS news feed too, to be always up to date about my latest articles - simply click on "subscribe now!" in the little box on the right side. Alternatively, you can subscribe to my simple email newsletter by clicking here.
For questions, feedback, suggestions, criticism and everything else, don't hesitate to contact me:
emailfuerdennis@web.de

....have fun reading!

If you like my site and want to support me , you can always donate to my personal "coffee funds" using the PayPal "donate" button further down on the right! :)
Dennis

Thursday, April 2, 2009

HowTo: "Qualcomm 3G ICON 210" and Ubuntu

Although generally speaking I'm all pro linux and use it whereever possible - and consider it the best OS for networking encountered by me so far - I was not able to make my internal 3G modem work properly with Ubuntu yet. Of course I managed to have it load the right device drivers and I'm able to establish connections and to surf the internet - but unlike windows, ubuntu refuses to crank up the speed to HSDPA, and despite my patching (and recompiling) of the "usbserial.ko" and "sierra.ko" driver modules I was only able to get a downlink speed of 800KBit/sec at most. The same modem with WindowsXP though achieved between 2.2 and 2.8 MBit/s at the same daytime, causing me quite some frustration (I had bought the modem card because it was claimed as being fully compatible with linux, even with linux drivers supplied by manufacturer, mind you) and I started using WinXP more frequently again due to this issue. Turned out that my SierraMC8775 was rebranded as a hewlett-packard hs2300 and I had to use "hs2300" drivers for windows - but they made the card work at full speed at least! With ubuntu there was no speed but slowliness.. but luckily I found a nice workaround.
The provider I am using is o2 germany, and I've got a "pre-paid" service plan (25 euro/month for a 10GB download limit at full HSDPA speeds). This has two advantages for me: I'm able to change my service plan and/or provider as soon as a cheaper or better one is available. But I also got a nice looking "Qualcomm 3G ICON 210" surf stick for 70 euro together with the sim card, and this device is what enabled me to use HSDPA broadband internet access also when running ubuntu on my netbook. The manufacturer (qualcomm 3G) and my provider (o2) both don't offer any support for linux at all, so you're pretty much on your own if you want to make things work with linux. Which is not that bad after all, once you do manage to make it work - which I finally did. Here's the how-to:

The "ICON210" is a "2-in-1" device - modem and usb thumbdrive at once. On the usb drive part, you can find the device drivers for MacOS and WinXP along with some moderate connection software, but for linux this stuff is without use whatsoever. The first problem ist that when plugged into a USB port, the device is recognized as a usb data storage device, and in this state it doesn't respond to modem commands very well to say the least. So the first thing needed to make the umts modem work is to make use of a little tool called usb_modeswitch, which does effectively switch operating modes of plugged-in dual-function usb devices (as its name probably implies already). To make usb_modeswitch find its target device, some changes need to be made to the file "/etc/usb_modeswitch.conf", more specifically the following lines need to be added to it:

#-----------------------
# Option iCON 210
#
#
# Contributor: wahlm
#
DefaultVendor= 0x1e0e
DefaultProduct= 0xf000

TargetVendor= 0x1e0e
TargetProduct= 0x9000
TargetClass= 0xff

MessageEndpoint=0x1
MessageContent="55534243689d528100000000000006bd000000020000000000000000000000"

ResponseEndpoint=0x1
#------------------------------


this causes a simple call of "usb_modeswitch" without additional parameters to turn the data storage device into the modem.. first problem solved. Now the second one is that there is no specific driver for the Icon210 included with ubuntu as of yet, so we need to use the generic "usbserial" instead. Everything of the above is accomplished by issueing two simple commands as follows:

sudo usb_modeswitch

sudo modprobe usbserial vendor=0x1e0e product=0x9000

Normally this should result in the creation of three device nodes named "/dev/ttyUSB0-2", but strangely this is not the case when the driver module is loaded the first time. To have the driver module create those device nodes, "usbserial" must be unloaded and then reloaded a second time (I have no explanation to this puzzling behaviour but have tested it and it is mandatory for some reason, and I've got absolutely now idea how to fix this). So if the command

sudo modprobe -r usbserial && sleep 1 && sudo modprobe usbserial vendor=0x1e0e product=0x9000

is issued to reload the module "usbserial.ko", the device nodes are created as it should be, and it it possible to dial up and establish connection to the ISP, for example with pppd and the following two scripts "gsm_chat" and "o2-umts" I use (both stored in /etc/ppp/peers):

"/etc/ppp/peers/o2-umts"
-detach
/dev/ttyUSB2
9600
defaultroute
usepeerdns
mtu 1492

noauth

crtscts
lock
# novj
# nobsdcomp
nodeflate
# nopcomp

connect '/usr/sbin/chat -v -t6 -f /etc/ppp/peers/gsm_chat'



"/etc/ppp/peers/gsm_chat"
ABORT 'NO DIAL TONE' ABORT 'NO ANSWER' ABORT 'NO CARRIER' ABORT DELAYED

SAY 'Initializing modem:\n'
'' AT
OK ATZ
OK \c
SAY 'OK\n'

SAY "Checking PIN:\n"
'' AT+CPIN?
"+CPIN: READY" \c
SAY "OK\n"

SAY 'Setting APN:\n'
'' AT+CGDCONT=1,"IP","surfo2"
OK \c
SAY "OK\n"

SAY 'Dialing...\n'
OK ATD*99#
CONNECT \c
SAY "Connected.\n"

When those above scripts are called with the following command

sudo pon o2-umts


the connection is established and I have the joy of full downlink speed. Downside, now I have that external modem dangling from my USB port, although I have a built-in one. Maybe they'll fix the sierra driver module somehow in the upcoming ubuntu versions. I keep my fingers crossed for Ubuntu 9.04 "jaunty jackalope" and think I will re-evaluate the whole HSDPA and linux situation as soon as jaunty is relased in final. But at least I'm not stuck with having to use windows anymore, which for sure is great news for me!


UPDATE
As it turns out, the loading of the usbserial.ko driver module does not strictly need to be issued twice at all (contrary to what I stated above), and the underlying problem seems to be a timing one. Because with the following changes to my "etc/rc.local" I now am able to have it dial in all by itself by merely connecting the iCON210 stick to my netbook, then booting up Ubuntu. These are the lines that need to be added to "rc.local" to make ubuntu dial up automatically at system start
(note the "sleep 1" commands - they are mandatory at least on my system) :

sudo usb_modeswitch && sleep 1

sudo modprobe usbserial vendor=0x1e0e product=0x9000 && sleep 1

sudo pon o2-umts



(side note, all of the above doesn't help if you happen to relocate to a new apartment and suddenly are faced with no UMTS coverage at all at your new living place. Like I do currently. Now I'm considering external antennae, and maybe modding an appropriate connector to my eeePC... At least the new apartment is a nice one, missing UMTS coverage aside)

2 comments:

Teslas_codpiece said...

9.04 is excellent for HSDPA support. Strictly speaking I think it might be the new NetworkManager, but there's a wizard included that will automate setup for most adapters.

Markus said...

Thanks for this useful post. On Ubuntu 9.10 the steps were the following: http://www.equilaris.at/blog/2010/01/13/icon-210-in-ubuntu-9-10/


Broadband Connection Test:

Just click on "Speedtest starten" to evaluate your actual downlink in MBit/sec (takes 10 seconds approx.)


(c) dsl-speed-messung.de - DSL Speed Test