Configurazione wvdial con internet key + PIN

Ciao,
per far funzionare una chiavetta ONDA MT503HSA della TIM utilizzo wvdial per la connessione. Ora per questioni lavorative utilizzo una chiavetta che ha associato un PIN e con la configurazione dello stesso wvdial, non mi viene eseguita la connessione.
Il mio file di configurazione è il seguente:

[root@cellopc ~]# cat /etc/wvdial.conf
[Dialer Defaults]
Modem = /dev/ttyUSB2
ISDN = off
Modem Type = Analog Modem
Baud = 460800
Init = ATX3
Init2 = AT&F Q0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3 = at+cgdcont=1,"IP","ibox.tim.it"
Phone = *99#
Dial Attempts = 5
Dial Command = ATM1L3DT
Ask Password = on
Username = ''
Password = ''
Stupid Mode = on
Auto Reconnect = off
Check Def Route = off

Ecco l’output durante la comunicazione:

[root@cellopc ~]# wvdial
--> WvDial: Internet dialer version 1.61
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: ATX3
ERROR
--> Bad init string.
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: ATX3
ERROR
--> Bad init string.
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: ATX3
ERROR
--> Bad init string.

Mentre con la mia chiavetta con PIN disabilitato non ho problemi di connessione.

Sapreste aiutarmi?

Ciao cello86!
Visto che lavoro con modem presumo che il malfunzionamento sia imputabile al fatto che non viene inserito il PIN prima di configurarlo. Ovviamente questo dipende anche dai modem, ma generalmente questa regola vale.

Per prima cosa prova inserire il comando:AT+CPIN="tuopin"
se è tutto corretto deve rispondere:OK.Quindi puoi inserire i tuoi comandi di configurazione del modem.
Altrimenti dimmi cose ti risponde il modem.

Ho settato l’opzione “Ask Password” ad on, mentre prima era ad off e ora almeno quando parte wvdial, mi viene richiesto il PIN. Ecco l’output

[root@cellopc ~]# wvdial
--> WvDial: Internet dialer version 1.61
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: ATX3
ATX3
OK
--> Sending: AT&F Q0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
AT&F Q0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
OK
--> Sending: at+cgdcont=1,"IP","ibox.tim.it"
at+cgdcont=1,"IP","ibox.tim.it"
OK
--> Modem initialized.
--> Please enter password (or empty password to stop):

Ma la stringa da te indicata è da passare tra i parametri InitX, all’interno del wvdial.conf?

credo di si, la metterei sul primo init e scalerei numericamente i successivi.

Virus mi ha anticipato: ti consiglio la stessa cosa. Comunque ti avviso che non so usare quel programma, ma i modem un po’ li conosco.

[quote=SolidAran]
Comunque ti avviso che non so usare quel programma, ma i modem un po’ li conosco.[/quote]
non mi è chiaro il senso di questa affermazione.

intendo che non so se è corretto mettere quel comando come primo init.

ok. ora è chiaro.
grazie.

Allora cello com’è andata la configurazione?

Ciao,
riepilogo i passi eseguiti per la connessione con la chiavetta.

[root@cellopc ~]# modprobe usbserial vendor=0x19d2 product=0x0002
[root@cellopc ~]# usb_modeswitch -v 0x19d2 -p 0x2000 -V 0x19d2 -P 0x0002 -d 1

Looking for target devices …
No devices in target mode or class found
Looking for default devices …
No default device found. Is it connected? Bye.

[root@cellopc ~]# eject /dev/sr1

La chiavetta ora viene vista come modem in modo corretto

[root@cellopc ~]# lsusb  | grep -i onda
Bus 001 Device 012: ID 19d2:0037 ONDA Communication S.p.A. 

Edito la configurazione come indicato

[root@cellopc ~]# vim /etc/wvdial.conf
[Dialer Defaults]
Modem = /dev/ttyUSB2
ISDN = off
Modem Type = Analog Modem
Baud = 460800
Init = AT+CPIN="0000"
Init2 = ATX3
Init3 = AT&F Q0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init4 = at+cgdcont=1,"IP","ibox.tim.it"
Phone = *99#
Dial Attempts = 10
Dial Command = ATM1L3DT
Ask Password = off
Username = ''
Password = ''
Stupid Mode = on

Lanciando wvdial ecco l’output del comando.

