wvdial无法检索调制解调器响应,终端程序通信没有问题


1

我正在尝试使用SIM800L和PL2303 USB串行电缆建立GPRS连接。

如果我屏幕minicom调制解调器(在115200 8N1)我从调制解调器得到立即响应,我甚至在设置PDP和GPRS上下文后,我可以通过AT命令成功ping谷歌服务器。我也可以通过AT+CGDATA="PPP"或启动PPP连接ATDT*99***1#

但是对于wvdial,调制解调器不会响应

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

如果我cat /dev/ttyUSB0同时运行wvdial,我会得到:

ATZ0
OK

OK

OK

wvdial结束命令并且第一个OK出现之后,一秒钟后两个OK将出现。另外我想注意一下ATZATQ0命令变得重叠了

我可能是通过cat劫持输出,这可能是原因,但无论是否有wvdial的行为都是相同的。

这是我的/etc/wvdial.conf

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

Modem Type = Analog Modem没有任何区别。如果我输入一些Init#参数,它们也不会得到任何响应。命令的重叠也会随Init#命令发生。

如在3G和GPRS调制解调器中指出的那样使用pppd导致仅使用pppd的抽象层也不起作用。显而易见的是,系统进程与串口的通信不是通过串口客户端进行的。

sakis3g与调制解调器成功通信但无法启动接口。

[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. 

即使我手动设置PDP上下文并将调制解调器设置在GPRS活动上下文中,结果也是一样的

AT+CIPSTATUS
IP STATUS

Answers:


1

阅读sakis3g日志和源代码我注意到必须使用nocrtscts带有此PL2303 USB串行转换器的ppp选项。此外,SIM800L不支持AT+FCLASS命令并使聊天脚本失败,所以我不得不删除它。

使用来自3G和GPRS调制解调器的聊天脚本和pppd我更改了一行:

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

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

AT+FCLASS用于选择传真模式。如果您的GSM模块甚至不支持此模式(或默认为0 - 数据模式),那么将该部分保留在聊天脚本之外似乎是安全的。


1

我已经将此问题追溯到RTS / CTS流量控制,其中libwvstreams(以及wvdial)默认使用,但我的微型USB串行加密狗不支持。

您可以在GitHub上使用我的补丁或在硬件中修复它。例如,如果您的加密狗具有RTS和CTS引脚(并且您的调制解调器没有),则可以将它们连接到彼此。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.