参考链接:https://blog.csdn.net/ninwji/article/details/103099768
有个小需求,需要在一块Linux嵌入式板子上使用4G及GPS功能进行位置上报。
一、硬件
- 主板:Linux定制嵌入式板卡
- 模块:EC20CEFILG
二、体验过程
插入EC20硬件
将EC20CEFILG PCIE模块插入PCIE卡槽后,连接4G天线和GNSS天线后开机。
使用dmesg命令,查看硬件加载情况:
dmesg
[ 11.747441] usb 1-1: new high-speed USB device number 2 using ma35d1-ehci
[ 11.894571] usb 1-1: New USB device found, idVendor=2c7c, idProduct=0125, bcdDevice= 3.18
[ 11.902708] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 11.909818] usb 1-1: Product: EC20-CE-FILG
[ 11.913881] usb 1-1: Manufacturer: Quectel
[ 11.917950] usb 1-1: SerialNumber: 0123456789ABCDEF
[ 11.935489] qmi_wwan_q 1-1:1.4: cdc-wdm0: USB WDM device
[ 11.960213] qmi_wwan_q 1-1:1.4: Quectel EC20-CE-FILG work on RawIP mode
[ 11.969690] qmi_wwan_q 1-1:1.4: rx_urb_size = 1520
[ 11.976257] qmi_wwan_q 1-1:1.4 wwan0: register 'qmi_wwan_q' at usb-40140000.ehci-1, WWAN/QMI device, 12:7d:fb:97:63:31
[ 94.800995] usbcore: registered new interface driver cdc_ether
[ 94.831434] usbcore: registered new interface driver rndis_host
[ 94.921242] usbcore: registered new interface driver option
[ 94.926979] usbserial: USB Serial support registered for GSM modem (1-port)
[ 94.934542] option 1-1:1.0: GSM modem (1-port) converter detected
[ 94.941272] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0
[ 94.948969] option 1-1:1.1: GSM modem (1-port) converter detected
[ 94.956195] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
[ 94.969047] option 1-1:1.2: GSM modem (1-port) converter detected
[ 94.978339] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB2
[ 94.991078] option 1-1:1.3: GSM modem (1-port) converter detected
[ 95.004661] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB3
4G拨号
使用Linux嵌入式板卡上,定制的拨号程序拨号。
4g_server &
signal查看硬件信息
signal
移远AT命令,打开GPS功能
测试AT命令,若返回OK,则测试成功。
cat /dev/ttyUSB3 &
echo "AT" > /dev/ttyUSB3
打开GPS功能
echo "AT+QGPS=1" > /dev/ttyUSB3
GPS报文接收
cat /dev/ttyUSB1