1

我试图在我的嵌入式板上运行 pppd 守护进程。当我将调制解调器连接到 USB 并运行“pon provider”时,初始化是正确的(我得到了 IP 地址,在“ifconfig”中我有 ppp0 接口)

“提供者”文件:

ttyUSB0
115200
lock
crtscts
modem
passive
novj
defaultroute
noipdefault
usepeerdns
noauth
hide-password
persist
holdoff 10
maxfail 0
debug
connect "/usr/sbin/chat -v -t15 -f /etc/ppp/chatscripts/mobile-modem.chat"

“mobile-modem.chat”文件:

ABORT 'BUSY'
ABORT 'NO CARRIER'
ABORT 'VOICE'
ABORT 'NO DIALTONE'
ABORT 'NO DIAL TONE'
ABORT 'NO ANSWER'
ABORT 'DELAYED'
REPORT CONNECT
TIMEOUT 6
'' 'ATQ0'
'OK-AT-OK' 'ATZ'
TIMEOUT 3
'OK\d-AT-OK' 'ATI'
'OK' 'ATZ'
'OK' 'ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0'
'OK' @/etc/ppp/chatscripts/mode
'OK-AT-OK' 'AT+CGDCONT=1,"IP","myapn.pl"'
'OK' 'ATDT*99#'
TIMEOUT 30
CONNECT ''

但是,我想通过 RS232(ttyO1 或 ttyO2)在串行端口上运行 pppd。为此,我将 pppd 文件中的行从“ttyUSB0”更改为“/dev/ttyO2”。不幸的是,即使所有参数都相同,守护程序也不会建立连接,当然设备(ttyO2)除外。下面我粘贴来自“/var/log/messages”的日志。我该如何解决这个问题?(发送“AT ^ SYSCFG = 14,2,3fffffff, 0,1 ^ M ^ M”时的错误也是通过USB连接时出现的,不会导致连接错误)

daemon.notice pppd[1612]: pppd 2.4.7 started by root, uid 0
local2.info chat[1614]: abort on (BUSY)
local2.info chat[1614]: abort on (NO CARRIER)
local2.info chat[1614]: abort on (VOICE)
local2.info chat[1614]: abort on (NO DIALTONE)
local2.info chat[1614]: abort on (NO DIAL TONE)
local2.info chat[1614]: abort on (NO ANSWER)
local2.info chat[1614]: abort on (DELAYED)
local2.info chat[1614]: report (CONNECT)
local2.info chat[1614]: timeout set to 6 seconds
local2.info chat[1614]: send (ATQ0^M)
local2.info chat[1614]: expect (OK)
local2.info chat[1614]: ^M
local2.info chat[1614]: OK
local2.info chat[1614]:  -- got it
local2.info chat[1614]: send (ATZ^M)
local2.info chat[1614]: timeout set to 3 seconds
local2.info chat[1614]: expect (OKd)
local2.info chat[1614]: ^M
local2.info chat[1614]: ^M
local2.info chat[1614]: OK^M
local2.info chat[1614]: alarm
local2.info chat[1614]: send (AT^M)
local2.info chat[1614]: expect (OK)
local2.info chat[1614]: ^M
local2.info chat[1614]: OK
local2.info chat[1614]:  -- got it
local2.info chat[1614]: send (ATI^M)
local2.info chat[1614]: expect (OK)
local2.info chat[1614]: ^M
local2.info chat[1614]: ^M
local2.info chat[1614]: 332^M
local2.info chat[1614]: ^M
local2.info chat[1614]: OK
local2.info chat[1614]:  -- got it
local2.info chat[1614]: send (ATZ^M)
local2.info chat[1614]: expect (OK)
local2.info chat[1614]: ^M
local2.info chat[1614]: ^M
local2.info chat[1614]: OK
local2.info chat[1614]:  -- got it
local2.info chat[1614]: send (ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0^M)
local2.info chat[1614]: expect (OK)
local2.info chat[1614]: ^M
local2.info chat[1614]: ^M
local2.info chat[1614]: OK
local2.info chat[1614]:  -- got it
local2.info chat[1614]: send (AT\^SYSCFG=14,2,3fffffff,0,1^M)
local2.info chat[1614]: expect (OK)
local2.info chat[1614]: ^M
local2.info chat[1614]: AT^SYSCFG=14,2,3fffffff,0,1^M^M
local2.info chat[1614]: ERROR^M
local2.info chat[1614]: alarm
local2.info chat[1614]: send (AT^M)
local2.info chat[1614]: expect (OK)
local2.info chat[1614]: AT^M^M
local2.info chat[1614]: OK
local2.info chat[1614]:  -- got it
local2.info chat[1614]: send (AT+CGDCONT=1,"IP","myapn.pl"^M)
local2.info chat[1614]: expect (OK)
local2.info chat[1614]: ^M
local2.info chat[1614]: AT+CGDCONT=1,"IP","myapn.pl"^M^M
local2.info chat[1614]: OK
local2.info chat[1614]:  -- got it
local2.info chat[1614]: send (ATDT*99#^M)
local2.info chat[1614]: timeout set to 30 seconds
local2.info chat[1614]: expect (CONNECT)
local2.info chat[1614]: ^M
local2.info chat[1614]: alarm
local2.info chat[1614]: Failed
daemon.debug pppd[1612]: Script /usr/sbin/chat -v -t15 -f /etc/ppp/chatscripts/mobile-modem.chat finished (pid 1613), status = 0x3
daemon.err pppd[1612]: Connect script failed
4

1 回答 1

0

您已指示 pppdcrtscts在串行端口上启用 RTSCTS 硬件流控制 ( )。但是,您在调制解调器方面没有做同样的事情。虚拟USB串口的驱动可能会忽略这一点,而真正的串口则不会。

如果您打算使用 RTSCTS 流控制,请确保您已实际连接线路并在调制解调器端启用它(在 AT 手册中进行了描述)。如果没有,请在 pppd 配置中禁用它。

于 2021-03-23T11:29:03.107 回答