[root@cellopc ~]# wvdial
--> WvDial: Internet dialer version 1.61
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: AT+CPIN="0000"
OK
--> Sending: ATX3
OK
--> Sending: AT&F Q0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
OK
--> Sending: at+cgdcont=1,"IP","ibox.tim.it"
at+cgdcont=1,"IP","ibox.tim.it"
OK
--> Modem initialized.
--> Sending: ATM1L3DT*99#
--> Waiting for carrier.
ATM1L3DT*99#
CONNECT 7200000
--> Carrier detected.  Starting PPP immediately.
--> Starting pppd at Wed Feb  3 13:24:01 2010
--> Pid of pppd: 31798
--> pppd: P�l
--> Using interface ppp0
--> pppd: P�l
--> pppd: P�l
--> pppd: P�l
--> pppd: P�l
--> pppd: P�l
--> pppd: P�l
--> pppd: P�l
--> pppd: P�l
--> pppd: P�l
--> Authentication (PAP) started
--> pppd: P�l
--> pppd: P�l
--> pppd: P�l
--> Authentication (PAP) successful
--> pppd: P�l
--> pppd: P�l
--> pppd: P�l
--> pppd: P�l
--> pppd: P�l
--> pppd: P�l
--> pppd: P�l
--> pppd: P�l
--> pppd: P�l
--> pppd: P�l
--> pppd: P�l
--> pppd: P�l
--> pppd: P�l
--> pppd: P�l
--> pppd: P�l
--> pppd: P�l
--> pppd: P�l
--> pppd: P�l
--> pppd: P�l
--> pppd: P�l
--> pppd: P�l
--> pppd: P�l
--> pppd: P�l
--> pppd: P�l
--> pppd: P�l
--> pppd: P�l
--> pppd: P�l
--> pppd: P�l
--> pppd: P�l
--> pppd: P�l
--> pppd: P�l
--> pppd: P�l
--> pppd: P�l
--> pppd: P�l
--> local  IP address 95.74.108.197
--> pppd: P�l
--> remote IP address 10.64.64.64
--> pppd: P�l
--> pppd: P�l
--> Script /etc/ppp/ip-up run successful
--> Default route Ok.
--> Nameserver (DNS) Ok.
--> Connected... Press Ctrl-C to disconnect
--> pppd: P�l

L’interfaccia ppp0 viene startata correttamente

[root@cellopc script]#  ifconfig ppp0
ppp0      Link encap:Point-to-Point Protocol  
          inet addr:95.74.108.197  P-t-P:10.64.64.64  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:15 errors:0 dropped:0 overruns:0 frame:0
          TX packets:15 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3 
          RX bytes:324 (324.0 b)  TX bytes:384 (384.0 b)

Sembra funzionare. La mia domanda ora è la seguente. Ma se dovessi utilizzare più chiavette sempre dello stesso modello e provider, ma con PIN differenti cosa dovrei fare?. Io pensavo di commentare la riga di init e mantenere l’opzione Ask Password ad On è fattibile?

[ot]

[quote]
L’interfaccia ppp0 viene startata[/quote]
Che tristezza :frowning: non dico di essere il Manzoni ma italianizzare tutto mi sembra un po’ esagerato…non era meglio “avviata”?

Dico questo perché se c’è da fare una ricerca nel forum, trovare argomenti descritti tramite neologismi è davvero difficile.
[/ot]

[ot]
Condivido in pieno l’ot di MarioS
[/ot]
Cello purtroppo non so aiutarti; devo studiarmi un po’ il programma.

networkmanager non ti funziona con questo dispositivo ?

altrimenti puoi fare un piccolo script che ti modifica e lancia wvdial.

Ho steso uno script che mi fa la change delle configurazioni del wvdial in base alla chiavetta mia o lavorativa. Poi disabiliterò il PIN anche da quella lavorativa, ma per lo meno posso stendere un pochino di documentazione genereica su wvdial.
Se provo da NM con la configurazione fatta con il suo wizard, per la connessione di TIM non parte e dal messages ricevo:

