4G/5G 拨号
本文介绍Neardi 3399Pro、3568和3588型号Linux系统如何通过命令拨号。
安装工具包
安装usbutils
sudo apt update
sudo apt install usbutils
下载nd5g安装包
安装nd5g
sudo dpkg -i utilneardi-nd5g1.0_arm64.deb
检查是否安装成功
neardi@LPA3588:~$ dpkg --list | grep nd5g
ii nd5g 1.0-ubuntu20.04.neardi arm64 Neardi 4G/5G dial application.
拨号
sudo nd5g
拨号成功结果如下:
neardi@LPA3588:~$ sudo nd5g
[sudo] password for neardi:
Neardi 5G Dial APP
Dialing .... [ 8%]
Product Module: EC20F
Dialing ............. [ 25%] terminate called without an active exception
pppd options in effect:
debug # (from /etc/ppp/peers/quectel-ppp)
nodetach # (from /etc/ppp/peers/quectel-ppp)
dump # (from /etc/ppp/peers/quectel-ppp)
noauth # (from /etc/ppp/peers/quectel-ppp)
user test # (from /etc/ppp/peers/quectel-ppp)
password ?????? # (from /etc/ppp/peers/quectel-ppp)
remotename 3gppp # (from /etc/ppp/peers/quectel-ppp)
/dev/ttyUSB3 # (from /etc/ppp/peers/quectel-ppp)
115200 # (from /etc/ppp/peers/quectel-ppp)
lock # (from /etc/ppp/peers/quectel-ppp)
connect chat -s -v -f /etc/ppp/peers/quectel-chat-connect # (from /etc/ppp/peers/quectel-ppp)
disconnect chat -s -v -f /etc/ppp/peers/quectel-chat-disconnect # (from /etc/ppp/peers/quectel-ppp)
nocrtscts # (from /etc/ppp/peers/quectel-ppp)
modem # (from /etc/ppp/peers/quectel-ppp)
asyncmap 0 # (from /etc/ppp/options)
lcp-echo-failure 4 # (from /etc/ppp/options)
lcp-echo-interval 30 # (from /etc/ppp/options)
hide-password # (from /etc/ppp/peers/quectel-ppp)
novj # (from /etc/ppp/peers/quectel-ppp)
novjccomp # (from /etc/ppp/peers/quectel-ppp)
ipcp-accept-local # (from /etc/ppp/peers/quectel-ppp)
ipcp-accept-remote # (from /etc/ppp/peers/quectel-ppp)
ipparam 3gppp # (from /etc/ppp/peers/quectel-ppp)
noipdefault # (from /etc/ppp/peers/quectel-ppp)
ipcp-max-failure 30 # (from /etc/ppp/peers/quectel-ppp)
defaultroute # (from /etc/ppp/peers/quectel-ppp)
usepeerdns # (from /etc/ppp/peers/quectel-ppp)
noccp # (from /etc/ppp/peers/quectel-ppp)
noipx # (from /etc/ppp/options)
abort on (BUSY)
abort on (NO CARRIER)
abort on (NO DIALTONE)
abort on (ERROR)
abort on (NO ANSWER)
timeout set to 30 seconds
send (AT^M)
expect (OK)
AT^M^M
OK
-- got it
send (ATE0^M)
expect (OK)
^M
ATE0^M^M
OK
-- got it
send (ATI;+CSUB;+CSQ;+CPIN?;+COPS?;+CGREG?;&D2^M)
Aborted
neardi@LPA3588:~$ expect (OK)
^M
^M
Quectel^M
EC20F^M
Revision: EC20CEHDLGR06A09M1G^M
^M
SubEdition: V02^M
^M
+CSQ: 28,99^M
^M
+CPIN: READY^M
^M
+COPS: 0,0,"CHINA MOBILE",7^M
^M
+CGREG: 0,1^M
^M
OK
-- got it
send (AT+CGDCONT=1,"IP","3gnet",,0,0^M)
expect (OK)
^M
^M
OK
-- got it
send (ATD*99#^M)
expect (CONNECT)
^M
^M
CONNECT
-- got it
Script chat -s -v -f /etc/ppp/peers/quectel-chat-connect finished (pid 1196), status = 0x0
Serial connection established.
using channel 1
Using interface ppp0
Connect: ppp0 <--> /dev/ttyUSB3
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xee802559> <pcomp> <accomp>]
rcvd [LCP ConfReq id=0x0 <asyncmap 0x0> <auth chap MD5> <magic 0xedefdc5> <pcomp> <accomp>]
sent [LCP ConfAck id=0x0 <asyncmap 0x0> <auth chap MD5> <magic 0xedefdc5> <pcomp> <accomp>]
rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0xee802559> <pcomp> <accomp>]
sent [LCP EchoReq id=0x0 magic=0xee802559]
rcvd [LCP DiscReq id=0x1 magic=0xedefdc5]
rcvd [CHAP Challenge id=0x1 <1436f1b1197c6a49840b24da990dd01e>, name = "UMTS_CHAP_SRVR"]
sent [CHAP Response id=0x1 <15579b898bf2201094a906b200d961c0>, name = "test"]
rcvd [LCP EchoRep id=0x0 magic=0xedefdc5 ee 80 25 59]
rcvd [CHAP Success id=0x1 ""]
CHAP authentication succeeded
CHAP authentication succeeded
sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
rcvd [IPCP ConfReq id=0x0]
sent [IPCP ConfNak id=0x0 <addr 0.0.0.0>]
rcvd [IPCP ConfNak id=0x1 <addr 10.132.233.76> <ms-dns1 211.136.150.86> <ms-dns2 211.136.150.88>]
sent [IPCP ConfReq id=0x2 <addr 10.132.233.76> <ms-dns1 211.136.150.86> <ms-dns2 211.136.150.88>]
rcvd [IPCP ConfReq id=0x1]
sent [IPCP ConfAck id=0x1]
rcvd [IPCP ConfAck id=0x2 <addr 10.132.233.76> <ms-dns1 211.136.150.86> <ms-dns2 211.136.150.88>]
Could not determine remote IP address: defaulting to 10.64.64.64
not replacing default route to eth0 [192.168.1.1]
local IP address 10.132.233.76
remote IP address 10.64.64.64
primary DNS address 211.136.150.86
secondary DNS address 211.136.150.88
Script /etc/ppp/ip-up started (pid 1208)
Script /etc/ppp/ip-up finished (pid 1208), status = 0x0
查看网络状态:
neardi@LPA3588:~$ ifconfig
ppp0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500
inet 10.132.233.76 netmask 255.255.255.255 destination 10.64.64.64
ppp txqueuelen 3 (Point-to-Point Protocol)
RX packets 4 bytes 52 (52.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 4 bytes 58 (58.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
错误分析
现象一
neardi@LPA3588:~$ sudo nd5g
Neardi 5G Dial APP
Dialing ........ [ 15%]
Unknow module
Cannot find any 4G/5G modules!
Dialing ...................................................... [100%]
未找到4G/5G模块:检查购买时有没有选购4G/5G模块。
现象二
neardi@LPA3588:~$ sudo nd5g
[sudo] password for neardi:
Neardi 5G Dial APP
Dialing .... [ 8%]
Product Module: EC20F
Dialing ........ [ 15%]
No SIM card!
Dialing ...................................................... [100%]
未找到SIM卡:检查SIM是否插入、是否插好。
现象三
已经拨号成功,ping不同网络
检查天线是否接好、apn设置是否正确。
现象四
已经拨号成功,使用一段时间后掉线,重新拨号不成功
检查模块版本号是否为最新的。
重新给拨号模块上线电,再拨号。
RK3399Pro系列
echo 157 > /sys/class/gpio/export; echo out > /sys/class/gpio/gpio157/direction; //会掉电 echo 1 > /sys/class/gpio/gpio157/value; // 拉高上电
RK3568系列
echo 22 > /sys/class/gpio/export; echo out > /sys/class/gpio/gpio22/direction; //会掉电 echo 1 > /sys/class/gpio/gpio22/value; // 拉高上电
RK3588系列
echo 120 > /sys/class/gpio/export; echo out > /sys/class/gpio/gpio120/direction; //会掉电 echo 1 > /sys/class/gpio/gpio120/value; // 拉高上电
AT指令查询
说明 | AT指令 |
---|---|
查看网络是否注册成功 | echo -en "AT+QENG="SERVINGCELL"\r\n" > /dev/ttyUSB3 && cat /dev/ttyUSB3 |
查询sim卡是否正常 | echo -e "AT+CPIN?\r\n" > /dev/ttyUSB3 && cat /dev/ttyUSB3 |
查询sim卡网络激活状态 | echo -e "AT+CEREG?\r\n" > /dev/ttyUSB3 && cat /dev/ttyUSB3 |
确认sim卡系统状态 | echo -e "AT+CGDCONT?\r\n" > /dev/ttyUSB3 && cat /dev/ttyUSB3 |
查询sim卡序列号 | echo -e "AT+CGSN\r\n" > /dev/ttyUSB3 && cat /dev/ttyUSB3 |
查询sim卡固件版本 | echo -e "AT+CGMR\r\n" > /dev/ttyUSB3 && cat /dev/ttyUSB3 |
设置或查询终端错误报告 | echo -e "AT+CMEE\r\n" > /dev/ttyUSB3 && cat /dev/ttyUSB3 |
重启sim卡 | echo -e "AT+NRB\r\n" > /dev/ttyUSB3 && cat /dev/ttyUSB3 |
查询sim卡信号强度 | echo -e "AT+CSQ\r\n" > /dev/ttyUSB3 && cat /dev/ttyUSB3 |
更多资料
下载QuecOpen,包含更详细的AT指令。