设置 | 登录 | 注册

目前共有33篇帖子。

移远EC200A模块linux usb驱动包下载地址

1楼 巨大八爪鱼 2025-12-18 20:04
Quectel_LTE&5G_Linux_USB_Driver_V1.0
2楼 巨大八爪鱼 2025-12-19 15:42

编译Quectel_LTE5G_Linux_USB_Driver_V1.0-5/Quectel_Linux_USB_Serial_Option_Driver_V1.0/v5.3.1前需要开启的内核选项(./build.sh kernel-config):
Device Drivers  --->  [*] USB support  --->  <*>   USB Serial Converter support

 

编译Quectel_LTE5G_Linux_USB_Driver_V1.0-5/Quectel_LinuxAndroid_QMI_WWAN_Driver_V1.1前需要开启的内核选项:
Device Drivers  --->  [*] USB support  --->  <*>   USB Wireless Device Management support

 

3楼 巨大八爪鱼 2025-12-19 15:49

编译结果:

cd /home/oct1158/Documents/Code/C/Quectel_LTE5G_Linux_USB_Driver_V1.0-5
mkdir output
cd output
cp ../Quectel_LinuxAndroid_GobiNet_Driver_V1.6/GobiNet.ko .
cp ../Quectel_Linux_USB_Serial_Option_Driver_V1.0/v5.3.1/drivers/usb/serial/option.ko .
cp ../Quectel_Linux_USB_Serial_Option_Driver_V1.0/v5.3.1/drivers/usb/serial/qcserial.ko .
cp ../Quectel_Linux_USB_Serial_Option_Driver_V1.0/v5.3.1/drivers/usb/serial/usb_wwan.ko .
cp ../Quectel_LinuxAndroid_QMI_WWAN_Driver_V1.1/qmi_wwan_q.ko .
cp ../quectel-CM/quectel-CM .
cp ../quectel-CM/quectel-qmi-proxy .

4楼 巨大八爪鱼 2025-12-19 16:19

上传到开发板:

adb push "\\Oct1158-ubuntu\oct1158\Documents\Code\C\Quectel_LTE5G_Linux_USB_Driver_V1.0-5\output\GobiNet.ko" /root

adb push "\\Oct1158-ubuntu\oct1158\Documents\Code\C\Quectel_LTE5G_Linux_USB_Driver_V1.0-5\output\option.ko" /root

adb push "\\Oct1158-ubuntu\oct1158\Documents\Code\C\Quectel_LTE5G_Linux_USB_Driver_V1.0-5\output\qcserial.ko" /root

adb push "\\Oct1158-ubuntu\oct1158\Documents\Code\C\Quectel_LTE5G_Linux_USB_Driver_V1.0-5\output\usb_wwan.ko" /root

adb push "\\Oct1158-ubuntu\oct1158\Documents\Code\C\Quectel_LTE5G_Linux_USB_Driver_V1.0-5\output\qmi_wwan_q.ko" /root

adb push "\\Oct1158-ubuntu\oct1158\Documents\Code\C\Quectel_LTE5G_Linux_USB_Driver_V1.0-5\output\quectel-CM" /root

adb push "\\Oct1158-ubuntu\oct1158\Documents\Code\C\Quectel_LTE5G_Linux_USB_Driver_V1.0-5\output\quectel-qmi-proxy" /root

adb shell chmod +x /root/quectel-CM

adb shell chmod +x /root/quectel-qmi-proxy


在开发板上插入:

insmod GobiNet.ko

insmod usb_wwan.ko

insmod option.ko

insmod qcserial.ko

insmod qmi_wwan_q.ko

巨大八爪鱼option.c、qcserial.c和usb_wwan.c这三个文件,瑞芯微SDK的linux内核里面Luckfox_Nova_SDK_250430/kernel/drivers/usb/serial本来就有,默认是没有开启编译的。如果想用内核里面自带的这三个文件,就得按照Quectel_LTE&5G_Linux_USB_Driver_User_Guide_V2.0.pdf文档说明去改里面的代码。
不过我看到option.c里面已经有{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200A, 0xff, 0, 0) }了,这个不用添加了,其他地方比如URB_ZERO_PACKET还有return -ENODEV可能还是得自己手动加,有点麻烦。

涉及到的三个c文件的menuconfig菜单项:
option.c USB_SERIAL_OPTION "USB driver for GSM and CDMA modems"
qcserial.c USB_SERIAL_QUALCOMM "USB Qualcomm Serial modem"
只要勾选了上面两项中的任意一项,都会编译usb_wwan.c。

所以我觉得在内核外面编译现成的Quectel_Linux_USB_Serial_Option_Driver_V1.0/v5.3.1代码就行了,得到usb_wwan.ko、option.ko和qcserial.ko这三个文件,然后在板子上insmod这三个文件。确保内核menuconfig里面没有勾选上面所说的两个菜单项(或者勾选为M),不然两份代码会有冲突。
insmod usb_wwan.ko
insmod option.ko
insmod qcserial.ko
内核里面的菜单项勾选为m的话,会在内核目录里面生成ko文件,不用insmod他那里面的ko文件,insmod内核外面单独编译的v5.3.1里面的ko文件就行。
巨大八爪鱼

上传最新编译结果到开发板:

adb push "\\OCT1158-UBUNTU\oct1158\Documents\Code\C\Quectel_LTE5G_Linux_USB_Driver_V1.0-5\Quectel_LinuxAndroid_GobiNet_Driver_V1.6\GobiNet.ko" /root
adb push "\\OCT1158-UBUNTU\oct1158\Documents\Code\C\Quectel_LTE5G_Linux_USB_Driver_V1.0-5\Quectel_Linux_USB_Serial_Option_Driver_V1.0\v5.3.1\drivers\usb\serial\option.ko" /root
adb push "\\OCT1158-UBUNTU\oct1158\Documents\Code\C\Quectel_LTE5G_Linux_USB_Driver_V1.0-5\Quectel_Linux_USB_Serial_Option_Driver_V1.0\v5.3.1\drivers\usb\serial\qcserial.ko" /root
adb push "\\OCT1158-UBUNTU\oct1158\Documents\Code\C\Quectel_LTE5G_Linux_USB_Driver_V1.0-5\Quectel_Linux_USB_Serial_Option_Driver_V1.0\v5.3.1\drivers\usb\serial\usb_wwan.ko" /root
adb push "\\OCT1158-UBUNTU\oct1158\Documents\Code\C\Quectel_LTE5G_Linux_USB_Driver_V1.0-5\Quectel_LinuxAndroid_QMI_WWAN_Driver_V1.1\\qmi_wwan_q.ko" /root
adb push "\\OCT1158-UBUNTU\oct1158\Documents\Code\C\Quectel_LTE5G_Linux_USB_Driver_V1.0-5\quectel-CM\quectel-CM" /root
adb push "\\OCT1158-UBUNTU\oct1158\Documents\Code\C\Quectel_LTE5G_Linux_USB_Driver_V1.0-5\quectel-CM\quectel-qmi-proxy" /root
adb shell chmod +x /root/quectel-CM
adb shell chmod +x /root/quectel-qmi-proxy

5楼 巨大八爪鱼 2025-12-19 17:42

记得修改Quectel_LTE5G_Linux_USB_Driver_V1.0-5/Quectel_Linux_USB_Serial_Option_Driver_V1.0/v5.3.1/drivers/usb/serial/option.c源文件,在

