User Tools

Site Tools


informatica:linux:modem_usb_vodafone

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
informatica:linux:modem_usb_vodafone [2013/03/06 12:17] – creado javiinformatica:linux:modem_usb_vodafone [2015/04/13 20:19] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ===== 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:
 +
 +<code>
 +[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
 +</code>
 +
 +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:
 +
 +<code>
 +  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]
 +</code>
 +
 +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**
 +
 +<code>
 +# Vodafone / Huawei K3772
 +TargetVendor=0x12d1
 +TargetProduct=0x14cf
 +HuaweiNewMode=1
 +</code>
 +
 +**/lib/udev/rules.d/40-usb_modeswitch.rules**
 +
 +Le anyado una linea:
 +
 +<code>
 +ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1f11", RUN+="usb_modeswitch '%b/%k'"
 +</code>
 +
 +Por lo que el principio del archivo queda asi, el resto no lo he tocado:
 +
 +<code>
 +# 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'"
 +</code>
 +
 +He generado el archivo con el comando:
 +
 +  sudo wvdialconf
 +
 +**/etc/wvdial.conf**
 +
 +<code>
 +[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
 +</code>
 +
 +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:
 +
 +<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]
 +</code>
 +
 +Comentarios:
 +
 +a) Me detecta el USB como modem:
 +
 +<code>
 +Bus 002 Device 004: ID 12d1:14cf Huawei Technologies Co., Ltd. 
 +</code>
 +
 +...pero tambien como CDROM (en este caso es la unidad "sr1"):
 +
 +<code>
 +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
 +</code>
 +
 +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:
 +
 +<code>
 +sudo lsmod  | grep option
 +
 +option                 45416 
 +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
 +</code>
 +
 +<code>
 +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
 +</code>
 +
 +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:
 +
 +<code>
 +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
 +</code>
 +
 +
 +
 +
 +==== Configuracion vieja (antes 9/9/2014) ====
  
 modem usb vodafone Huawei modem usb vodafone Huawei
Line 48: Line 365:
  
 7. Deberian salir los popups correspondientes para introducir el PIN del modem USB y a funcionar  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:
 +
 +<code>
 +Number: *99#
 +User: vodafone
 +Passwords: vodafone
 +APN: ac.vodafone.es
 +PIN: en blanco
 +</code>
 +
 +Luego al reiniciar tengo que hacer distinas combinaciones, pulsar ESC cuando me pide password... Al final consigo conectarme
informatica/linux/modem_usb_vodafone.1362572278.txt.gz · Last modified: 2015/04/13 20:19 (external edit)