5

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.

enter image description here

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?

5
  • 1
    Using Google I found this document: zte.com.au/downloads/USB_Modem_Config_Procedure.pdf This describes how to connect using a "ZTE Proprietary Modem" without using the Windows connection manager. Does "ZTE Proprietary Modem" completely describe your modem, or are there different models of them? Commented Jan 18, 2015 at 19:01
  • 1
    I just saw you this is a "3G" modem. It might be helpful to know the exact model, however. It has been a LONG time since I have tinkered with a modem, but to get direct access to it and experiment you may want to install the minicom package on the Pi. Using minicom you would connect to the modem in real time and issue the AT commands from your keyboard, just as they show in the document I linked above, instead of making changes to wvdial and watching result for errors. Once you figure out the "secret" commands you can better update the wvdial script. Commented Jan 18, 2015 at 19:08
  • 1
    @TommyTrussell Thanks! I did install minicom on Pi and ran those command directly. I gave up trying to figure it out, and I just now stumbled upon pppconfig which is another way of configuring dialup modem. It surprisingly worked!
    – Rnet
    Commented Jan 18, 2015 at 19:47
  • Great! Maybe you can add the answer or edit your post with the answer. (There may also be a way to mark this "Solved," but I'm new here so I don't know.) Since you've documented what wvdial did maybe you can compare its output to what pppconfig is doing and see what's happening, if it's not too subtle. Commented Jan 18, 2015 at 20:22
  • My modem replies this when it lacks the connection to the cellular network.
    – L29Ah
    Commented Oct 3, 2016 at 16:42

1 Answer 1

5

I couldn't make it work through wvdial, but I did manage to start the modem and connect to the internet using pppconfig to configure the ppp connection. I also ran into some issues with the dns settings which I resolved by using opendns ips.

3
  • 1
    Would you like to click on the "Accept" (tick?) icon to select your answer as THE answer...?
    – SlySven
    Commented Jan 16, 2016 at 13:31
  • 1
    Yea, technically you are not dialling anything. The *99# is a special command on mobile phones to start PPP... et viola, you managed to fix it. Please accept your accept.
    – Piotr Kula
    Commented Jan 16, 2016 at 17:07
  • Hi @Rnet, I'm running into a similar pb at the moment with my airtel sim card on a huawei 3g dongle. Could you elaborate a bit on the opendns ips part ? Thanks a lot Commented Apr 22, 2016 at 17:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.