static const struct usb_device_id option_ids[] = {

#if 1 //Added by Quectel

最后面添加{ USB_DEVICE(0x2C7C, 0x6005) },(就是板子lsusb命令里面看到的2c7c后面那个数字)

这样insmod option.ko后才会出现/dev/ttyUSB0和/dev/ttyUSB1两个串口设备。

巨大八爪鱼root@rk3308b-buildroot:/# cd /root
root@rk3308b-buildroot:/root# insmod usb_wwan.ko
root@rk3308b-buildroot:/root# insmod option.ko
[   24.218428] usbcore: registered new interface driver option
[   24.218719] usbserial: USB Serial support registered for GSM modem (1-port)
[   24.219303] option 2-1:1.2: GSM modem (1-port) converter detected
[   24.220742] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB0
[   24.221346] option 2-1:1.3: GSM modem (1-port) converter detected
[   24.223177] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB1
root@rk3308b-buildroot:/root# ls -l /dev/ttyUSB*
crw-rw---- 1 root dialout 188, 0 Jan  1 00:00 /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 1 Jan  1 00:00 /dev/ttyUSB1
root@rk3308b-buildroot:/root#
巨大八爪鱼

【串口AT指令测试程序】

#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>

void send_atcmd(int fd, const char *cmd)
{
    char resp[100];
    int ret;
    
    printf("Command: %s\n", cmd);
    write(fd, cmd, strlen(cmd));
    write(fd, "\r\n", 2);
    ret = read(fd, resp, sizeof(resp) - 1);
    resp[ret] = '\0';
    if (ret >= 1 && resp[ret - 1] == '\n')
        resp[ret - 1] = '\0';
    printf("Response: %s (size=%d)\n", resp, ret);
}

int main()
{
    int fd;

    fd = open("/dev/ttyUSB1", O_RDWR);
    if (fd == -1)
    {
        perror("open() failed");
        return -1;
    }
    send_atcmd(fd, "AT");
    close(fd);
    return 0;
}
【程序运行结果】

root@rk3308b-buildroot:/root# ./atcmd_test
Command: AT
Response: AT (size=3)
root@rk3308b-buildroot:/root#

巨大八爪鱼

把option.ko上传到板子上,执行的命令是:

adb push "\\OCT1158-UBUNTU\oct1158\Documents\Code\C\Quectel_LTE5G_Linux_USB_Driver_V1.0-5\Quectel_Linux_USB_Serial_Option_Driver_V1.0\v5.3.1\drivers\usb\serial\option.ko" /root

6楼 巨大八爪鱼 2025-12-22 12:06

可以用microcom进入串口终端,发送AT命令:

root@rk3308b-buildroot:/root# microcom /dev/ttyUSB1
at
OK
root@rk3308b-buildroot:/root#

按Ctrl+X退出串口终端。

9楼 巨大八爪鱼 2025-12-22 17:21

同样要修改Quectel_LTE5G_Linux_USB_Driver_V1.0-5/Quectel_LinuxAndroid_QMI_WWAN_Driver_V1.1/qmi_wwan_q.c源文件,在

static const struct usb_device_id products[] = {

#if 1 //Added by Quectel

最后面添加{ QMI_FIXED_RAWIP_INTF(0x2C7C, 0x6005, 4) },

这样insmod qmi_wwan_q.ko后才会出现/dev/cdc-wdm0这个设备文件。

巨大八爪鱼

没有/dev/cdc-wdm0文件的话,quectel-CM程序无法运行成功。

root@rk3308b-buildroot:/root# ./quectel-CM

[01-01_03:29:22:019] Quectel_QConnectManager_Linux_V1.5
[01-01_03:29:22:022] Find /sys/bus/usb/devices/2-1 idVendor=0x2c7c idProduct=0x6005
[01-01_03:29:22:025] network interface '' or qmidev '' is not exist
[01-01_03:29:22:025] qmidevice_detect failed
root@rk3308b-buildroot:/root#
10楼 巨大八爪鱼 2025-12-23 13:38

正常情况下,只要插了USB线,开机后就会有ifconfig usb0接口,IP地址为192.168.43.100,不需要insmod GobiNet.ko。


如果没有usb0接口,说明模块当前所处的模式不对。这个时候即使insmod GobiNet.ko,usb0接口也不会出现。

root@rk3308b-buildroot:/# lsmod
Module                  Size  Used by    Tainted: G
aic8800_bsp            73728  0
root@rk3308b-buildroot:/# lsusb
Bus 003 Device 001: ID 1d6b:0001
Bus 002 Device 003: ID 2c7c:6005
Bus 001 Device 001: ID 1d6b:0002
Bus 002 Device 001: ID 1d6b:0002
root@rk3308b-buildroot:/# ifconfig
eth0      Link encap:Ethernet  HWaddr F2:2E:FE:02:6E:60
          UP 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)
          Interrupt:39

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:60 errors:0 dropped:0 overruns:0 frame:0
          TX packets:60 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:4048 (3.9 KiB)  TX bytes:4048 (3.9 KiB)

root@rk3308b-buildroot:/# ifconfig usb0
ifconfig: usb0: error fetching interface information: Device not found
root@rk3308b-buildroot:/#


要想让usb0接口出现,只需发AT+QCFG="usbnet",3命令让模块切换到模式3(RNDIS模式),然后发AT+CFUN=1,1命令让模块重启。

root@rk3308b-buildroot:/root# insmod usb_wwan.ko
root@rk3308b-buildroot:/root# insmod option.ko
[ 4794.877893] usbcore: registered new interface driver option
[ 4794.878214] usbserial: USB Serial support registered for GSM modem (1-port)
[ 4794.879102] option 2-1:1.2: GSM modem (1-port) converter detected
[ 4794.880421] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB0
[ 4794.881497] option 2-1:1.3: GSM modem (1-port) converter detected
[ 4794.883058] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB1
root@rk3308b-buildroot:/root# microcom /dev/ttyUSB1
AT+QCFG="usbnet",3
OK
AT+CFUN=1,1
OK
[ 4815.536085] usb 2-1: USB disconnect, device number 3
[ 4815.539263] option1 ttyUSB0: GSM modem (1-port) converter now disconnected from ttyUSB0
[ 4815.539742] option 2-1:1.2: device disconnected
[ 4815.545028] option1 ttyUSB1: GSM modem (1-port) converter now disconnected from ttyUSB1
[ 4815.545563] option 2-1:1.3: device disconnected
root@rk3308b-buildroot:/root# [ 4816.480225] usb 2-1: new high-speed USB device number 4 using ehci-platform
[ 4817.138273] usb 2-1: USB disconnect, device number 4

root@rk3308b-buildroot:/root# [ 4822.800227] usb 2-1: new high-speed USB device number 5 using ehci-platform
[ 4822.936778] rndis_host 2-1:1.0 usb0: register 'rndis_host' at usb-ff440000.usb-1, RNDIS device, c6:be:9f:e6:51:b1
[ 4822.939904] option 2-1:1.2: GSM modem (1-port) converter detected
[ 4822.941051] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB0
[ 4822.943025] option 2-1:1.3: GSM modem (1-port) converter detected
[ 4822.944221] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB1

root@rk3308b-buildroot:/root# ifconfig
eth0      Link encap:Ethernet  HWaddr F2:2E:FE:02:6E:60
          UP 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)
          Interrupt:39

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:1140 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1140 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:68848 (67.2 KiB)  TX bytes:68848 (67.2 KiB)

