I have been trying to setup up a 4g usb modem with my raspberry pi running raspbian. The modem is recognized and I'm able to query imsi, signal strength and other details by running AT commands using minicom. Then I tried setting up wvdial.
[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3 = AT+CGDCONT=1,"IP","airtelgprs.com"
Init4 = ATDT*99#
Modem Type = Analog Modem
Stupid Mode = 1
Baud = 9600
New PPPD = Yes
Modem = /dev/ttyUSB1
; no user name or pwd
After all the init commands, I'm able to send ATDT*99#
, I get a response saying CONNECT 100000000
. But after that nothing happens, wvdial tries to send ATQ0 after sometime and gives up saying the modem is not responding.
wvdial output:
--> 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+CGDCONT=1,"IP","airtelgprs.com",,0,0
AT+CGDCONT=1,"IP","airtelgprs.com",,0,0
OK
--> Sending: ATDT*99#
ATDT*99#
CONNECT 100000000
--> Sending: ATQ0
--> Re-Sending: ATDT*99#
--> Modem not responding.
I tried to investigate the sequence of AT commands that windows sends by using a serial port sniffer. I connected my USB modem to my PC and started the dial up modem interface by right clicking on it and selecting connect.
The modem connects and all the AT commands are logged. Modem COM port log:
01-18-2015 13:30:46.555 - File: C:\Windows\system32\tapisrv.dll, Version 6.3.9600
01-18-2015 13:30:46.555 - File: C:\Windows\system32\unimdm.tsp, Version 6.3.9600
01-18-2015 13:30:46.555 - File: C:\Windows\system32\unimdmat.dll, Version 6.3.9600
01-18-2015 13:30:46.555 - File: C:\Windows\system32\uniplat.dll, Version 6.3.9600
01-18-2015 13:30:46.555 - File: C:\Windows\system32\drivers\modem.sys, Version 6.3.9600
01-18-2015 13:30:46.555 - File: C:\Windows\system32\modemui.dll, Version 6.3.9600
01-18-2015 13:30:46.555 - File: C:\Windows\system32\mdminst.dll, Version 6.3.9600
01-18-2015 13:30:46.555 - Modem type: ZTE Proprietary USB Modem
01-18-2015 13:30:46.555 - Modem inf path: oem43.inf
01-18-2015 13:30:46.555 - Modem inf section: Modem6k
01-18-2015 13:30:46.555 - Matching hardware ID: usb\vid_19d2&pid_0017&mi_02
01-18-2015 13:30:46.570 - Opening Modem
01-18-2015 13:30:46.570 - 921600,8,N,1, ctsfl=0, rtsctl=1
01-18-2015 13:30:46.570 - Initializing modem.
01-18-2015 13:30:46.570 - Recv: <cr><lf>OK<cr><lf>
01-18-2015 13:30:46.570 - Interpreted response: OK
01-18-2015 13:30:46.586 - Send: AT<cr>
01-18-2015 13:30:46.586 - Recv: <cr><lf>OK<cr><lf>
01-18-2015 13:30:46.586 - Interpreted response: OK
01-18-2015 13:30:46.602 - Send: ATV1<cr>
01-18-2015 13:30:46.602 - Recv: <cr><lf>OK<cr><lf>
01-18-2015 13:30:46.602 - Interpreted response: OK
01-18-2015 13:30:46.602 - TSP(0000): Making Call
01-18-2015 13:30:46.617 - Send: ATE0<cr>
01-18-2015 13:30:46.617 - Recv: <cr><lf>OK<cr><lf>
01-18-2015 13:30:46.617 - Interpreted response: OK
01-18-2015 13:30:46.633 - Send: AT&F&D2&C1S0=0<cr>
01-18-2015 13:30:46.633 - Recv: <cr><lf>OK<cr><lf>
01-18-2015 13:30:46.633 - Interpreted response: OK
01-18-2015 13:30:46.649 - Send: ATS7=60S30=0<cr>
01-18-2015 13:30:46.649 - Recv: <cr><lf>OK<cr><lf>
01-18-2015 13:30:46.649 - Interpreted response: OK
01-18-2015 13:30:46.649 - Waiting for a call.
01-18-2015 13:30:46.664 - Send: ATS0=0<cr>
01-18-2015 13:30:46.664 - Recv: <cr><lf>OK<cr><lf>
01-18-2015 13:30:46.664 - Interpreted response: OK
01-18-2015 13:30:46.664 - 7200000,8,N,1, ctsfl=0, rtsctl=1
01-18-2015 13:30:46.664 - Initializing modem.
01-18-2015 13:30:46.680 - Send: AT<cr>
01-18-2015 13:30:46.680 - Recv: <cr><lf>OK<cr><lf>
01-18-2015 13:30:46.680 - Interpreted response: OK
01-18-2015 13:30:46.696 - Send: ATV1<cr>
01-18-2015 13:30:46.696 - Recv: <cr><lf>OK<cr><lf>
01-18-2015 13:30:46.696 - Interpreted response: OK
01-18-2015 13:30:46.711 - Send: ATE0<cr>
01-18-2015 13:30:46.711 - Recv: <cr><lf>OK<cr><lf>
01-18-2015 13:30:46.711 - Interpreted response: OK
01-18-2015 13:30:46.727 - Send: AT&F&D2&C1S0=0<cr>
01-18-2015 13:30:46.727 - Recv: <cr><lf>OK<cr><lf>
01-18-2015 13:30:46.727 - Interpreted response: OK
01-18-2015 13:30:46.742 - Send: ATS7=60S30=0<cr>
01-18-2015 13:30:46.742 - Recv: <cr><lf>OK<cr><lf>
01-18-2015 13:30:46.742 - Interpreted response: OK
01-18-2015 13:30:46.742 - Dialing.
01-18-2015 13:30:46.742 - TSP Completing Async Operation(0x00010099) Status 0x00000000
01-18-2015 13:30:46.742 - TSP(0000): LINEEVENT: LINECALLSTATE_DIALING
01-18-2015 13:30:46.742 - TSP(0000): LINEEVENT: LINECALLSTATE_PROCEEDING
01-18-2015 13:30:46.758 - Send: ATDT*99#<cr>
01-18-2015 13:30:46.789 - Recv: <cr><lf>CONNECT 100000000<cr><lf>
01-18-2015 13:30:46.789 - An unknown response was received while attempting to connect, but CD was high so completing successfully
01-18-2015 13:30:46.789 - Connection established at 7200000bps.
01-18-2015 13:30:46.789 - Error-control off or unknown.
01-18-2015 13:30:46.789 - Data compression off or unknown.
01-18-2015 13:30:46.789 - TSP(0000): LINEEVENT: LINECALLSTATE_CONNECTED
After that I tried to start the modem manually by running the AT commands from the log. I get an OK response for all commands until I hit ATDT*99# which gives CONNECT 100000000 and hangs. I don't understand, I used the same AT commands in the same order. It doesn't start when I run it manually, but it starts when I right click on the adapter select connect, which in turn runs the same AT commands. What is the extra thing that windows is doing on clicking connect?