Installing the O2 surfstick on Gentoo Linux

Daniel Bernhardt

Creative Commons Attribution-Noncommercial-Share Alike 3.0 Germany License

Abstract

This manual explains how to setup the O2 surfstick identified as Huawei Technologies Co., Ltd. E220 HSDPA Modem on Gentoo Linux using native Linux tools and drivers. As this manual is not very Gentoo specific it is easily applied to other Linux distributions.


Revision History
Revision 1.02009-08-27Daniel Bernhardt
initial manual release
Revision 1.12009-08-29Daniel Bernhardt
kppp added
Revision 1.22009-09-24Daniel Bernhardt
modified wvdial.conf to start ppp immediately

Introduction

This manual was written using Gentoo Linux running the 2.6.28 Linux kernel. I can't guarantee everything described here works with an older kernel. If you can't or won't upgrade to a kernel newer than 2.6.28 you may experience some difficulties.

If you have any comments or questions contact me at .

Kernel Configuration

You may need to adjust your kernel configuration. To use the O2 surfstick the following kernel modules must be installed. You may choose to install them as modules or to build them right into the kernel.

If you don't know how to configure and compile a new kernel you're probably not using Gentoo Linux and should read the manual that comes with your Linux Distributaion on how to modify your kernel. If you're using Ubuntu or a distribution of its kind you may skip this part as everything should be compiled in as a module already.

Example 1. O2 surfstick kernel configuration

Only relevant sections are mentioned here.

Device Drivers  --->
	[*] Network device support  --->
		<*>   PPP (point-to-point protocol) support
		 [*]     PPP filtering
		<*>     PPP support for async serial ports
		<*>     PPP support for sync tty ports
		<*>     PPP Deflate compression 
		<*>     PPP BSD-Compress compression
	[*] USB support  --->
		<M>   USB Serial Converter support  --->
			<M>   USB driver for GSM and CDMA modems
			

Now compile your kernel and reboot your system.

Software

After you plugged in the O2 surfstick you have to wait a few seconds before it comes available. The dmesg command should give you an output containing something similar to the following:

option 1-5:1.0: GSM modem (1-port) converter detected
usb 1-5: link qh2-0001/f70ca300 start 1 [2/0 us]                                                                                              
usb 1-5: GSM modem (1-port) converter now attached to ttyUSB0                                                                                 
usb 1-5: adding 1-5:1.1 (config #1, interface 1)
[...]
option 1-5:1.1: GSM modem (1-port) converter detected
usb 1-5: GSM modem (1-port) converter now attached to ttyUSB1                                                                                 
usb 1-5: adding 1-5:1.2 (config #1, interface 2)                                                                                              
usb 1-5:1.2: uevent		
			

If you don't see this output you may have to check your kernel configuration and try again. A green LED is flashing if the surfstick is ready for the next steps.

Before you can make a connection as described in the next sections you have to shut down any active network connections. An ifconfig ethX down should do it just fine.

Important

All steps below require the user to be in the following user groups: uucp, dialout.

umtsmon

Warning

I could not get the O2 surfstick to work with umtsmon. However there are reports other users are using umtsmon just fine.

As stated above I tried using umtsmon-0.9 but didn't succeed. Rumors O2 is offering its own version of umtsmon can't be confirmed.

If you get the O2 surfstick to work with umtsmon please send me an email to .

wvdial

The O2 surfstick works with wvdial. wvdial is stable in portage and easily installed with emerge wvdial.

After installation you should create the wvdial configuration file /etc/wvdial.conf containing the following input:

Example 2. /etc/wvdial.conf

Don't forget to adjust the Init3 line in the pin section. Replace 1234 with your PIN.

			
[Dialer o2]
Modem = /dev/ttyUSB0
Baud = 460800
Init2 = ATZ
Init3 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ISDN = 0
Modem Type = Analog Modem
Username=surfo2
Password=surfo2
Phone=*99#
Carrier Check = No
Stupid Mode = 1

[Dialer pin]
Modem = /dev/ttyUSB0
Init3 = AT+CPIN=1234

			

Note

It should be possible to set your PIN code using the command echo "AT+CPIN=1234" > /dev/ttyUSB0. Unfortunately this didn't work for me. That is why you have the pin section in /etc/wvdial.conf.

Before you can connect with O2 you need to set your PIN. This is done by running the command wvdial pin. You may see some warning messages about missing phone number and the like. You can savely ignore those messages. The important part should look like this.

--> Sending: ATZ
ATZ
OK
--> Sending: AT+CPIN=1234
AT+CPIN=1234
OK
			

This means your PIN is set and the surfstick LED (mostly the blue one) should be flashing.

Now it's time to connect with O2. The command wvdial o2 will connect you. The output should look like the following listing.


--> Sending: ATZ
ATZ
OK
--> Sending: ATZ
ATZ
OK
--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
OK
--> Modem initialized.
--> Sending: ATDT*99#
--> Waiting for carrier.
ATDT*99#
CONNECT
--> Carrier detected.  Starting PPP immediately.
--> Starting pppd at Thu Aug 27 17:39:03 2009
--> Pid of pppd: 9269
--> Using interface ppp0

			

You are now connected. CTRL+C will disconnect you gracefully.

kppp

If you want a fancy GUI to set up your Internet connection you can use kppp. We use the settings from the wvdial configuration file wvdial.conf above.

Remember

You have to make sure no other network connections are active. Running kppp as a user doesn't let you disable any connections automatically. Take care of this yourself.

To connect to O2 username and password must be set to surfo2.

Adjust the Phone number and Authentication values as seen in the screenshot.

It is assumed you set up wvdial before to send your PIN to the surfstick. Before connecting to O2 the PIN has to be set. An easy way to do this, is to call wvdial pin before connecting.

The device settings.

Modify the Initialisation Strings as seen in the picture. This is important! You can copy/paste it from wvdial.conf.

Statistics

After you connected you can get some statistics of your connection using the command pppstats.