1.拿到手先确认模块,卡没有问题(我自己被有问题的卡坑了4天) 2.关于内核源码修改,编译全部参考正点原子的嵌入式驱动开发教程V1.5,唯一区别就是 这里我是把GobiNet编译为.ko文件,也尝试过编译到内核,但是有问题,遂放弃 3.重点是以下几点 3.1 下载busybox源码 并把 simple.script 移动到 /usr/share/udhcpc/目录下,重命名为default.script,(PS:如果没有这一步可以直接试试加载GobiNet.ko,执行quectel拨号软件,查看日志就知道这个路径了) 3.2 加载GobiNet.ko
root@gmy-desktop:/home/my/Desktop
3.3 执行quectel拨号软件
root@my-desktop:/home/my/Desktop
[08-07_16:25:18:748] WCDMA<E_QConnectManager_Linux&Android_V1.1.34
[08-07_16:25:18:749] ./quectel-CM profile[1] = (null)/(null)/(null)/0, pincode = (null)
[08-07_16:25:18:750] Find /sys/bus/usb/devices/1-2.1 idVendor=2c7c idProduct=0125
[08-07_16:25:18:751] Find /sys/bus/usb/devices/1-2.1:1.4/net/eth1
[08-07_16:25:18:751] Find usbnet_adapter = eth1
[08-07_16:25:18:751] Find /sys/bus/usb/devices/1-2.1:1.4/GobiQMI/qcqmi1
[08-07_16:25:18:751] Find qmichannel = /dev/qcqmi1
[08-07_16:25:18:833] Get clientWDS = 7
[08-07_16:25:18:865] Get clientDMS = 8
[08-07_16:25:18:897] Get clientNAS = 9
[08-07_16:25:18:929] Get clientUIM = 10
[08-07_16:25:18:961] Get clientWDA = 11
[08-07_16:25:18:993] requestBaseBandVersion EC20CEFHLGR06A01M1G_OCPU_ZJ_BETA0620
[08-07_16:25:19:089] requestGetSIMStatus SIMStatus: SIM_READY
[08-07_16:25:19:121] requestGetProfile[1] ctnet///0
[08-07_16:25:19:153] requestRegistrationState2 MCC: 460, MNC: 1, PS: Attached, DataCap: LTE
[08-07_16:25:19:185] requestQueryDataCall IPv4ConnectionStatus: DISCONNECTED
[08-07_16:25:19:249] requestRegistrationState2 MCC: 460, MNC: 1, PS: Attached, DataCap: LTE
[08-07_16:25:19:313] requestSetupDataCall WdsConnectionIPv4Handle: 0x86af9b00
[08-07_16:25:19:409] requestQueryDataCall IPv4ConnectionStatus: CONNECTED
[08-07_16:25:19:440] ifconfig eth1 up
[08-07_16:25:19:452] busybox udhcpc -f -n -q -t 5 -i eth1
udhcpc: started, v1.27.2
udhcpc: sending discover
udhcpc: sending select for 10.58.210.137
udhcpc: lease of 10.58.210.137 obtained, lease time 7200
不知道为什么一直卡在这里(把这个程序放在后台执行比较好),但是IP可以分配成功,不影响下一步,可以看看ifconfig就知道了。如果不行就重启,从头开始操作
3.4修改nameserver的地址为114.114.114.114,不然就ping不通了www.baidu.com,如果此时直接ping百度IP是可以的
my@my-desktop:~$ sudo vim /etc/resolv.conf
[sudo] password for my:
my@my-desktop:~$ cat /etc/resolv.conf
nameserver 114.114.114.114
移动卡可以不用改成114,可以直接ping通,联通卡要改 3.6 大功告成
my@my-desktop:~$ ping www.baidu.com
PING www.a.shifen.com (112.80.248.76) 56(84) bytes of data.
64 bytes from 112.80.248.76 (112.80.248.76): icmp_seq=1 ttl=51 time=42.1 ms
64 bytes from 112.80.248.76 (112.80.248.76): icmp_seq=2 ttl=51 time=35.7 ms
64 bytes from 112.80.248.76 (112.80.248.76): icmp_seq=3 ttl=51 time=43.1 ms
64 bytes from 112.80.248.76 (112.80.248.76): icmp_seq=4 ttl=51 time=34.1 ms
64 bytes from 112.80.248.76 (112.80.248.76): icmp_seq=7 ttl=51 time=54.9 ms
64 bytes from 112.80.248.76 (112.80.248.76): icmp_seq=8 ttl=51 time=34.4 ms
64 bytes from 112.80.248.76 (112.80.248.76): icmp_seq=9 ttl=51 time=36.2 ms
64 bytes from 112.80.248.76 (112.80.248.76): icmp_seq=11 ttl=51 time=44.1 ms
3.7 如何把以上步骤设置为开机自启动脚本?
3.8参考资料
|