usb0      Link encap:Ethernet  HWaddr C6:BE:9F:E6:51:B1
          inet addr:192.168.43.100  Bcast:192.168.43.255  Mask:255.255.255.0
          inet6 addr: fe80::9b64:572a:533b:a4f4/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:7 errors:0 dropped:0 overruns:0 frame:0
          TX packets:13 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1104 (1.0 KiB)  TX bytes:2698 (2.6 KiB)

root@rk3308b-buildroot:/root# lsmod
Module                  Size  Used by    Tainted: G
option                 53248  0
usb_wwan               20480  1 option
aic8800_bsp            73728  0
root@rk3308b-buildroot:/root#

巨大八爪鱼AT+QCFG="usbnet" 是Quectel 系列4G/5G模块(如EC20、RM500、RG200U等)的AT指令,用于配置USB网络接口模式,即指定模块通过USB连接时使用的网络协议标准。‌
‌指令格式与参数‌
    ‌测试命令‌:AT+QCFG=? 可查询支持的参数值,响应中会列出可用的模式。‌
    ‌设置命令‌:AT+QCFG="usbnet",<net>,其中 <net> 为模式参数:
        0:RMNET 接口(高通标准,通常用于Linux内核驱动)。‌
        1:ECM(ECM 接口,USB设备通信模式,常见于Linux系统)。‌
        2:MBIM(MBIM 接口,微软标准,支持高级功能)。‌
        3:RNDIS(RNDIS 接口,Windows兼容模式,也可在Linux中使用)。‌
    ‌响应‌:成功时返回 OK,失败时返回 ERROR;若省略参数(如 AT+QCFG="usbnet"),会返回当前配置状态。‌

‌配置步骤与注意事项‌
    ‌连接与验证‌:通过串口工具(如minicom)连接模块的调试端口(如 /dev/ttyUSB0),发送 AT 测试通信是否正常。‌
    ‌设置模式‌:例如,设置为ECM模式(自动拨号常用):AT+QCFG="usbnet",1。‌
    ‌重启生效‌:配置后需重启模块(如发送 AT+CFUN=1,1)使设置生效。‌
    ‌系统识别‌:重启后,系统会生成新的网络接口(如 usb0),可通过 ifconfig 或 ip a 查看IP地址分配。‌
巨大八爪鱼AT+CFUN=1,1 是AT指令中用于控制模块功能的命令,具体作用是将模块设置为全功能模式并执行重启操作。‌
    ‌命令含义‌:AT+CFUN 指令用于设定电话功能水平。参数 1 表示全功能模式,即启用模块的所有功能(如无线通信、SIM卡操作等);参数 1 作为第二个值,指示执行重启。重启后,模块会重新初始化并进入全功能状态。
    ‌典型应用场景‌:该命令常用于模块初始化阶段,以确保所有功能正常启动。‌ 例如,在设备上电或故障恢复时,通过此指令激活模块并重启,以便后续执行其他操作(如查询SIM卡状态或网络注册)。‌
    ‌执行注意事项‌:发送此命令后,模块会重启,期间可能需要约 4 秒时间完成初始化。重启后,建议等待片刻再发送后续指令(如查询 IMSI 或信号强度),以避免响应错误。‌此外,确保SIM卡已正确插入且为USIM卡,以避免功能异常。‌
