我正在尝试通过 ppp 设置 SIM7000E。 SIM7000E 通过 micro USB 线连接至 beaglebone black。 Beaglebone 使用 5.10.168-ti-r71 内核 (Debian)。 SIM7000E驱动程序已成功安装,ppp也已安装。
我进入目录 /etc/ppp/peers,复制文件提供程序并将其命名为 gprs。 Gprs 文件如下所示:
# example configuration for a dialup connection authenticated with PAP or CHAP
#
# This is the default configuration used by pon(1) and poff(1).
# See the manual page pppd(8) for information on all the options.
# MUST CHANGE: replace myusername@realm with the PPP login name given to
# your by your provider.
# There should be a matching entry with the password in /etc/ppp/pap-secrets
# and/or /etc/ppp/chap-secrets.
user "myusername@realm"
# MUST CHANGE: replace ******** with the phone number of your provider.
# The /etc/chatscripts/pap chat script may be modified to change the
# modem initialization string.
connect "/usr/sbin/chat -v -f /etc/chatscripts/gprs"
# Serial device to which the modem is connected.
/dev/ttyUSB2
# Speed of the serial line.
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
# Makes pppd "dial again" when the connection is lost.
persist
# Do not ask the remote to authenticate.
noauth
然后,当我尝试通过键入以下内容来调用 gprs 时:pppd call gprs
结果是这样的:
Script /usr/sbin/chat -v -f /etc/chatscripts/gprs finished (pid 1186), status = 0x0
Serial connection established.
using channel 2
Using interface ppp0
Connect: ppp0 <--> /dev/ttyUSB2
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xf0cd2f0e> ]
rcvd [LCP ConfReq id=0x4 <asyncmap 0x0> <magic 0xd0a7832b> ]
sent [LCP ConfNak id=0x4 ]
rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0xf0cd2f0e> ]
rcvd [LCP ConfReq id=0x5 <asyncmap 0x0> <magic 0xd0a7832b> ]
sent [LCP ConfAck id=0x5 <asyncmap 0x0> <magic 0xd0a7832b> ]
sent [LCP EchoReq id=0x0 magic=0xf0cd2f0e]
sent [PAP AuthReq id=0x1 user="myusername@realm" password=]
rcvd [LCP DiscReq id=0x6 magic=0xd0a7832b]
rcvd [LCP EchoRep id=0x0 magic=0xd0a7832b f0 cd 2f 0e]
rcvd [PAP AuthAck id=0x1 ""]
PAP 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>]
sent [IPV6CP ConfReq id=0x1 ]
rcvd [LCP ProtRej id=0x7 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
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>]
sent [IPV6CP ConfReq id=0x1 ]
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>]
sent [IPV6CP ConfReq id=0x1 ]
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>]
sent [IPV6CP ConfReq id=0x1 ]
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>]
sent [IPV6CP ConfReq id=0x1 ]
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>]
sent [IPV6CP ConfReq id=0x1 ]
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>]
sent [IPV6CP ConfReq id=0x1 ]
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>]
sent [IPV6CP ConfReq id=0x1 ]
sent [LCP EchoReq id=0x1 magic=0xf0cd2f0e]
IPCP: timeout sending Config-Requests
IPV6CP: timeout sending Config-Requests
sent [LCP TermReq id=0x2 "No network protocols running"]
sent [LCP TermReq id=0x3 "No network protocols running"]
Connection terminated.
Modem hangup
我不明白问题出在哪里。有人能帮忙吗?
/etc/chatscripts/gprs 包含:
# You can use this script unmodified to connect to cellular networks.
# The APN is specified in the peers file as the argument of the -T command
# line option of chat(8).
# For details about the AT commands involved please consult the relevant
# standard: 3GPP TS 27.007 - AT command set for User Equipment (UE).
# (http://www.3gpp.org/ftp/Specs/html-info/27007.htm)
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=1234"
# +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 ""
我更改了 /etc/ppp/peers 中的 gprs 文件并添加了以下内容:
connect "/usr/sbin/chat -v -f /etc/chatscripts/gprs" -T internet.vodafone.gr
我再次尝试拨打gprs,结果是这样的
Script /usr/sbin/chat -v -f /etc/chatscripts/gprs -T internet.vodafone.gr finished (pid 3457), status = 0x0
Serial connection established.
using channel 27
Using interface ppp0
Connect: ppp0 <--> /dev/ttyUSB2
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x7969ae32> <pcomp> <accomp>]
rcvd [LCP ConfReq id=0x0 <asyncmap 0x0> <auth chap MD5> <magic 0xd16a9755> <pcomp> <accomp>]
sent [LCP ConfNak id=0x0 <auth pap>]
rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0x7969ae32> <pcomp> <accomp>]
rcvd [LCP ConfReq id=0x1 <asyncmap 0x0> <auth pap> <magic 0xd16a9755> <pcomp> <accomp>]
sent [LCP ConfAck id=0x1 <asyncmap 0x0> <auth pap> <magic 0xd16a9755> <pcomp> <accomp>]
sent [LCP EchoReq id=0x0 magic=0x7969ae32]
sent [PAP AuthReq id=0x1 user="myusername@realm" password=<hidden>]
rcvd [LCP DiscReq id=0x2 magic=0xd16a9755]
rcvd [LCP EchoRep id=0x0 magic=0xd16a9755 79 69 ae 32]
rcvd [PAP AuthAck id=0x1 ""]
PAP 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>]
sent [IPV6CP ConfReq id=0x1 <addr fe80::7183:7bdb:7541:1ed2>]
rcvd [LCP ProtRej id=0x3 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
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>]
sent [IPV6CP ConfReq id=0x1 <addr fe80::7183:7bdb:7541:1ed2>]
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>]
sent [IPV6CP ConfReq id=0x1 <addr fe80::7183:7bdb:7541:1ed2>]
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>]
sent [IPV6CP ConfReq id=0x1 <addr fe80::7183:7bdb:7541:1ed2>]
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>]
sent [IPV6CP ConfReq id=0x1 <addr fe80::7183:7bdb:7541:1ed2>]
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>]
sent [IPV6CP ConfReq id=0x1 <addr fe80::7183:7bdb:7541:1ed2>]
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>]
sent [IPV6CP ConfReq id=0x1 <addr fe80::7183:7bdb:7541:1ed2>]
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>]
sent [IPV6CP ConfReq id=0x1 <addr fe80::7183:7bdb:7541:1ed2>]
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>]
sent [IPV6CP ConfReq id=0x1 <addr fe80::7183:7bdb:7541:1ed2>]
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>]
sent [IPV6CP ConfReq id=0x1 <addr fe80::7183:7bdb:7541:1ed2>]
sent [LCP EchoReq id=0x1 magic=0x7969ae32]
IPCP: timeout sending Config-Requests
IPV6CP: timeout sending Config-Requests
sent [LCP TermReq id=0x2 "No network protocols running"]
sent [LCP TermReq id=0x3 "No network protocols running"]
Connection terminated.
Modem hangup
然后我更改了 /etc/chatscripts/gprs 文件并放入我的 sim 卡的 PIN 码,删除了 # 符号。再次调用gprs,现在的结果是这样的:
Script /usr/sbin/chat -v -f /etc/chatscripts/gprs -T internet.vodafone.gr finished (pid 3473), status = 0x0
Serial connection established.
using channel 28
Using interface ppp0
Connect: ppp0 <--> /dev/ttyUSB2
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xc95e726d> <pcomp> <accomp>]
rcvd [LCP ConfReq id=0x4 <asyncmap 0x0> <auth chap MD5> <magic 0xd172abe9> <pcomp> <accomp>]
sent [LCP ConfNak id=0x4 <auth pap>]
rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0xc95e726d> <pcomp> <accomp>]
rcvd [LCP ConfReq id=0x5 <asyncmap 0x0> <auth pap> <magic 0xd172abe9> <pcomp> <accomp>]
sent [LCP ConfAck id=0x5 <asyncmap 0x0> <auth pap> <magic 0xd172abe9> <pcomp> <accomp>]
sent [LCP EchoReq id=0x0 magic=0xc95e726d]
sent [PAP AuthReq id=0x1 user="myusername@realm" password=<hidden>]
rcvd [LCP DiscReq id=0x6 magic=0xd172abe9]
rcvd [LCP EchoRep id=0x0 magic=0xd172abe9 c9 5e 72 6d]
rcvd [PAP AuthAck id=0x1 ""]
PAP 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>]
sent [IPV6CP ConfReq id=0x1 <addr fe80::9012:64df:a80b:4d3f>]
rcvd [LCP ProtRej id=0x7 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 ConfNak id=0x1 <ms-dns1 10.11.12.13> <ms-dns2 10.11.12.14> <ms-wins 10.11.12.13> <ms-wins 10.11.12.14>]
sent [IPCP ConfReq id=0x2 <compress VJ 0f 01> <addr 0.0.0.0> <ms-dns1 10.11.12.13> <ms-dns2 10.11.12.14> <ms-wins 10.11.12.13> <ms-wins 10.11.12.14>]
Modem hangup
Connection terminated.
换句话说,我没有收到“没有正在运行的网络协议”消息。
答案1
您pppd
发送配置压缩的请求,指定 Deflate 和 BSD 压缩的两种变体:
sent [CCP ConfReq id=0x1 <deflate 15> <deflate(old#) 15> <bsd v1 15>]
远端完全拒绝压缩请求:
rcvd [LCP ProtRej id=0x7 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
此后,远端完全停止响应。显然“压缩”对它来说是一个陌生的概念,一旦提到它就无法继续连接协商:-/
尝试将关键字或两者都添加nodeflate
到nobsdcomp
您的末尾/etc/ppp/peers/gprs
,每行一个关键字。
另一个可能的问题可能是 IPv6:除非您的移动网络提供商已证明绝对支持 IPv6,否则如果发现远程端可能存在一些在请求 IPv6 时触发的错误,我不会感到太惊讶。尝试添加noipv6
.
或者,如果您的移动网络提供商提供仅限 IPv6(我个人没有见过这种情况,但显然在某些 IPv4 地址短缺更严重的国家可能会发生这种情况),那么您可以尝试添加noip
:如果 IPv6 是唯一可用的,那么远程端可能会配置为完全拒绝任何请求 IPv4 的连接尝试。
不要同时添加两者noipv6
,noip
否则连接将几乎毫无用处:仅添加其中之一。
但如果 SIM7000E 根本没有注册到网络,那么这可能就是问题的根本原因。
您希望使用该选项/etc/chatscript/gprs
获取为命令指定的 APN 名称,但目前您没有提供该名称。例如,如果您应使用的 APN 名称(与您的提供商核实)是,请在您的 中更改此行:chat
-T
internet
/etc/ppp/peers/gprs
connect "/usr/sbin/chat -v -f /etc/chatscripts/gprs"
对此:
connect "/usr/sbin/chat -v -f /etc/chatscripts/gprs -T internet"