# [solved] HUAWEI E220 with wvdial doesnt work

## nickel

Hi everyone!

Happy new year!

I have a Problem:

My friend bought an USB Stick from German Provider Prosieben (actually vodafone web sessions).

I want to test it. I do not have windows. In my system (kernel 2.6.34) doesnt work networkmanager. I dont know why, but i used scripts (net.*) to connect to lan or wlan.

I cant get the stick working on gentoo.

The Stick is, in my opinion, reconigzed correctly. So, i didnt do anything.

Just plug in

```

[38372.591098] usb 1-3: new high speed USB device using ehci_hcd and address 23

[38372.644323] ehci_hcd 0000:00:1d.7: port 3 high speed

[38372.644333] ehci_hcd 0000:00:1d.7: GetStatus port 3 status 001005 POWER sig=se0 PE CONNECT

[38372.714343] usb 1-3: default language 0x0409

[38372.718469] usb 1-3: udev 23, busnum 1, minor = 22

[38372.718478] usb 1-3: New USB device found, idVendor=12d1, idProduct=1003

[38372.718486] usb 1-3: New USB device strings: Mfr=2, Product=1, SerialNumber=0

[38372.718494] usb 1-3: Product: HUAWEI Mobile

[38372.718500] usb 1-3: Manufacturer: HUAWEI Technology

[38372.718679] usb 1-3: usb_probe_device

[38372.718689] usb 1-3: configuration #1 chosen from 1 choice

[38372.723092] usb 1-3: adding 1-3:1.0 (config #1, interface 0)

[38372.723156] usb-storage 1-3:1.0: usb_probe_interface

[38372.723163] usb-storage 1-3:1.0: usb_probe_interface - got id

[38372.723353] libusual 1-3:1.0: usb_probe_interface

[38372.723360] libusual 1-3:1.0: usb_probe_interface - got id

[38372.723372] usbserial_generic 1-3:1.0: usb_probe_interface

[38372.723376] usbserial_generic 1-3:1.0: usb_probe_interface - got id

[38372.723387] option 1-3:1.0: usb_probe_interface

[38372.723390] option 1-3:1.0: usb_probe_interface - got id

[38372.723399] option 1-3:1.0: GSM modem (1-port) converter detected

[38372.723429] usb 1-3: link qh2-0001/f58bf5c0 start 0 [2/0 us]

[38372.723540] usb 1-3: GSM modem (1-port) converter now attached to ttyUSB0

[38372.723587] usb 1-3: adding 1-3:1.1 (config #1, interface 1)

[38372.723630] usb-storage 1-3:1.1: usb_probe_interface

[38372.723637] usb-storage 1-3:1.1: usb_probe_interface - got id

[38372.723792] libusual 1-3:1.1: usb_probe_interface

[38372.723799] libusual 1-3:1.1: usb_probe_interface - got id

[38372.723809] usbserial_generic 1-3:1.1: usb_probe_interface

[38372.723813] usbserial_generic 1-3:1.1: usb_probe_interface - got id

[38372.723821] option 1-3:1.1: usb_probe_interface

[38372.723825] option 1-3:1.1: usb_probe_interface - got id

[38372.723831] option 1-3:1.1: GSM modem (1-port) converter detected

[38372.723904] usb 1-3: GSM modem (1-port) converter now attached to ttyUSB1

[38372.723937] usb 1-3: adding 1-3:1.2 (config #1, interface 2)

[38372.723981] usb-storage 1-3:1.2: usb_probe_interface

[38372.723988] usb-storage 1-3:1.2: usb_probe_interface - got id

[38372.725878] scsi50 : usb-storage 1-3:1.2

[38372.726199] usb 1-3: adding 1-3:1.3 (config #1, interface 3)

[38372.726251] usb-storage 1-3:1.3: usb_probe_interface

[38372.726258] usb-storage 1-3:1.3: usb_probe_interface - got id

[38372.726869] scsi51 : usb-storage 1-3:1.3

[38372.727291] drivers/usb/core/inode.c: creating file '023'

[38373.730173] scsi 50:0:0:0: CD-ROM            HUAWEI   Mass Storage     2.31 PQ: 0 ANSI: 2

[38373.731901] scsi 51:0:0:0: Direct-Access     HUAWEI   MMC Storage      2.31 PQ: 0 ANSI: 2

[38373.732308] sd 51:0:0:0: Attached scsi generic sg2 type 0

[38373.748529] sd 51:0:0:0: [sdb] Attached SCSI removable disk

[38373.750512] sr1: scsi-1 drive

[38373.750684] sr 50:0:0:0: Attached scsi CD-ROM sr1

```