11楼 巨大八爪鱼 2025-12-23 17:08
root@rk3308b-buildroot:/root# microcom /dev/ttyUSB1
AT+QICSGP=1,1,"cmnet","","",1
OK
AT+QIACT=1
OK
AT+QIACT?
+QIACT: 1,1,1,"10.145.191.213"

OK
AT+QPING=1,"www.baidu.com"
OK

+QPING: 0,"39.156.70.239",32,85,51

+QPING: 0,"39.156.70.239",32,25,51

+QPING: 0,"39.156.70.239",32,40,52

+QPING: 0,"39.156.70.239",32,35,52

+QPING: 0,4,4,0,0,85,46
AT+QPING=1,"zh.purasbar.com"
OK

+QPING: 0,"154.222.17.158",32,105,45

+QPING: 0,"154.222.17.158",32,85,45

+QPING: 0,"154.222.17.158",32,90,46

+QPING: 0,"154.222.17.158",32,85,46

+QPING: 0,4,4,0,0,105,91
AT+QPING=1,"pma3.purasbar.com"
OK

+QPING: 0,"172.105.217.241",32,100,46

+QPING: 0,"172.105.217.241",32,100,46

+QPING: 0,"172.105.217.241",32,100,47

+QPING: 0,"172.105.217.241",32,130,47

+QPING: 0,4,4,0,0,130,107
AT+QPING=1,"git.shujentech.au"
OK

+QPING: 0,"139.162.87.125",32,160,45

+QPING: 0,"139.162.87.125",32,280,45

+QPING: 0,"139.162.87.125",32,140,45

+QPING: 0,"139.162.87.125",32,260,45

+QPING: 0,4,4,0,0,280,210
AT+QPING=1,"www.st.com"
OK

+QPING: 0,"223.113.13.73",32,50,53

+QPING: 0,"223.113.13.73",32,50,53

+QPING: 0,"223.113.13.73",32,50,54

+QPING: 0,"223.113.13.73",32,50,54

+QPING: 0,4,4,0,0,50,50
AT+QPING=1,"www.nxp.com"
OK

+QPING: 0,"184.87.234.135",32,80,47

+QPING: 0,"184.87.234.135",32,75,47

+QPING: 0,"184.87.234.135",32,75,47

+QPING: 0,"184.87.234.135",32,75,47

+QPING: 0,4,4,0,0,80,76
root@rk3308b-buildroot:/root#
巨大八爪鱼AT+QIACT=1是激活场景1,AT+QIDEACT=1是关闭场景1。
12楼 巨大八爪鱼 2025-12-23 17:13
root@rk3308b-buildroot:/root# microcom /dev/ttyUSB1
AT+QNTP=1,"202.112.10.36",123
OK

+QNTP: 0,"2025/12/23,09:12:35+32"
AT+QNTP=1,"202.112.10.36",123
OK

+QNTP: 0,"2025/12/23,09:12:38+32"
AT+QNTP=1,"202.112.10.36",123
OK

+QNTP: 0,"2025/12/23,09:12:39+32"
AT+QNTP=1,"202.112.10.36",123
OK

+QNTP: 0,"2025/12/23,09:12:40+32"
AT+CCLK?
+CCLK: "25/12/23,09:12:44+32"

OK
AT+CCLK?
+CCLK: "25/12/23,09:12:44+32"

OK
AT+CCLK?
+CCLK: "25/12/23,09:12:45+32"

OK
AT+CCLK?
+CCLK: "25/12/23,09:12:46+32"

OK
AT+CCLK?
+CCLK: "25/12/23,09:12:47+32"

OK
AT+CCLK?
+CCLK: "25/12/23,09:12:48+32"

OK
AT+CCLK?
+CCLK: "25/12/23,09:12:49+32"

OK
AT+CCLK?
+CCLK: "25/12/23,09:12:50+32"

OK
root@rk3308b-buildroot:/root#
巨大八爪鱼AT+QNTP是获取网络时间并同步到本地,AT+CCLK?是查看本地时间。

内容转换:

回复帖子
内容:
用户名: 您目前是匿名发表。
验证码:
看不清?换一张