注意

这是最新开发分支配套的文档,可能包含已发布版本中尚未提供的功能。如果您要查看特定版本的文档,请使用左侧的下拉菜单并选择所需要的版本。

K230 4G模块linux移植参考#

ec200a 4G 模块介绍#

EC200A 系列是移远通信专为 M2M 和 IoT 领域设计的 LTE Cat 4 无线通信模块,支持usb转串口ppp,RNDIS,ECM三种联网模式。EC200a有5个usb接口,接口2-4需要适配 usb serial 驱动,通过 ttyUSB2 节点使用PPP拨号上网;接口0-1 需要适配 ECM/RNDIS驱动。

demesg看到的硬件信息#

dmesg看到类似下面打印(如果没有看到请检查硬件),可以看出idVendor=2c7c, idProduct=6005,

[    3.164090] usb 1-1: config 1 has an invalid interface number: 6 but max is 5
[    3.171285] usb 1-1: config 1 has no interface number 5
[    3.176872] usb 1-1: New USB device found, idVendor=2c7c, idProduct=6005, bcdDevice= 3.18
[    3.185112] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    3.192272] usb 1-1: Product: Android
[    3.195947] usb 1-1: Manufacturer: Android
[    3.200055] usb 1-1: SerialNumber: 0000
[    3.206045] cdc_ether 1-1:1.0 usb0: register 'cdc_ether' at usb-91500000.usb-otg-1, CDC Ethernet Device, 02:0c:29:a3:9b:6d
[    3.217948] option 1-1:1.2: GSM modem (1-port) converter detected
[    3.224776] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0
[    3.232473] option 1-1:1.3: GSM modem (1-port) converter detected
[    3.239214] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
[    3.246848] option 1-1:1.4: GSM modem (1-port) converter detected
[    3.253653] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB2
[    3.261388] option 1-1:1.6: GSM modem (1-port) converter detected

lsusb#

lsusb可以看到类似如下信息

[root@canaan ~ ]#lsusb
Bus 002 Device 002: ID 0bda:8152
Bus 001 Device 001: ID 1d6b:0002
Bus 001 Device 002: ID 2c7c:6005
Bus 002 Device 001: ID 1d6b:0002
[root@canaan ~ ]#

usb/devices查看ec200a信息#

[root@canaan ~ ]#mount -t debugfs none /sys/kernel/debug/
[root@canaan ~ ]#cat /sys/kernel/debug/usb/devices

