加载中…
个人资料
峯挚
峯挚
  • 博客等级:
  • 博客积分:0
  • 博客访问:13,097
  • 关注人气:1
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
相关博文
推荐博文
谁看过这篇博文
加载中…
正文 字体大小:

i.MX6添加EC204G模块GOBI驱动

(2019-12-02 17:53:19)
标签:

it

分类: 笔记
1,将移远EC20官方GOBI驱动源码拷贝到drivers/net/usb下
GobiUSBNet.c
QMI.c
QMI.h
QMIDevice.c
QMIDevice.h
Structs.h

2,修改drivers/net/usb/Makefile
obj-$(CONFIG_USB_GOBI_NET) += GobiNet.o
GobiNet-objs := GobiUSBNet.o QMIDevice.o QMI.o

3,修改drivers/net/usb/Kconfig
config USB_GOBI_NET
        tristate "Gobi USB Net driver for Quectel module"
        help
        Support Quectelmodule
        A modemmanager with support for GobiNet is recommended.
        Tocompile this driver as amudule,choose M here:the module will be calledGobiNet.

4,配置内核
使能Gobi驱动
-> Device Drivers
-> [*] Network device support
-> -*- USB Network Adapters
-> <*> Gobi USB Net driver for Quectel module
编译内核后启动,可以看到系统输出
GobiNet 1-1.2:1.4 eth1: register 'GobiNet' at usb-ci_hdrc.1-1.2, GobiNet Ethernet Device, f6:2d:6c:38:f5:11

5,编译quectel-CM
将quectel-CM源码复制到ubuntu交叉编译
make CROSS_COMPILE=arm-linux-gnueabihf-
得到quectel-CM程序,复制到板子/usr/bin目录下

6,上网测试
拨号
quectel-CM -s cenet &
输出以下内容
[1] 511
[06-02_17:11:06:976] WCDMA&LTE_QConnectManager_Linux&Android_V1.1.34
[06-02_17:11:06:977] quectel-CM profile[1] = cenet///0, pincode = (null)
[06-02_17:11:06:980] Find /sys/bus/usb/devices/1-1.2 idVendor=2c7c idProduct=0125
[06-02_17:11:06:980] Find /sys/bus/usb/devices/1-1.2:1.4/net/eth1
[06-02_17:11:06:980] Find usbnet_adapter = eth1
[06-02_17:11:06:980] Find /sys/bus/usb/devices/1-1.2:1.4/GobiQMI/qcqmi1
[06-02_17:11:06:980] Find qmichannel = /dev/qcqmi1
[06-02_17:11:07:009] Get clientWDS = 7
root@mys6ull14x14:~# [06-02_17:11:07:041] Get clientDMS = 8
[06-02_17:11:07:073] Get clientNAS = 9
[06-02_17:11:07:104] Get clientUIM = 10
[06-02_17:11:07:138] Get clientWDA = 11
[06-02_17:11:07:169] requestBaseBandVersion EC20CEHCLGR06A02M1G
[06-02_17:11:07:265] requestGetSIMStatus SIMStatus: SIM_READY
[06-02_17:11:07:265] requestSetProfile[1] cenet///0
[06-02_17:11:07:329] requestGetProfile[1] cenet///0
[06-02_17:11:07:361] requestRegistrationState2 MCC: 460, MNC: 1, PS: Attached, DataCap: LTE
[06-02_17:11:07:393] requestQueryDataCall IPv4ConnectionStatus: DISCONNECTED
[06-02_17:11:07:457] requestRegistrationState2 MCC: 460, MNC: 1, PS: Attached, DataCap: LTE
[06-02_17:11:07:776] requestSetupDataCall WdsConnectionIPv4Handle: 0xe17864e0
IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
[06-02_17:11:07:872] requestQueryDataCall IPv4ConnectionStatus: CONNECTED
[06-02_17:11:07:905] ifconfig eth1 up
[06-02_17:11:07:917] busybox udhcpc -f -n -q -t 5 -i eth1
[06-02_17:11:07:928] udhcpc (v1.24.1) started
GobiNet 1-1.2:1.4 eth1: kevent 12 may have been dropped
[06-02_17:11:08:007] Sending discover...
[06-02_17:11:08:067] Sending select for 10.166.46.124...
[06-02_17:11:08:126] Lease of 10.166.46.124 obtained, lease time 7200
RTNETLINK answers: File exists
[06-02_17:11:08:183] /etc/udhcpc.d/50default: Adding DNS 120.80.80.80
[06-02_17:11:08:184] /etc/udhcpc.d/50default: Adding DNS 221.5.88.88
ifconfig
可以看到4G网卡已分配IP
route add default gw <4G网卡ip>
ping www.baidu.com -I <4G网卡ip>
成功
killall quectel-CM 
关闭连接 

0

阅读 收藏 禁止转载 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 电话:4000520066 提示音后按1键(按当地市话标准计费) 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 会员注册 | 产品答疑

新浪公司 版权所有