Feb  5 12:03:51 cellopc NetworkManager:   Activation (ttyUSB2) starting connection 'TIM Internet / Alice'
Feb  5 12:03:51 cellopc NetworkManager:   (ttyUSB2): device state change: 3 -> 4 (reason 0)
Feb  5 12:03:51 cellopc NetworkManager:   Activation (ttyUSB2) Stage 1 of 5 (Device Prepare) scheduled...
Feb  5 12:03:51 cellopc NetworkManager:   Activation (ttyUSB2) Stage 1 of 5 (Device Prepare) started...
Feb  5 12:03:51 cellopc NetworkManager:   Activation (ttyUSB2) Stage 1 of 5 (Device Prepare) complete.
Feb  5 12:03:51 cellopc modem-manager: (ttyUSB2) opening serial device...
Feb  5 12:03:51 cellopc modem-manager: Modem /org/freedesktop/ModemManager/Modems/0: state changed (disabled -> enabling)
Feb  5 12:03:51 cellopc modem-manager: Modem /org/freedesktop/ModemManager/Modems/0: state changed (enabling -> registered)
Feb  5 12:03:51 cellopc modem-manager: Modem /org/freedesktop/ModemManager/Modems/0: state changed (registered -> connecting)
Feb  5 12:03:51 cellopc modem-manager: Modem /org/freedesktop/ModemManager/Modems/0: state changed (connecting -> connected)
Feb  5 12:03:51 cellopc NetworkManager:   Activation (ttyUSB2) Stage 2 of 5 (Device Configure) scheduled...
Feb  5 12:03:51 cellopc NetworkManager:   Activation (ttyUSB2) Stage 2 of 5 (Device Configure) starting...
Feb  5 12:03:51 cellopc NetworkManager:   (ttyUSB2): device state change: 4 -> 5 (reason 0)
Feb  5 12:03:51 cellopc NetworkManager:   Activation (ttyUSB2) Stage 2 of 5 (Device Configure) successful.
Feb  5 12:03:51 cellopc NetworkManager:   Activation (ttyUSB2) Stage 3 of 5 (IP Configure Start) scheduled.
Feb  5 12:03:51 cellopc NetworkManager:   Activation (ttyUSB2) Stage 2 of 5 (Device Configure) complete.
Feb  5 12:03:51 cellopc NetworkManager:   Activation (ttyUSB2) Stage 3 of 5 (IP Configure Start) started...
Feb  5 12:03:51 cellopc NetworkManager:   (ttyUSB2): device state change: 5 -> 7 (reason 0)
Feb  5 12:03:51 cellopc NetworkManager:   Starting pppd connection
Feb  5 12:03:51 cellopc NetworkManager:   Activation (ttyUSB2) Stage 4 of 5 (IP6 Configure Get) scheduled...
Feb  5 12:03:51 cellopc NetworkManager:   Activation (ttyUSB2) Stage 3 of 5 (IP Configure Start) complete.
Feb  5 12:03:51 cellopc NetworkManager:   Activation (ttyUSB2) Stage 4 of 5 (IP6 Configure Get) started...
Feb  5 12:03:51 cellopc NetworkManager:   Activation (ttyUSB2) Stage 4 of 5 (IP6 Configure Get) complete.
Feb  5 12:03:51 cellopc NetworkManager:   ppp_exit_code(): ppp pid 27013 exited with error: pppd options error
Feb  5 12:03:51 cellopc NetworkManager:   (ttyUSB2): device state change: 7 -> 9 (reason 14)
Feb  5 12:03:51 cellopc modem-manager: Modem /org/freedesktop/ModemManager/Modems/0: state changed (connected -> disconnecting)
Feb  5 12:03:51 cellopc NetworkManager:   Marking connection 'TIM Internet / Alice' invalid.
Feb  5 12:03:51 cellopc NetworkManager:   Activation (ttyUSB2) failed.
Feb  5 12:03:51 cellopc NetworkManager:   (ttyUSB2): device state change: 9 -> 3 (reason 0)
Feb  5 12:03:51 cellopc NetworkManager:   (ttyUSB2): deactivating device (reason: 0).
Feb  5 12:03:51 cellopc NetworkManager:   Policy set 'Borsa' (eth0) as default for routing and DNS.
Feb  5 12:03:51 cellopc modem-manager: Modem /org/freedesktop/ModemManager/Modems/0: state changed (disconnecting -> disabling)
Feb  5 12:03:51 cellopc modem-manager: Modem /org/freedesktop/ModemManager/Modems/0: state changed (disabling -> disconnecting)
Feb  5 12:03:52 cellopc modem-manager: Modem /org/freedesktop/ModemManager/Modems/0: state changed (disconnecting -> registered)
Feb  5 12:03:52 cellopc modem-manager: Modem /org/freedesktop/ModemManager/Modems/0: state changed (registered -> disabling)
Feb  5 12:03:52 cellopc modem-manager: (ttyUSB2) closing serial device...
Feb  5 12:03:52 cellopc modem-manager: Modem /org/freedesktop/ModemManager/Modems/0: state changed (disabling -> disabled)