T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=480  MxCh= 0
D:  Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=2c7c ProdID=6005 Rev= 3.18
S:  Manufacturer=Android
S:  Product=Android
S:  SerialNumber=0000
C:* #Ifs= 6 Cfg#= 1 Atr=e0 MxPwr=500mA
A:  FirstIf#= 0 IfCount= 2 Cls=02(comm.) Sub=06 Prot=00
I:* If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=06 Prot=00 Driver=cdc_ether
E:  Ad=87(I) Atr=03(Int.) MxPS=  64 Ivl=4096ms
I:  If#= 1 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether
I:* If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether
E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=0c(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=0b(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=0f(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=89(I) Atr=03(Int.) MxPS=  64 Ivl=4096ms
I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=0a(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=88(I) Atr=03(Int.) MxPS=  64 Ivl=4096ms
I:* If#= 6 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=0e(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms

内核态驱动修改#

USB Serial 驱动修改(必须修改)#

模块加载 USB 转串口 option 驱动程序后,在/dev 目录下创建 ttyUSB0、ttyUSB1 和 ttyUSB2 等设备文件。本节描述 USB 转串口 option 驱动需要进行的修改。

2.1.1 linux内核增加如下配置,修改方法请参考

CONFIG_USB_SERIAL
CONFIG_USB_SERIAL_OPTION
CONFIG_PPP=y
CONFIG_PPP_BSDCOMP=y
CONFIG_PPP_DEFLATE=y
CONFIG_PPP_FILTER=y
CONFIG_PPP_MPPE=y
CONFIG_PPP_MULTILINK=y
CONFIG_PPPOE=y
CONFIG_PPP_ASYNC=y
CONFIG_PPP_SYNC_TTY=y

2.1.2option增加VID和PID

//src/little/linux/drivers/usb/serial/option.c 的option_ids[]数组里面增加如下选项(大概583行)
{ USB_DEVICE_AND_INTERFACE_INFO(0x2c7c, 0x6005, 0xff, 0, 0) },

RNDIS/ECM 驱动修改#

linux内核增加如下配置,修改方法请参考

CONFIG_USB_NET_DRIVERS
CONFIG_USB_USBNET
CONFIG_USB_NET_RNDIS_HOST
CONFIG_USB_NET_CDCETHER
CONFIG_USB_NET_CDC_NCM

用户态pppd程序编译及配置#

备注:仅通过pppoe拨号上网(ppp模式)需要本章节

添加pppd程序#

buildroot增加如下配置:

BR2_PACKAGE_PPPD
BR2_PACKAGE_PPPD_FILTER
BR2_PACKAGE_PPPD_RADIUS

buildroot增加配置方法:

sdk主目录执行make buildroot-menuconfig ;

把需要增加的配置都配上,保存下配置;

make buildroot-savedefconfig;

添加ppp配置文件#

3.2.1sdk主目录创建目录:

mkdir board/common/post_copy_rootfs/etc/ppp
mkdir board/common/post_copy_rootfs/etc/ppp/peers

3.2.2创建board/common/post_copy_rootfs/etc/ppp/ip-up

board/common/post_copy_rootfs/etc/ppp/peers/quectel-pppd

board/common/post_copy_rootfs/etc/ppp/peers/quectel-chat-disconnect

board/common/post_copy_rootfs/etc/ppp/quectel-pppd.sh

board/common/post_copy_rootfs/etc/ppp/quectel-ppp-kill 文件,其内容如下:

#!/bin/sh
#board/common/post_copy_rootfs/etc/ppp/ip-up
if [ -f /etc/ppp/resolv.conf ]; then
    cp /etc/ppp/resolv.conf /etc/resolv.conf
elif [ -f /var/run/ppp/resolv.conf ]; then
    cp /var/run/ppp/resolv.conf /etc/resolv.conf
else
    echo nameserver $DNS1 > /etc/resolv.conf
    echo nameserver $DNS2 >> /etc/resolv.conf
fi
# /etc/ppp/peers/quectel-pppd
# Usage:root>pppd call quectel-pppd
#Modem path, like /dev/ttyUSB3,/dev/ttyACM0, depend on your module, default path is /dev/ttyUSB3
/dev/ttyUSB2 115200
#Insert the username and password for authentication, default user and password are test
user "test" password "test"
# The chat script, customize your APN in this file
connect 'chat -s -v -f /etc/ppp/peers/quectel-chat-connect'
# The close script
disconnect 'chat -s -v -f /etc/ppp/peers/quectel-chat-disconnect'
# Hide password in debug messages
hide-password
# The phone is not required to authenticate
noauth
# Debug info from pppd
debug
# If you want to use the HSDPA link as your gateway
defaultroute
# pppd must not propose any IP address to the peer
noipdefault
# No ppp compression
novj
novjccomp
noccp
ipcp-accept-local
ipcp-accept-remote
local
# For sanity, keep a lock on the serial line
lock
modem
dump
nodetach
# Hardware flow control
nocrtscts
remotename 3gppp
ipparam 3gppp
ipcp-max-failure 30
# Ask the peer for up to 2 DNS server addresses
usepeerdns
# /etc/ppp/peers/quectel-chat-disconnect
ABORT "ERROR"
ABORT "NO DIALTONE"
SAY "\nSending break to the modem\n"
""  +++
""  +++
""  +++
SAY "\nGoodbay\n"
#!/bin/sh
#/etc/ppp/quectel-pppd.sh

#quectel-pppd devname apn user password
echo "quectel-pppd options in effect:"
QL_DEVNAME=/dev/ttyUSB2
QL_APN=3gnet
QL_USER=user
QL_PASSWORD=passwd
if [ $# -ge 1 ]; then
    QL_DEVNAME=$1
    echo "devname   $QL_DEVNAME    # (from command line)"
else
    echo "devname   $QL_DEVNAME    # (default)"
fi
if [ $# -ge 2 ]; then
    QL_APN=$2
    echo "apn       $QL_APN    # (from command line)"
else
    echo "apn       $QL_APN    # (default)"
fi
if [ $# -ge 3 ]; then
    QL_USER=$3
    echo "user      $QL_USER   # (from command line)"
else
    echo "user      $QL_USER   # (default)"
fi
if [ $# -ge 4 ]; then
    QL_PASSWORD=$4
    echo "password  $QL_PASSWORD   # (from command line)"
else
    echo "password  $QL_PASSWORD   # (default)"
fi

CONNECT="'chat -s -v ABORT BUSY ABORT \"NO CARRIER\" ABORT \"NO DIALTONE\" ABORT ERROR ABORT \"NO ANSWER\" TIMEOUT 30 \
\"\" AT OK ATE0 OK ATI\;+CSUB\;+CSQ\;+CPIN?\;+COPS?\;+CGREG?\;\&D2 \
OK AT+CGDCONT=1,\\\"IP\\\",\\\"$QL_APN\\\",,0,0 OK ATD*99# CONNECT'"

pppd $QL_DEVNAME 115200 user "$QL_USER" password "$QL_PASSWORD" \
connect "'$CONNECT'" \
disconnect 'chat -s -v ABORT ERROR ABORT "NO DIALTONE" SAY "\nSending break to the modem\n" "" +++ "" +++ "" +++ SAY "\nGood bay\n"' \
noauth debug defaultroute noipdefault novj novjccomp noccp ipcp-accept-local ipcp-accept-remote ipcp-max-configure 30 local lock modem dump nodetach nocrtscts usepeerdns &
#!/bin/sh
#/etc/ppp/quectel-ppp-kill
timeout=5
killall -15 pppd
sleep 1
killall -0 pppd
while [ $? -eq 0 ]
do
    timeout=`expr $timeout - 1`
    if [ $timeout -eq 0 ]
    then
        exit 1
    fi
    sleep 1
    killall -0 pppd
done

if [ $? -ne 0 ]
then
    killall -9 pppd
fi

增加可执行权限

chmod a+x board/common/post_copy_rootfs/etc/ppp/ip-up
chmod a+x board/common/post_copy_rootfs/etc/ppp/peers/quectel-pppd
chmod a+x board/common/post_copy_rootfs/etc/ppp/peers/quectel-chat-disconnect
chmod a+x board/common/post_copy_rootfs/etc/ppp/quectel-pppd.sh
chmod a+x board/common/post_copy_rootfs/etc/ppp/quectel-ppp-kill

测试#

确认驱动是否加载正确#

执行cat /sys/kernel/debug/usb/devices 和dmesg 命令查看驱动是否加载正确,正确的打印类似如下:

[root@canaan ~ ]#mount -t debugfs none /sys/kernel/debug/
[root@canaan ~ ]#cat /sys/kernel/debug/usb/devices

T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=480  MxCh= 0
D:  Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=2c7c ProdID=6005 Rev= 3.18
S:  Manufacturer=Android
S:  Product=Android
S:  SerialNumber=0000
C:* #Ifs= 6 Cfg#= 1 Atr=e0 MxPwr=500mA
A:  FirstIf#= 0 IfCount= 2 Cls=02(comm.) Sub=06 Prot=00
I:* If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=06 Prot=00 Driver=cdc_ether
E:  Ad=87(I) Atr=03(Int.) MxPS=  64 Ivl=4096ms
I:  If#= 1 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether
I:* If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether
E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=0c(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=0b(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=0f(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=89(I) Atr=03(Int.) MxPS=  64 Ivl=4096ms
I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=0a(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=88(I) Atr=03(Int.) MxPS=  64 Ivl=4096ms
I:* If#= 6 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=0e(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms

ls /sys/bus/usb/drivers 可以看到驱动
[root@canaan ~ ]#ls /sys/bus/usb/drivers
asix          cdc_subset    net1080       rtl8150       zaurus
ax88179_178a  cdc_wdm       option        usb
catc          hub           pegasus       usb-storage
cdc_ether     kaweth        qmi_wwan      usbfs
cdc_ncm       lan78xx       r8152         usbhid rndis_host
[root@canaan ~ ]#


dmesg可以看到类似下面打印
[    3.164039] usb 1-1: config 1 has an invalid interface number: 6 but max is 5
[    3.171246] usb 1-1: config 1 has no interface number 5
[    3.176938] usb 1-1: New USB device found, idVendor=2c7c, idProduct=6005, bcdDevice= 3.18
[    3.185189] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    3.192350] usb 1-1: Product: Android
[    3.196026] usb 1-1: Manufacturer: Android
[    3.200151] usb 1-1: SerialNumber: 0000
[    3.206236] cdc_ether 1-1:1.0 usb0: register 'cdc_ether' at usb-91500000.usb-otg-1, CDC Ethernet Device, 02:0c:29:a3:9b:6d
[    3.218140] option 1-1:1.2: GSM modem (1-port) converter detected
[    3.224982] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0
[    3.232586] option 1-1:1.3: GSM modem (1-port) converter detected
[    3.239337] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
[    3.247057] option 1-1:1.4: GSM modem (1-port) converter detected
[    3.253786] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB2

测试AT功能#

可使用“minicom”或“busybox microcom”等 UART 工具来测试 AT 功能。

[root@canaan ~ ]#microcom -t 10000 -s 115200 /dev/ttyUSB2
at+cpin?;+csq;+cops?
+CSQ: 31,99

+CME ERROR: 10

+COPS: 0

RNDIS/ECM模式网络测试#

3.3.1模块工作模式设置

如果是ECM模式执行下面命令:
echo -e "AT+QCFG=\"usbnet\",1\n\n;AT+CFUN=1,1\n\n" > /dev/ttyUSB2 ;sleep 15;
如果是RNDIS模式
echo -e "AT+QCFG=\"usbnet\",3\n\n;AT+CFUN=1,1\n\n" > /dev/ttyUSB2 ;sleep 15;

备注:设置完后需要等待模块重启,重启后才会加载正确的驱动,上面at指令含义如下:

AT+QCFG=”usbnet”,1; // 设置模式

at+cfun=1,1 //重启模块

AT+QCFG=”usbnet” //查询模式

AT+qnetdevctl=3,1,1 //拨号;

3.3.2拨号

echo -e "AT+qnetdevctl=3,1,1\n\n" > /dev/ttyUSB2

3.3.3获取ip地址

[root@canaan ~ ]#ifconfig eth0 down; udhcpc -i usb0; ifconfig;
udhcpc: started, v1.33.0
udhcpc: sending discover
udhcpc: sending select for 10.232.182.16
udhcpc: lease of 10.232.182.16 obtained, lease time 86400
deleting routers
adding dns 183.230.126.225
adding dns 183.230.126.224

3.3.4测试网络

[root@canaan ~ ]#ping -I usb0 www.163.com
PING www.163.com (111.13.104.117): 56 data bytes
64 bytes from 111.13.104.117: seq=0 ttl=55 time=45.732 ms
64 bytes from 111.13.104.117: seq=1 ttl=55 time=46.759 ms
^C
--- www.163.com ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 45.732/46.245/46.759 ms
[root@canaan ~ ]#

ppp模式网络测试#

3.4.1拨号

ifconfig eth0 down
/etc/ppp/quectel-ppp-kill
/etc/ppp/quectel-pppd.sh  /dev/ttyUSB2 CMNET

3.4.2测试

ifconfig
ping www.163.com

ec20ce模块信息#

[root@canaan ~ ]#ls /sys/bus/usb/drivers
asix          cdc_ncm       lan78xx       r8152         usb-storage
ax88179_178a  cdc_subset    net1080       rndis_host    usbfs
catc          hub           option        rtl8150       usbhid
cdc_ether     kaweth        pegasus       usb           zaurus
[root@canaan ~ ]#
[root@canaan ~ ]#lsusb
Bus 002 Device 002: ID 2c7c:0125
Bus 001 Device 001: ID 1d6b:0002
Bus 002 Device 001: ID 1d6b:0002
[root@canaan ~ ]#

[root@canaan ~ ]#cat /sys/kernel/debug/usb/devices

T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480  MxCh= 1
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0002 Rev= 5.10
S:  Manufacturer=Linux 5.10.4 dwc2_hsotg
S:  Product=DWC OTG Controller
S:  SerialNumber=91500000.usb-otg
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms

T:  Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480  MxCh= 1
B:  Alloc=  0/800 us ( 0%), #Int= 70, #Iso=  0
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0002 Rev= 5.10
S:  Manufacturer=Linux 5.10.4 dwc2_hsotg
S:  Product=DWC OTG Controller
S:  SerialNumber=91540000.usb-otg
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms

T:  Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=480  MxCh= 0
D:  Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=2c7c ProdID=0125 Rev= 3.18
S:  Manufacturer=Android
S:  Product=Android
C:* #Ifs= 5 Cfg#= 1 Atr=a0 MxPwr=500mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=83(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=85(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=87(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
E:  Ad=89(I) Atr=03(Int.) MxPS=   8 Ivl=32ms
E:  Ad=88(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
[root@canaan ~ ]#
#节点信息:
#ttyUSB0---diag
##ttyUSB1---gnss
##ttyUSB2---at command
##ttyUSB3---modem

at指令

microcom -t 20000 /dev/ttyUSB2  # ctrl+x 退出;
echo "7" > /proc/sys/kernel/printk
AT+QCFG="usbnet",1  # 设置模式
at+cfun=1,1 #重启模块 ec200a需要;
AT+QCFG="usbnet" #查询模式
AT+QCFG=? #查询
AT+qnetdevctl=3,1,1  #拨号;ec200a需要
#./tools_4g_init /dev/ttyUSB2 AT+QCFG=\"usbnet\"
#./tools_4g_init /dev/ttyUSB2  AT+QCFG=\"usbnet\",1
#./tools_4g_init /dev/ttyUSB2 ATI

参考资料#

《Quectel_UMTS_LTE_5G_Linux_USB_Driver_用户指导》

《Quectel_LTE_Standard(A)系列_AT命令手册_V1.1》

https://doc.embedfire.com/linux/rk356x/quick_start/zh/latest/quick_start/wireless/4g/4g.html#quectel-cm

turmary/linux-ppp-scripts

评论列表
条评论
登录