You are not logged in.

#1 2013-10-20 11:03:05

pschyska
Member
Registered: 2013-09-16
Posts: 7

[SOLVED] Issues sending AT+CPIN with wvdial

Hi,

I'm using a H5321gw umts modem to connect to t-mobile germany.
Using it with NetworkManager/ModemManager (kinda) works, but the connection is pretty unstable. The modem frequently gets into a state where I can not re-dial without rebooting.

The modem is the only reason I use NetworkManager in the first place, I want to get rid of it (because I'm not using a DE anyways...)

I'm trying to set wvdial up so I can connect from there. My conf looks like this:

[Dialer Defaults]
New PPPD = yes
Carrier Check = on
Modem = /dev/ttyACM0
#Baud = 460800
Baud = 115200
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ISDN = 0
Modem Type = USB Modem
Stupid Mode = 0
Auto DNS = 1
Auto Reconnect = on

[Dialer pin]
Init3 = AT+CMEE=1
Init4 = AT+CPIN=xxxx
 
[Dialer checkpin]
Init3 = AT+CPIN?

[Dialer tmo]
Phone = *99#
Username = t-mobile
Password = tm
Dial Command = ATD
Init3 = AT+CGDCONT=1,"IP","internet.t-mobile"

If the device was unlocked before with NM/MM, I can successfully connect with # wvdial tmo.
I cannot, however, unlock the device with wvdial.
# wvdial checkpin returns

--> WvDial: Internet dialer version 1.61
--> 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?
AT+CPIN?
+CPIN: SIM PIN
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.

... indicating that a pin unlock is needed. When I run # wvdial pin I get

--> WvDial: Internet dialer version 1.61
--> 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+CMEE=1
AT+CMEE=1
OK
--> Sending: AT+CPIN=xxxx
AT+CPIN=xxxx
+CME ERROR: 16
--> Bad init string.
--> Initializing modem.
--> Sending: ATZ
ATZ
 [.. repeated 3 times]

I'm certain the PIN I use is correct, because it's the same one in NetworkManager config. CME ERROR 16 is "Incorrect password.".

Any ideas?

Thanks

EDIT: I found the solution:-)

The pin value should be quoted with "".

AT+CPIN="xxxx"

Also, the CFUN value must be 1 (Default was 4=device powered off).

My working config (ericsson H5321gw in T-Mobile germany):

[Dialer Defaults]
Modem Type = USB Modem
ISDN = 0
Modem = /dev/ttyACM1
Baud = 460800

[Dialer pin]
Init1 = AT+CPIN="XXXX"

[Dialer check]
Init1 = AT+CPIN?
Init2 = AT+CFUN=?
Init3 = AT+CFUN?

[Dialer signal]
Init1 = AT+CSQ
Init2 = AT+COPS?

[dialer on]
Init1 = AT+CFUN=1

[Dialer off]
Init1 = AT+CFUN=4

[Dialer gps_on]
Init1 = AT*E2GPSCTL=1,1,1

[Dialer gps_off]
Init1 = AT*E2GPSCTL=0,1,0

[Dialer tmo]
Phone = *99#
Username = "tm"
Password = "t-mobile"
Stupid Mode = 1
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
# turn device on if it was switched off before (AT+CFUN=4)
Init3 = AT+CFUN=1
Init4 = AT+CGDCONT=1,"IP","internet.t-mobile"

[Dialer gps]
Modem = /dev/ttyACM2
Init1 = AT*E2GPSNPD

# backup
# according to http://www.thinkwiki.org/wiki/Ericsson_H5321_gw_Mobile_Broadband_Module
#ttyACM0 : H5321 gw Mobile Broadband Modem
#ttyACM1 : H5321 gw Mobile Broadband Data Modem
#ttyACM2 : H5321 gw Mobile Broadband GPS Port
#cdc-wdm0 : H5321 gw Mobile Broadband Device Management
#cdc-wdm1 : H5321 gw Mobile Broadband USIM Port

To connect, I have to do

# wvdial pin
# wvdial tmo

Of course, XXXX must be replaced with the correct SIM PIN. Username/password doesn't seem to matter. You can ignore all dialers besides Defaults, pin and tmo. The others are for debugging and gps.

Last edited by pschyska (2013-10-20 13:36:45)

Offline

Board footer

Powered by FluxBB