User Tools

Site Tools


informatica:linux:modem_usb_vodafone

Modem USB Vodafone

Configuracion buena

A partir del 9/9/2014 (un mes antes quiza) la receta enterior no me funciona.

Abajo dejo unas configuraciones por si las moscas, pero NO son necesarias.

1. Instalar paquetes:

sudo aptitude update; sudo aptitude install network-manager-gnome usb-modeswitch wvdial screen

2. Crear archivo:

sudo vim /etc/wvdial.conf

Con el siguiente contenido:

[Dialer Defaults]
Init1 = AT+CPIN=1234
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2
Modem Type = Analog Modem
Phone = *99#
ISDN = 0
Password = vodafone
Username = vodafone
Modem = /dev/ttyUSB0
Baud = 9600

En este ejemplo el PIN es “1234”

3. Inicio screen para poder cerrar la consola sin cortar la conexion:

screen -S internet

4. Me conecto:

  sudo wvdial
  
Salida:

<code>--> WvDial: Internet dialer version 1.61
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2
ATQ0 V1 E1 S0=0 &C1 &D2
OK
--> Modem initialized.
--> Sending: ATDT*99#
--> Waiting for carrier.
ATDT*99#
+CME ERROR: 11
--> Invalid dial command.
--> Disconnecting at Tue Sep  9 19:58:53 2014
usuario@wheezy64:~$ sudo vim /etc/wvdial.conf
usuario@wheezy64:~$ sudo wvdial
--> WvDial: Internet dialer version 1.61
--> Initializing modem.
--> Sending: AT+CPIN=1234
AT+CPIN=1234
OK
--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2
ATQ0 V1 E1 S0=0 &C1 &D2
OK
--> Modem initialized.
--> Sending: ATDT*99#
--> Waiting for carrier.
ATDT*99#
CONNECT
--> Carrier detected.  Waiting for prompt.
1234
--> Don't know what to do!  Starting pppd and hoping for the best.
--> Starting pppd at Tue Sep  9 19:59:50 2014
--> Pid of pppd: 3464
--> Using interface ppp0
--> pppd: 8[7f]
--> pppd: 8[7f]
--> pppd: 8[7f]
--> pppd: 8[7f]
--> pppd: 8[7f]
--> pppd: 8[7f]
--> local  IP address 178.139.115.21
--> pppd: 8[7f]
--> remote IP address 10.64.64.64
--> pppd: 8[7f]
--> primary   DNS address 212.166.210.5
--> pppd: 8[7f]
--> secondary DNS address 212.73.32.67
--> pppd: 8[7f]

5. Salgo de screen:

CTRL + a + z

Configuracion buena - comentarios

Haciendo esto tambien me he conectado. Pero finalmente quitando los archivos de configuracion tambien lo he conseguido, pero los dejo aqui escritos por si Ascaso.

OJO estoy seguro de que cargar el modulo “option” es imprescindible. Desconozco el proceso que lo ha anyadido a /etc/modules

Resumen de configuraciones:

/usr/share/usb_modeswitch/12d1:1526

# Vodafone / Huawei K3772
TargetVendor=0x12d1
TargetProduct=0x14cf
HuaweiNewMode=1

/lib/udev/rules.d/40-usb_modeswitch.rules

Le anyado una linea:

ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1f11", RUN+="usb_modeswitch '%b/%k'"

Por lo que el principio del archivo queda asi, el resto no lo he tocado:

# Part of usb-modeswitch-data, version 20140529
#
# Works with usb_modeswitch versions >= 2.2.0 (introduction of HuaweiNewMode)
#
ACTION!="add|change", GOTO="modeswitch_rules_end"

# Adds a symlink "gsmmodem[n]" to the lowest ttyUSB port with interrupt
# transfer; checked against a list of known modems, or else no action
KERNEL=="ttyUSB*", ATTRS{bNumConfigurations}=="*", PROGRAM="usb_modeswitch --symlink-name %p %s{idVendor} %s{idProduct} %E{PRODUCT}", SYMLINK+="%c"

SUBSYSTEM!="usb", GOTO="modeswitch_rules_end"

# Adds the device ID to the "option" driver after a warm boot
# in cases when the device is yet unknown to the driver; checked
# against a list of known modems, or else no action
ATTR{bInterfaceClass}=="ff", ATTR{bInterfaceNumber}=="00", ATTRS{bNumConfigurations}=="*", RUN+="usb_modeswitch --driver-bind %p %s{idVendor} %s{idProduct} %E{PRODUCT}"

# Don't continue on "change" event, prevent trigger by changed configuration
ACTION!="add", GOTO="modeswitch_rules_end"

ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1f11", RUN+="usb_modeswitch '%b/%k'"

He generado el archivo con el comando:

sudo wvdialconf

/etc/wvdial.conf

[Dialer Defaults]
Init1 = AT+CPIN=1234
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2
Modem Type = Analog Modem
Phone = *99#
ISDN = 0
Password = vodafone
Username = vodafone
Modem = /dev/ttyUSB0
Baud = 9600

En este ejemplo el PIN es “1234”

Y finalmente para conectarme (mejor hacerlo en un screen, pues si interrumpimos el proceso se corta la conexion):

sudo wvdial

Salida:

--> WvDial: Internet dialer version 1.61
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2
ATQ0 V1 E1 S0=0 &C1 &D2
OK
--> Modem initialized.
--> Sending: ATDT*99#
--> Waiting for carrier.
ATDT*99#
+CME ERROR: 11
--> Invalid dial command.
--> Disconnecting at Tue Sep  9 19:58:53 2014
usuario@wheezy64:~$ sudo vim /etc/wvdial.conf
usuario@wheezy64:~$ sudo wvdial
--> WvDial: Internet dialer version 1.61
--> Initializing modem.
--> Sending: AT+CPIN=1234
AT+CPIN=1234
OK
--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2
ATQ0 V1 E1 S0=0 &C1 &D2
OK
--> Modem initialized.
--> Sending: ATDT*99#
--> Waiting for carrier.
ATDT*99#
CONNECT
--> Carrier detected.  Waiting for prompt.
1234
--> Don't know what to do!  Starting pppd and hoping for the best.
--> Starting pppd at Tue Sep  9 19:59:50 2014
--> Pid of pppd: 3464
--> Using interface ppp0
--> pppd: 8[7f]
--> pppd: 8[7f]
--> pppd: 8[7f]
--> pppd: 8[7f]
--> pppd: 8[7f]
--> pppd: 8[7f]
--> local  IP address 178.139.115.21
--> pppd: 8[7f]
--> remote IP address 10.64.64.64
--> pppd: 8[7f]
--> primary   DNS address 212.166.210.5
--> pppd: 8[7f]
--> secondary DNS address 212.73.32.67
--> pppd: 8[7f]

Comentarios:

a) Me detecta el USB como modem:

Bus 002 Device 004: ID 12d1:14cf Huawei Technologies Co., Ltd. 

…pero tambien como CDROM (en este caso es la unidad “sr1”):

cat /proc/sys/dev/cdrom/info

drive name:		sr1	sr0
drive speed:		1	24
drive # of slots:	1	1
Can close tray:		1	1
Can open tray:		1	1
Can lock tray:		1	1
Can change speed:	0	1
Can select disk:	0	0
Can read multisession:	1	1
Can read MCN:		1	1
Reports media changed:	1	1
Can play audio:		1	1
Can write CD-R:		0	1
Can write CD-RW:	0	1
Can read DVD:		0	1
Can write DVD-R:	0	1
Can write DVD-RAM:	0	1
Can read MRW:		0	1
Can write MRW:		0	1
Can write RAM:		0	1

