我正在使用Raspberry Pi 4,并试图使用A9G的GSM/GPRS+GPS模块接入互联网。
首先,我用sudo apt-get install ppp screen elinks安装了ppp
我在路径/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路径"MY_4_DIGIT_PIN"中的
gprs中添加了需要我的gprs的行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我在syslog (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中写错了什么,或者是我做得不对。如果你有什么想法,请帮帮我。
发布于 2021-11-30 10:14:42
问题是我的A9G模块没有足够的电源。因此,在启动进程之前,请检查您的A9G模块是否打开,并确保您已经禁用了登录shell,以便通过串行访问,并且启用了串行接口。
https://stackoverflow.com/questions/69573587
复制相似问题