raspberry-pi - PPPD 连接脚本失败
问题描述
我正在使用 Raspberry Pi 4 并尝试使用 A9G GSM/GPRS+GPS 模块访问 Internet。
起初我已经安装
ppp
了sudo apt-get install ppp screen elinks
我
rnet
在路径中创建了一个名称为的文件/etc/ppp/peers/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
gprs
在路径中的文件中,/etc/chatscripts/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
我在 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
东西,或者是我做错了什么。如果您有任何想法,请帮助我。
解决方案
问题是我的 A9G 模块没有得到足够的电力。因此,在开始该过程之前检查您的 A9G 模块是否已打开,并确保您已禁用可通过串行访问的登录 shell,并且您已启用串行接口。
推荐阅读
- c# - 如何检查我的计算机上是否正在使用 C# 运行关闭进程?
- javascript - “TypeError: undefined is not an object (evalating '_expo.default.Font')]”在异步加载字体时遇到此错误
- c# - 如何在不获得锁定响应的情况下继续使用 TPM 签署数据?
- swift - 展开为时间戳时文档时间戳字段抛出错误
- terminal - zsh 不更新 vcs_info
- java - 如何从 json 数组中读取特定的 json 对象元素?
- angular - 如何在不订阅的情况下等待异步管道完成并在之后调用另一个函数
- aws-documentdb-mongoapi - 即使使用 maxTimeMS:0,DocumentDB 长时间运行的查询也会超时
- wagtail - Wagtail 多站点设置中的每个站点都有一个 404
- nginx - 处理海量数据API-PLATFORM