b) nm-applet (supongo que hereda de network-manager) sigue sin ver el dispositivo como modem

TODO comprobar permisos dialout etc…

c) Tengo cargado el modulo “option”. Funciona sin ese modulo, pero lo dejo por si otra aplicacion lo necesita:

sudo lsmod  | grep option

option                 45416  1 
usb_wwan               17136  1 option
usbserial              32197  5 option,usb_wwan
usbcore               178937  11 uvcvideo,usb_storage,usbserial,ehci_hcd,ehci_pci,option,usbnet,huawei_cdc_ncm,usb_wwan,cdc_ncm,cdc_wdm
sudo cat /etc/modules
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
# Parameters can be specified after the module name.

loop
vboxdrv
tun
option

d) El siguiente archivo esta vacio:

/sys/bus/usb-serial/drivers/option1/new_id

e) Tengo a la vez arrancado wicd, aunque creo que no lo uso para nada. Lo he desinstalado y sigue funcionando.

Versiones de los paquetes relevantes:

ii  network-manager                       0.9.10.0-1.1                       amd64        network management framework (daemon and userspace tools)
ii  network-manager-gnome                 0.9.10.0-2                         amd64        network management framework (GNOME frontend)
ii  usb-modeswitch                        2.2.0+repack0-2                    amd64        mode switching tool for controlling "flip flop" USB devices
ii  usb-modeswitch-data                   20140529-1                         all          mode switching data for usb-modeswitch
ii  wvdial                                1.61-4.1                           amd64        intelligent Point-to-Point Protocol dialer
ii  python-wicd                           1.7.2.4-4.1                        all          wired and wireless network manager - Python module
ii  wicd                                  1.7.2.4-4.1                        all          wired and wireless network manager - metapackage
ii  wicd-daemon                           1.7.2.4-4.1                        all          wired and wireless network manager - daemon
ii  wicd-gtk                              1.7.2.4-4.1                        all          wired and wireless network manager - GTK+ client

Configuracion vieja (antes 9/9/2014)

modem usb vodafone Huawei

http://www.draisberghof.de/usb_modeswitch/bb/viewtopic.php?t=1005

1. Instalar paquetes:

sudo aptitude update; sudo aptitude install network-manager-gnome usb-modeswitch

2. Crear:

sudo mkdir/usr/share/usb_modeswitch
sudo vim /usr/share/usb_modeswitch/12d1:1f11

Con el siguiente contenido:

# Vodafone Mobile Broadband (Huawei) K3773

DefaultVendor=  0x12d1
DefaultProduct= 0x1f11

TargetVendor=  0x12d1
TargetProduct= 0x14bc

MessageContent="555342437f0000000002000080000a11062000000000000100000000000000"

3. Crear:

sudo vim /lib/udev/rules.d/40-usb_modeswitch.rules

Con el siguiente contenido:

# Vodafone Mobile Broadband (Huawei) K3773
ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1f11", RUN+="usb_modeswitch '%b/%k'"

4. Reiniciar el equipo

5. Ejecutar el applet de Network Manager:

nm-applet

6. Conectar el modem USB

7. Deberian salir los popups correspondientes para introducir el PIN del modem USB y a funcionar

Errores

En un momento dado me pide una contrasenya. Para solucionarlo:

1. Abro pincho USB y extraigo la tarjeta SIM

2. La coloco en un telefono movil y lo enciendo

3. Le meto el PUK y luego le cambio el PIN

4. Vuelvo a meter la tarjeta SIM en el pincho y lo conecto

5. La conexion:

Number: *99#
User: vodafone
Passwords: vodafone
APN: ac.vodafone.es
PIN: en blanco

Luego al reiniciar tengo que hacer distinas combinaciones, pulsar ESC cuando me pide password… Al final consigo conectarme

informatica/linux/modem_usb_vodafone.txt · Last modified: 2015/04/13 20:19 by 127.0.0.1