Page tree
Skip to end of metadata
Go to start of metadata

4G模块(LTE模块),可以用来连接到移动互联网络。PanGu开发板也支持4G模块,并且已经支持了多款模块的驱动,可以在安装连接后直接使用。4G模块有很厂商,但接口都是统一为Mini PCIe连接器。可以使用USB转Mini PCIe转接板来安装到PanGu板的USB host接口上,如下图。

当前已经支持如下4G模块型号

型号

USB VID/PID

厂商

通讯方式

安装方式

EC20CFD-512-STD

EC20CEHC-128-SNNS

2c7c:0125Quectel(移远)USBMini PCIe
ME909s-82112d1:15c1HUAWEI(华为)USBMini PCIe
EC20CEFAG-512-SGNS2c7c:0125Quectel(移远)USBMini PCIe
CLM920 AC31286:4e3cYUGA(域格)USBMini PCIe

以上型号的模块插入USB Host接口或连接至USB信号线后,系统后识别到模块,并出现对应的操作串口或网络设备。


移远EC20系列模块

PanGu开发板上,EC20模块使用QMI方式来拨号,可以获得更好的网络速度。

连接后,进入系统,使用lsusb可以看到已经识别到usb设备了,并且/dev下也有usb的串口。使用ifconfig可以看到有wwan0设备,说明QMI驱动也识别正常。

root@pangu:~# lsusb
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 2c7c:0125 Quectel Wireless Solutions Co., Ltd. EC25 LTE modem
Bus 001 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
root@pangu:~# ls /dev/ttyUSB*
/dev/ttyUSB0  /dev/ttyUSB1  /dev/ttyUSB2  /dev/ttyUSB3
root@pangu:~# ifconfig wwan0
wwan0     Link encap:Ethernet  HWaddr 26:A4:EA:8D:C1:2B
          BROADCAST NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

然后就可以使用quectel-CM命令来连接网络,连接后,可以看到获取到了网络IP地址和网关地址。

root@pangu:~# quectel-CM
[11-09_10:18:26:772] WCDMA<E_QConnectManager_Linux&Android_V1.1.34
[11-09_10:18:26:772] quectel-CM profile[1] = (null)/(null)/(null)/0, pincode = (null)
[11-09_10:18:26:774] Find /sys/bus/usb/devices/1-1.2 idVendor=2c7c idProduct=0125
[11-09_10:18:26:774] Find /sys/bus/usb/devices/1-1.2:1.4/net/wwan0
[11-09_10:18:26:774] Find usbnet_adapter = wwan0
[11-09_10:18:26:775] Find /sys/bus/usb/devices/1-1.2:1.4/usbmisc/cdc-wdm0
[11-09_10:18:26:775] Find qmichannel = /dev/cdc-wdm0
[11-09_10:18:26:805] cdc_wdm_fd = 7
[11-09_10:18:26:899] Get clientWDS = 19
[11-09_10:18:26:931] Get clientDMS = 1
[11-09_10:18:26:963] Get clientNAS = 3
[11-09_10:18:26:995] Get clientUIM = 1
[11-09_10:18:27:027] Get clientWDA = 1
[11-09_10:18:27:059] requestBaseBandVersion EC20CFDR02A08M4G  1  [Nov 30 2016 04:00:00]
[11-09_10:18:27:155] requestGetSIMStatus SIMStatus: SIM_READY
[11-09_10:18:27:187] requestGetProfile[1] 3gnet///0
[11-09_10:18:27:219] requestRegistrationState2 MCC: 460, MNC: 11, PS: Attached, DataCap: LTE
[11-09_10:18:27:251] requestQueryDataCall IPv4ConnectionStatus: DISCONNECTED
[11-09_10:18:27:315] requestRegistrationState2 MCC: 460, MNC: 11, PS: Attached, DataCap: LTE
[11-09_10:18:27:347] requestSetupDataCall WdsConnectionIPv4Handle: 0x8793db10
[11-09_10:18:27:411] requestQueryDataCall IPv4ConnectionStatus: CONNECTED
[11-09_10:18:27:444] ifconfig wwan0 up
[11-09_10:18:27:476] busybox udhcpc -f -n -q -t 5 -i wwan0
udhcpc: started, v1.29.2
udhcpc: sending discover
udhcpc: sending select for 10.63.239.243
udhcpc: lease of 10.63.239.243 obtained, lease time 7200
[11-09_10:18:27:951] /etc/udhcpc.d/50default: Adding DNS 61.134.1.6
[11-09_10:18:27:951] /etc/udhcpc.d/50default: Adding DNS 218.30.19.40


华为模块

PanGu开发板上,华为模块使用NDIS方式来拨号,可以获得更好的网络速度。

使用lsusb来查看是否识别到usb设备,查看是否有/dev/ttyUSB的设备和wwan0网络设备。

root@pangu:~# lsusb
Bus 001 Device 007: ID 12d1:15c1 Huawei Technologies Co., Ltd. ME906s LTE M.2 Module
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
root@pangu:~# ls /dev/ttyUSB*
/dev/ttyUSB0  /dev/ttyUSB1  /dev/ttyUSB2  /dev/ttyUSB3	/dev/ttyUSB4
root@pangu:~# ifconfig wwan0
wwan0     Link encap:Ethernet  HWaddr 02:1E:10:1F:00:00
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

华为模块的连接网络,需要先启用NDIS功能,然后使用udhcpc来获取网络地址。

root@pangu:~# ifconfig wwan0 up
root@pangu:~# echo "AT^NDISDUP=1,1" > /dev/ttyUSB0
root@pangu:~# udhcpc -i wwan0
udhcpc: started, v1.29.2
udhcpc: sending discover
udhcpc: sending select for 10.7.177.153
udhcpc: lease of 10.7.177.153 obtained, lease time 518400
/etc/udhcpc.d/50default: Adding DNS 61.134.1.6
/etc/udhcpc.d/50default: Adding DNS 218.30.19.40