#ls /dev/ttyUSB*

```

/dev/ttyUSB0  /dev/ttyUSB1

```

#lsusb

```

Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Bus 004 Device 002: ID 04fc:05da Sunplus Technology Co., Ltd 

Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Bus 005 Device 002: ID 045e:0745 Microsoft Corp. 

Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Bus 001 Device 023: ID 12d1:1003 Huawei Technologies Co., Ltd. E220 HSDPA Modem / E270 HSDPA/HSUPA Modem

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

```

iI use wvdial..

wvdial.conf

```

[Dialer Defaults]

Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0

; Phone = <Target Phone Number>

ISDN = 0

; Username = <Your Login Name>

Init1 = ATZ

; Password = <Your Password>

Modem = /dev/ttyUSB0

Baud = 9600

[Dialer umts]

Init1 = ATZ

Carrier Check = no

Init3 = AT+CPIN=xxxx

Init4 = AT+CGDCONT=1,"IP","event.vodafone.de"

Stupid Mode = 1

Phone = *99#

;Dial Command = ATDT

Dial Attempts = 2

Modem Type = USB Modem

Baud = 115200

;Baud = 9600

New PPPD = yes

Modem = /dev/ttyUSB0

Username = egal

Password = egal

```

xxxx=my PIN

First i stop the wlan.

i run then

# wvdial umts

```

--> WvDial: Internet dialer version 1.61

--> Cannot get information for serial port.

--> Initializing modem.

--> Sending: ATZ

ATZ

OK

--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0

ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0

OK

--> Sending: AT+CPIN=1698

AT+CPIN=1698

OK

--> Sending: AT+CGDCONT=1,"IP","event.vodafone.de"

AT+CGDCONT=1,"IP","event.vodafone.de"

OK

--> Modem initialized.

--> Sending: ATDT*99#

--> Waiting for carrier.

ATDT*99#

NO CARRIER

--> No Carrier!  Trying again.

--> Sending: ATDT*99#

--> Waiting for carrier.

ATDT*99#

NO CARRIER

--> No Carrier!  Trying again.

--> Maximum Attempts Exceeded..Aborting!!

--> Disconnecting at Sun Jan  2 20:10:04 2011

```

i googled a lot. I followed the instructions and nothing!

What am i doing wrong?Last edited by nickel on Fri Jan 07, 2011 11:24 pm; edited 1 time in total

----------

## NeddySeagoon

nickel,

In the UK, I use 

```
[Dialer defaults]

Modem = /dev/ttyUSB0

Init1 = ATZ

Phone = *99#

Username = *

Password = *

Init2 = AT+CGDCONT=1,"IP"
```

 as its a PAYG device, I don't bother with a PIN

----------

## nickel

thanks for the answer!

But it does not work!

NO CARRIER and bla bla shows always.

I've tested it on windows and worked perfectly.

When i dialed, the device blinks blue, which it means, it found an hsdpa network but it isn't connectd.

It is a PAYG stick, but i do have a PIN. So, i'm using it

----------

## NeddySeagoon

nickel,

Put two dial sections in wvdial, one for the pin and one for the real call.

Dial the pin then the connection.  The dongle may need several seconds to check the pin.

----------

## nickel

it works now better. I get pppd now.

But it doesn't connect though.

I get exit code = 1 

and

```

Jan  5 14:40:00 nickel pppd[5630]: pppd 2.4.4 started by root, uid 0

Jan  5 14:40:00 nickel pppd[5630]: Couldn't set tty to PPP discipline: Invalid argument

Jan  5 14:40:00 nickel pppd[5630]: Exit.

```

