Skip to content
Advertisement

How to initialize pppd connection witsh RS232 modem?

I trying to run the pppd daemon on my embedded board. When I connect the modem to USB and run “pon provider” the initialization is correct (I get the IP address and in “ifconfig” I have ppp0 interface)

“provider” file:

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” file:

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
'OKd-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 ''

However, I would like to run pppd on the serial port over RS232 (ttyO1 or ttyO2). To do this, I changed the line in the pppd file from “ttyUSB0” to “/ dev / ttyO2”. Unfortunately, the daemon does not establish a connection even though all parameters are the same, except of course the device (ttyO2). Below I am pasting logs from “/ var / log / messages”. How could I solve this problem? (The error while sending “AT ^ SYSCFG = 14,2,3fffffff, 0,1 ^ M ^ M” also occurs when connecting via USB and does not cause a connection error)

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

Advertisement

Answer

You’ve instructed pppd to enable RTSCTS hardware flow control (crtscts) on the serial port. However, you’ve not done the same on the modem side. The driver of the virtual USB serial port probably ignores this, but a real serial port does not.

If using RTSCTS flow control is your intention, make sure you’ve actually connected the lines and enable it on modem side (described in the AT manual). If not, disable it in pppd config.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement