跳到主要内容

4G/5G 拨号

本文介绍Neardi 3399Pro、3568和3588型号Linux系统如何通过命令拨号。

拨号

  • Cmd

Quectel-CM Dial-UP

sudo quectel-CM

拨号成功结果如下:

neardi@LPA3588:~$ sudo quectel-CM
[11-12_07:37:05:736] QConnectManager_Linux_V1.6.5
[11-12_07:37:05:738] Find /sys/bus/usb/devices/7-1.4 idVendor=0x2c7c idProduct=0x125, bus=0x007, dev=0x004
[11-12_07:37:05:739] Auto find qmichannel = /dev/cdc-wdm0
[11-12_07:37:05:739] Auto find usbnet_adapter = wwan0
[11-12_07:37:05:740] netcard driver = qmi_wwan_q, driver version = V1.2.2
[11-12_07:37:05:740] Modem works in QMI mode
[11-12_07:37:05:776] cdc_wdm_fd = 7
[11-12_07:37:05:864] Get clientWDS = 7
[11-12_07:37:05:895] Get clientDMS = 1
[11-12_07:37:05:927] Get clientNAS = 2
[11-12_07:37:05:960] Get clientUIM = 1
[11-12_07:37:05:991] Get clientWDA = 1
[11-12_07:37:06:024] requestBaseBandVersion EC20CEFILGR06A11M1G
[11-12_07:37:06:152] requestGetSIMStatus SIMStatus: SIM_READY
[11-12_07:37:06:216] requestGetProfile[pdp:1 index:1] ///0/IPV4V6
[11-12_07:37:06:248] requestRegistrationState2 MCC: 460, MNC: 0, PS: Attached, DataCap: LTE
[11-12_07:37:06:279] requestQueryDataCall IPv4ConnectionStatus: DISCONNECTED
[11-12_07:37:06:279] ip addr flush dev wwan0
[11-12_07:37:06:292] ip link set dev wwan0 down
[11-12_07:37:06:376] requestSetupDataCall WdsConnectionIPv4Handle: 0x86d6e570
[11-12_07:37:06:504] ip link set dev wwan0 up
[11-12_07:37:06:526] busybox udhcpc -f -n -q -t 5 -i wwan0
udhcpc: started, v1.35.0
udhcpc: broadcasting discover
udhcpc: broadcasting select for 10.83.179.200, server 10.83.179.201
udhcpc: lease of 10.83.179.200 obtained from 10.83.179.201, lease time 7200
[11-12_07:37:06:758] ip -4 address flush dev wwan0
[11-12_07:37:06:771] ip -4 address add 10.83.179.200/28 dev wwan0
[11-12_07:37:06:785] ip -4 route add default via 10.83.179.201 dev wwan0

检查网络状态:

neardi@LPA3588:~$ ifconfig
wwan0: flags=193<UP,RUNNING,NOARP> mtu 1500
inet 10.83.179.200 netmask 255.255.255.240
inet6 fe80::8460:28ff:fe51:6483 prefixlen 64 scopeid 0x20<link>
ether 86:60:28:51:64:83 txqueuelen 1000 (Ethernet)
RX packets 4 bytes 764 (764.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 9 bytes 1088 (1.0 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

Pppd Dial-Up

sudo pppd call quectel-ppp

拨号成功结果如下:

neardi@LPA3588:~$ sudo pppd call quectel-ppp
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)
expect (OK)
^M
^M
Quectel^M
EC20F^M
Revision: EC20CEFILGR06A11M1G^M
^M
SubEdition: V03^M
^M
+CSQ: 25,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 1323), status = 0x0
Serial connection established.
using channel 1
Using interface ppp0
Connect: ppp0 <--> /dev/ttyUSB3
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xde5e50d7> <pcomp> <accomp>]
rcvd [LCP ConfReq id=0x0 <asyncmap 0x0> <auth chap MD5> <magic 0x5f6dedfe> <pcomp> <accomp>]
sent [LCP ConfAck id=0x0 <asyncmap 0x0> <auth chap MD5> <magic 0x5f6dedfe> <pcomp> <accomp>]
rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0xde5e50d7> <pcomp> <accomp>]
sent [LCP EchoReq id=0x0 magic=0xde5e50d7]
rcvd [LCP DiscReq id=0x1 magic=0x5f6dedfe]
rcvd [CHAP Challenge id=0x1 <1bb1fa5d3b1004edcf86e68f2a151b4e>, name = "UMTS_CHAP_SRVR"]
sent [CHAP Response id=0x1 <9956858d2cf569ada0e2a5c431cc2acd>, name = "test"]
rcvd [LCP EchoRep id=0x0 magic=0x5f6dedfe de 5e 50 d7]
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.67.100.99> <ms-dns1 211.136.150.86> <ms-dns2 211.136.150.88>]
sent [IPCP ConfReq id=0x2 <addr 10.67.100.99> <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.67.100.99> <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 wlan0 [192.168.31.1]
local IP address 10.67.100.99
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 1332)
Script /etc/ppp/ip-up finished (pid 1332), status = 0x0

检查网络状态:

neardi@LPA3588:~$ ifconfig
ppp0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500
inet 10.67.100.99 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

错误分析

拨号教程

已经拨号成功,使用一段时间后掉线,重新拨号不成功

  • 检查模块版本号是否为最新的。

  • 重新给拨号模块上线电,再拨号。

    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指令。