1

I'm trying to make a GPRS connection with a SIM800L and a PL2303 USB-Serial cable.

If I screen or minicom the modem (at 115200 8N1) I get an immediate response from the modem and I even after setting up the PDP and GPRS context I can successfully ping google servers through AT commands. I'm also able to initiate a PPP connection through AT+CGDATA="PPP" or ATDT*99***1#.

But with wvdial the modem won't respond

--> WvDial: Internet dialer version 1.61
--> Cannot set information for serial port.
--> Initializing modem.
--> Sending: ATZ
--> Sending: ATQ0
--> Re-Sending: ATZ
--> Modem not responding.

If I do a cat /dev/ttyUSB0 and run wvdial at the same time I get this:

ATZ0
OK

OK

OK

After wvdial has ended the command and the first OK appears, one second later the two OK will appear. Also I would like to note that ATZ and ATQ0 commands became overlapped.

I might be hijacking the output through cat and that might be the reason but the behaviour of wvdial is the same with or without cat.

This is my /etc/wvdial.conf

[Dialer Defaults]
Modem = /dev/ttyUSB0
Baud = 115200
Phone = *99***1#
Username = webgprs
Password = webgprs2002
New PPPD = yes

Modem Type = Analog Modem doesn't make any difference. If I put some Init# parameters they won't get any response either. The overlapping of commands will happen with the Init# commands too.

Getting abstraction layers out as noted in 3G and GPRS modems with pppd resulting in using only pppd didn't work either. What's clear is that communication with the serial port by system process aren't being held, only through serial port clients.

sakis3g communicates successfully with the modem but is unable to bring up an interface.

[13751] [11:45:56] Connection command that will be used is: /usr/bin/setsid /usr/sbin/pppd /dev/ttyUSB0 460800 modem crtscts -detach defaultroute dump noipdefault usepeerdns usehostname ktune logfd 2 noauth name sakis3g lock maxfail 3 connect "/usr/sbin/chat -v -f /tmp/pppd.tmp.13751" user "webgprs" password "webgprs2002"
[13751] [11:45:56] Verbosing: 28% Initializing modem
[13751] [11:45:56] Using default INITIALIZE.
[13751] [11:45:56] Command "INITIALIZE" refers to AT commands: ATZ OK 'AT&F' OK 'ATQ0 V1 E1' OK 'AT&D2 &C1' OK AT+FCLASS=0 OK ATS0=0 OK 'AT+CGDCONT=1,"IP","internet.itelcel.com"' OK
[13751] [11:45:56] Will send INITIALIZE commands to tty /dev/ttyUSB0: "" '\pAT' OK ATZ OK 'AT&F' OK 'ATQ0 V1 E1' OK 'AT&D2 &C1' OK AT+FCLASS=0 OK ATS0=0 OK 'AT+CGDCONT=1,"IP","internet.itelcel.com"' OK '\pAT' OK
[13751] [11:45:57] We are root already. Proceeding.
[13751] [11:45:57] Device /dev/ttyUSB0 is not busy.
[13751] [11:45:58] Got response from tty:
AT
OK
ATZ
OK
AT&F
OK
ATQ0 V1 E1
OK
AT&D2 &C1
OK
AT+FCLASS=0
ERROR
[13751] [11:45:58] Unknown command "STAGE7".
[13751] [11:45:58] Unknown command "STAGE8".
[13751] [11:45:58] We are root already. Proceeding.
/-------------------------------------------------------------------------------
[13751] [11:45:58] Will now run command: \'/bin/rm -f "/tmp/sakis3g.3gnet"\'
/-------------------------------------------------------------------------------
\-------------------------------------------------------------------------------
[13751] [11:45:58] Command returned 0.
\-------------------------------------------------------------------------------
[13751] [11:45:58] We are root already. Proceeding.
[13751] [11:45:58] Device /dev/ttyUSB0 is not busy.
[13751] [11:45:58] Verbosing: 35% Connecting
[13751] [11:45:58] PID 15625 is still running.
[13751] [11:45:59] Located "netstat" within PATH (/bin/netstat).
[13751] [11:45:59] Waiting for interface to go up (0 seconds passed).
[13751] [11:46:00] PID 15625 is still running.
[13751] [11:46:00] Waiting for interface to go up (1 seconds passed).
[13751] [11:46:01] PID 15625 is still running.
[13751] [11:46:01] Waiting for interface to go up (2 seconds passed).
... (truncated) ...
[13751] [11:46:56] Waiting for interface to go up (20 seconds passed).
[13751] [11:46:57] Giving up waiting for connection to occur.
[13751] [11:46:57] PID 16179 is still running.
[13751] [11:46:58] PID 16179 is not running any more.
[13751] [11:46:58] PID 16179 is not running any more.
[13751] [11:46:58] Failed to connect.
[13751] [11:46:58] Error: Failed to connect.
[13751] [11:46:58] Aborting execution chain due to actor "connect" returning 95. 

The result it's the same even if I manually set up the PDP context and set the modem in a GPRS active context

AT+CIPSTATUS
IP STATUS

2 Answers 2

1

Reading sakis3g logs and source I notice that using nocrtscts on ppp options with this PL2303 USB Serial converter is mandatory. Also, the SIM800L doesn't support AT+FCLASS command and makes the chat script fail so I had to removed it.

Using the chat script from 3G and GPRS modems with pppd I changed the line:

'OK' 'ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0'

to

'OK' 'ATQ0 V1 E1 S0=0 &C1 &D2'

The AT+FCLASS is used to select the Fax Mode. If your GSM module doesn't even support this mode (or defaults to 0 -- data mode) then it seems safe to leave that part out the chat script.

1

I have traced this problem to RTS/CTS flow control which libwvstreams (and thus wvdial) use by default but my tiny USB serial dongle does not support.

You can use my patch on GitHub or fix it in hardware. If your dongle has RTS and CTS pins, for example (and your modem doesn't), you can connect them to eachother.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .