PPPD connection stops working in some seconds after startup

787 Views Asked by At

There is a Raspberry PI 3B+ device with SIM7000E GSM module attached via UART. The goal is to configure pppd to have Internet access from Raspberry PI.

Problem definition: PPPD with the configuration provided below successfully establishes connection to the mobile network, so Raspberry has the access to Internet and you can ping various domain names in Internet. However this connection works only 1-2 dozens of seconds and then Internet access gets unavailable. The connection still exists for some time regardless the Internet access gets unavailable.

The contents of /etc/ppp/peers/gprs file:

user "congstar"
password "cs"

connect "/usr/sbin/chat -v -f /etc/chatscripts/pap -T *99#"

# Serial device to which the modem is connected.
/dev/ttyAMA0

# Baudrate
115200

nocrtscts

debug

nodetach
ipcp-accept-local
ipcp-accept-remote

# Assumes that your IP address is allocated dynamically by the ISP.
noipdefault
# Try to get the name server addresses from the ISP.
usepeerdns
# Use this connection as the default route.
defaultroute

# Replaces the default route
replacedefaultroute

# Makes pppd "dial again" when the connection is lost.
persist

# Do not ask the remote to authenticate.
noauth

The contents of /etc/chatscripts/pap file:

#REPORT         CONNECT
ABORT           BUSY
ABORT           VOICE
ABORT           "NO CARRIER"
ABORT           "NO DIALTONE"
ABORT           "NO DIAL TONE"
""              ATZ
OK              AT+CGDCONT=1,"IP","internet.telekom","0.0.0.0",0,0
OK              ATDT\T
CONNECT         ""

I run pppd process with the command:

pppd call gprs

and it gives the output below:

Script /usr/sbin/chat -v -f /etc/chatscripts/pap -T *99# finished (pid 466), status = 0x0
Serial connection established.
using channel 1
Using interface ppp0
Connect: ppp0 <--> /dev/ttyAMA0
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xfa266a86> <pcomp> <accomp>]
rcvd [LCP ConfReq id=0x0 <asyncmap 0x0> <auth chap MD5> <magic 0xd0837b0a> <pcomp> <accomp>]
sent [LCP ConfAck id=0x0 <asyncmap 0x0> <auth chap MD5> <magic 0xd0837b0a> <pcomp> <accomp>]
rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0xfa266a86> <pcomp> <accomp>]
sent [LCP EchoReq id=0x0 magic=0xfa266a86]
rcvd [LCP DiscReq id=0x1 magic=0xd0837b0a]
rcvd [CHAP Challenge id=0x1 <ed30b6a62ef9f9424e0827f63f5233c0>, name = "UMTS_CHAP_SRVR"]
sent [CHAP Response id=0x1 <e1b557afa30e21d98517993f053097de>, name = "congstar"]
rcvd [LCP EchoRep id=0x0 magic=0xd0837b0a fa 26 6a 86]
rcvd [CHAP Success id=0x1 ""]
CHAP authentication succeeded
CHAP authentication succeeded
sent [CCP ConfReq id=0x1 <deflate 15> <deflate(old#) 15> <bsd v1 15>]
sent [IPCP ConfReq id=0x1 <compress VJ 0f 01> <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
rcvd [LCP ProtRej id=0x2 80 fd 01 01 00 0f 1a 04 78 00 18 04 78 00 15 03 2f]
Protocol-Reject for 'Compression Control Protocol' (0x80fd) received
rcvd [IPCP ConfReq id=0x0]
sent [IPCP ConfNak id=0x0 <addr 0.0.0.0>]
rcvd [IPCP ConfRej id=0x1 <compress VJ 0f 01>]
sent [IPCP ConfReq id=0x2 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
rcvd [IPCP ConfReq id=0x1]
sent [IPCP ConfAck id=0x1]
rcvd [IPCP ConfNak id=0x2 <addr 10.30.47.58> <ms-dns1 10.74.210.210> <ms-dns2 10.74.210.211>]
sent [IPCP ConfReq id=0x3 <addr 10.30.47.58> <ms-dns1 10.74.210.210> <ms-dns2 10.74.210.211>]
rcvd [IPCP ConfAck id=0x3 <addr 10.30.47.58> <ms-dns1 10.74.210.210> <ms-dns2 10.74.210.211>]
Could not determine remote IP address: defaulting to 10.64.64.64
local  IP address 10.30.47.58
remote IP address 10.64.64.64
primary   DNS address 10.74.210.210
secondary DNS address 10.74.210.211
Script /etc/ppp/ip-up started (pid 473)
Script /etc/ppp/ip-up finished (pid 473), status = 0x0


No response to 4 echo-requests
Serial link appears to be disconnected.
Connect time 1683.8 minutes.
Sent 11846 bytes, received 2597 bytes.
Script /etc/ppp/ip-down started (pid 644)
sent [LCP TermReq id=0x2 "Peer not responding"]
Script /etc/ppp/ip-down finished (pid 644), status = 0x0
sent [LCP TermReq id=0x3 "Peer not responding"]
Connection terminated.
Modem hangup

Necessary to mention:

  1. The behavior described above takes place only when the GSM module is attached to Raspberry PI via UART! When the GSM modem is attached to Raspberry PI via USB everything works fine with the same configuration (in this case /dev/ttyUSB2 is used instead of /dev/ttyAMA0 ) and the described problem is not observed.
  2. Raspberry PI uses primary UART /dev/ttyAMA0. It is configured to not use autobaudrate feature.
  3. Raspbian 10 is used and it has PPP support in the kernel.
0

There are 0 best solutions below