i've in my kernel support for ppp async serial ports activated. So, i'm cluless

----------

## NeddySeagoon

nickel,

Maybe you need net-dialup/usb_modeswitch?

My 3G dongle works without it - or maybe its always been in the right mode.

----------

## pa4wdh

A PIN usually gives some problems with dialers, usually that is because if the PIN is already entered and you enter it again the modem responds with an error.

However, that's not the problem you're having. 

A few suggestions:

1) Change ATDT*99# to ATDT*99***1# (the 1 refers to the 1 in the AT+CGDCONT command)

2) Add the command AT+CGATT=1 after the PIN command, this registers (attaches) the modem to the network in case it didn't do that automatically

----------

## nickel

thanks for the answer!

I did that and didn't work.

here's my wvdial.conf

```

[Dialer Defaults]

Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0

; Phone = <Target Phone Number>

ISDN = 0

; Username = <Your Login Name>

Init1 = ATZ

; Password = <Your Password>

[Dialer umts]

;Carrier Check = no

Stupid Mode = 1

Phone = *99***1#

Dial Command = ATDT

Dial Attempts = 2

Modem Type = Analog Modem

Modem = /dev/ttyUSB0

Baud = 460800

;Baud = 9600

New PPPD = yes

Modem = /dev/ttyUSB0

Username =egal

Password =egal

[Dialer pin]

Init3 = AT+CPIN=xxxx

Modem = /dev/ttyUSB0

Init4 = AT+CGDCONT=1,"IP","event.vodafone.de"

```

and the output when i dial

# wvdial  pin

```
--> WvDial: Internet dialer version 1.61

--> Cannot get information for serial port.

--> Initializing modem.

--> Sending: ATZ

ATZ

OK

--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0

ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0

OK

--> Sending: AT+CPIN=xxxx

AT+CPIN=xxxx

OK

--> Sending: AT+CGDCONT=1,"IP","event.vodafone.de"

AT+CGDCONT=1,"IP","event.vodafone.de"

OK

--> Modem initialized.

--> Configuration does not specify a valid phone number.

--> Configuration does not specify a valid login name.

--> Configuration does not specify a valid password.

```

and after 10 seconds

# wvdial umts

```

--> WvDial: Internet dialer version 1.61

--> Cannot get information for serial port.

--> Initializing modem.

--> 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***1#

--> Waiting for carrier.

ATDT*99***1#

CONNECT

--> Carrier detected.  Starting PPP immediately.

--> Starting pppd at Thu Jan  6 15:17:05 2011

--> Pid of pppd: 30680

--> pppd: �[1a].[08]

--> Disconnecting at Thu Jan  6 15:17:06 2011

--> The PPP daemon has died: Fatal pppd error (exit code = 1)

--> man pppd explains pppd error codes in more detail.

--> Try again and look into /var/log/messages and the wvdial and pppd man pages for more information.

--> Auto Reconnect will be attempted in 5 seconds

--> Cannot get information for serial port.

--> Initializing modem.

--> 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.

--> Cannot get information for serial port.

--> Initializing modem.

--> 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***1#

--> Waiting for carrier.

ATDT*99***1#

CONNECT

--> Carrier detected.  Starting PPP immediately.

--> Starting pppd at Thu Jan  6 15:17:13 2011

--> Pid of pppd: 30683

--> pppd: �[1a].[08]

--> Disconnecting at Thu Jan  6 15:17:14 2011

--> The PPP daemon has died: Fatal pppd error (exit code = 1)

--> man pppd explains pppd error codes in more detail.

--> Try again and look into /var/log/messages and the wvdial and pppd man pages for more information.

--> Auto Reconnect will be attempted in 10 seconds

--> Cannot get information for serial port.

--> Initializing modem.

--> 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.

^CCaught signal 2:  Attempting to exit gracefully...

--> Disconnecting at Thu Jan  6 15:17:21 2011

and so on

```

the log

# cat /var/log/messages | grep ppp

```

Jan  5 14:40:00 nickel pppd[5630]: pppd 2.4.4 started by root, uid 0

Jan  5 14:40:00 nickel pppd[5630]: Couldn't set tty to PPP discipline: Invalid argument

Jan  5 14:40:00 nickel pppd[5630]: Exit.

Jan  5 14:40:08 nickel pppd[5645]: pppd 2.4.4 started by root, uid 0

Jan  5 14:40:08 nickel pppd[5645]: Couldn't set tty to PPP discipline: Invalid argument

Jan  5 14:40:08 nickel pppd[5645]: Exit.

Jan  5 14:40:21 nickel pppd[5648]: pppd 2.4.4 started by root, uid 0

Jan  5 14:40:21 nickel pppd[5648]: Couldn't set tty to PPP discipline: Invalid argument

Jan  5 14:40:21 nickel pppd[5648]: Exit.

```

----------

## nickel

perhaps  is        it, that i've compiled in the kernel ppp  support, for async serial and sync serial direc t and not as modules?

----------

## nickel

i      know now, what's happening. (i think)

i compared dmesg with a huawei e220 howto.

They got

```

 usbserial: USB Serial support registered for GSM modem (1-port)

 option: USB Driver for GSM modems: v0.7.2

 option 4-1:1.0: GSM modem (1-port) converter detected

 usb 4-1: GSM modem (1-port) converter now attached to ttyUSB0

 option 4-1:1.1: GSM modem (1-port) converter detected

 usb 4-1: GSM modem (1-port) converter now attached to ttyUSB1

```

and i got

```

[  169.305217] USB Serial support registered for GSM modem (1-port)

[  169.305331] option 1-3:1.0: usb_probe_interface

[  169.305338] option 1-3:1.0: usb_probe_interface - got id

[  169.305350] option 1-3:1.0: GSM modem (1-port) converter detected

[  169.305401] usb 1-3: link qh2-0001/f1d48980 start 1 [2/0 us]

[  169.305649] usb 1-3: GSM modem (1-port) converter now attached to ttyUSB0

[  169.305659] option 1-3:1.1: usb_probe_interface

[  169.305663] option 1-3:1.1: usb_probe_interface - got id

[  169.305668] option 1-3:1.1: GSM modem (1-port) converter detected

[  169.305728] usb 1-3: GSM modem (1-port) converter now attached to ttyUSB1

[  169.305754] usbcore: registered new interface driver option

[  169.305757] option: v0.7.2:USB Driver for GSM modems

```

----------

## NeddySeagoon

nickel,

option is the name of a kernel module.

I thought you had tat loaded, as without it, I don't get any /dev/ttyUSB devies for my GSM modem.

Try that kernel module.

----------

## nickel

i do have it:

```
CONFIG_USB_SERIAL_OPTION=m
```

----------

## nickel

i did it!

I googled the error of my pppd: Couldn't set tty to PPP discipline: Invalid argument.

I came across a webpage, which said, that that error means, ppp_async isn't built in the kernel.

It also says that the option ppp_async and config_ppp should be built as module. Othrwise, direct into the keernel won't work.

I did that. Compiled the kernel and reboot.

It didn't work though, but i look up the error (which was diferrent this time): ppp_async: Unknown symbol crc_ccitt_table.

i found this post.

I edit my kernel's config and changed crc_ccitt=m. Compiled my kernel. Added ppp_async to /etc/modules.autoload.d . Reboot and it worked!  :Very Happy: 

I get in the log:ppp_generic: exports duplicate symbol ppp_unregister_compressor (owned by kernel). I don't know what it means, but it still works.

Thanks for the replies!

----------

## NeddySeagoon

nickel,

```
I get in the log:ppp_generic: exports duplicate symbol ppp_unregister_compressor (owned by kernel). I don't know what it means, but it still works.
```

This means your kernel is in a mess.  Somehow, you have the code that provides that symbol both built in and as a module.

If you rebuild and reinstall your kernel and the modules, starting with a make clean. That error will vanish.

Maybe running make modules_install will fix it.

----------

## nickel

i do always

# make clean && make && make modules_install

----------

