PPPD 连接脚本失败
PPPD Connect script failed
我正在使用 Raspberry Pi 4 并尝试使用 A9G GSM/GPRS+GPS 模块访问互联网。
起初我安装了 ppp
和 sudo apt-get install ppp screen elinks
我在路径 /etc/ppp/peers/rnet
:
中创建了一个名称为 rnet
的文件
# My APN internet.vodafone.gr
connect "/usr/sbin/chat -v -f /etc/chatscripts/gprs -T internet.vodafone.gr"
# Communication port:
/dev/ttyS0
# Baudrate
9600
# 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 to the internet.
defaultroute
# Makes PPPD "dial again" when the connection is lost.
persist
# Do not ask the remote to authenticate.
noauth
# No hardware flow control on the serial link with GSM Modem
nocrtscts
# No modem control lines with GSM Modem
local
- 在路径
/etc/chatscripts/gprs
的文件 gprs
中,我添加了需要 "MY_4_DIGIT_PIN": 的行
ABORT BUSY
ABORT VOICE
ABORT "NO CARRIER"
ABORT "NO DIALTONE"
ABORT "NO DIAL TONE"
ABORT "NO ANSWER"
ABORT "DELAYED"
ABORT "ERROR"
# cease if the modem is not attached to the network yet
ABORT "+CGATT: 0"
"" AT
TIMEOUT 12
OK ATH
OK ATE1
# +CPIN provides the SIM card PIN
OK AT+CPIN="MY_4_DIGIT_PIN"
# +CFUN may allow to configure the handset to limit operations to
# GPRS/EDGE/UMTS/etc to save power, but the arguments are not standard
# except for 1 which means "full functionality".
#OK AT+CFUN=1
OK AT+CGDCONT=1,"IP","\T","",0,0
OK ATD*99#
TIMEOUT 22
CONNECT ""
所以当我尝试启动 rnet
文件时:
sudo pon rnet
我在系统日志中收到此错误消息 (cat /var/log/syslog | grep pppd
):
Oct 14 18:14:22 raspberrypi pppd[3063]: pppd 2.4.7 started by pi, uid 0
Oct 14 18:14:35 raspberrypi pppd[3063]: Connect script failed
Oct 14 18:15:06 raspberrypi pppd[3063]: Connect script failed
Oct 14 18:15:37 raspberrypi pppd[3063]: Connect script failed
...
当我尝试运行下面的 AT 命令时,模块似乎工作正常并且能够连接到网络:
AT
OK
AT+CPIN?
+CPIN:READY
OK
AT+CREG?
+CREG: 1,1
OK
AT+CGATT?
+CGATT:1
OK
AT+COPS?
+COPS: 0,2,"20205"
AT+CGACT?
+CGACT: 1, 1
AT+HTTPGET="http://www.example.com/"
OK
HTTP/1.1 200 OK
...
所以我无法理解是我在文件 rnet
中写错了什么,还是我没有做对。如果您有任何想法,请帮助我。
问题是我的 A9G 模块没有获得足够的电力。
因此,在开始该过程之前,请检查您的 A9G 模块是否已打开
并确保您已禁用登录 shell 以通过串行访问,
并且您还启用了串行接口。
我正在使用 Raspberry Pi 4 并尝试使用 A9G GSM/GPRS+GPS 模块访问互联网。
起初我安装了
ppp
和sudo apt-get install ppp screen elinks
我在路径
中创建了一个名称为/etc/ppp/peers/rnet
:rnet
的文件
# My APN internet.vodafone.gr
connect "/usr/sbin/chat -v -f /etc/chatscripts/gprs -T internet.vodafone.gr"
# Communication port:
/dev/ttyS0
# Baudrate
9600
# 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 to the internet.
defaultroute
# Makes PPPD "dial again" when the connection is lost.
persist
# Do not ask the remote to authenticate.
noauth
# No hardware flow control on the serial link with GSM Modem
nocrtscts
# No modem control lines with GSM Modem
local
- 在路径
/etc/chatscripts/gprs
的文件gprs
中,我添加了需要 "MY_4_DIGIT_PIN": 的行
ABORT BUSY
ABORT VOICE
ABORT "NO CARRIER"
ABORT "NO DIALTONE"
ABORT "NO DIAL TONE"
ABORT "NO ANSWER"
ABORT "DELAYED"
ABORT "ERROR"
# cease if the modem is not attached to the network yet
ABORT "+CGATT: 0"
"" AT
TIMEOUT 12
OK ATH
OK ATE1
# +CPIN provides the SIM card PIN
OK AT+CPIN="MY_4_DIGIT_PIN"
# +CFUN may allow to configure the handset to limit operations to
# GPRS/EDGE/UMTS/etc to save power, but the arguments are not standard
# except for 1 which means "full functionality".
#OK AT+CFUN=1
OK AT+CGDCONT=1,"IP","\T","",0,0
OK ATD*99#
TIMEOUT 22
CONNECT ""
所以当我尝试启动 rnet
文件时:
sudo pon rnet
我在系统日志中收到此错误消息 (cat /var/log/syslog | grep pppd
):
Oct 14 18:14:22 raspberrypi pppd[3063]: pppd 2.4.7 started by pi, uid 0
Oct 14 18:14:35 raspberrypi pppd[3063]: Connect script failed
Oct 14 18:15:06 raspberrypi pppd[3063]: Connect script failed
Oct 14 18:15:37 raspberrypi pppd[3063]: Connect script failed
...
当我尝试运行下面的 AT 命令时,模块似乎工作正常并且能够连接到网络:
AT
OK
AT+CPIN?
+CPIN:READY
OK
AT+CREG?
+CREG: 1,1
OK
AT+CGATT?
+CGATT:1
OK
AT+COPS?
+COPS: 0,2,"20205"
AT+CGACT?
+CGACT: 1, 1
AT+HTTPGET="http://www.example.com/"
OK
HTTP/1.1 200 OK
...
所以我无法理解是我在文件 rnet
中写错了什么,还是我没有做对。如果您有任何想法,请帮助我。
问题是我的 A9G 模块没有获得足够的电力。 因此,在开始该过程之前,请检查您的 A9G 模块是否已打开 并确保您已禁用登录 shell 以通过串行访问, 并且您还启用了串行接口。