3g设备驱动支持
Device Drivers --->
[*] USB support --->
<*> USB Serial Converter support --->
[*] USB Generic Serial Driver
<*> USB driver for GSM and CDMA modems
ppp协议支持
[*] Network device support --->
<*> PPP (point-to-point protocol) support
[*] PPP multilink support (EXPERIMENTAL)
[*] PPP filtering
<*> PPP support for async serial ports
<*> PPP support for sync tty ports
<*> PPP Deflate compression
假设3g模块(或上网卡)插在板子上已经被识别成了/dev/ttyUSBx了,进行pppd拨号的程序如下
1.编译pppd源码,将生产的pppd,chat搞到板子的/usr/sbin下
2.在/etc下创建ppp目录
3.ppp下创建pap-chat文件,和peers目录
[root@hemei]# cat pap-secrets
cmnet * cmnet *
[root@hemei]# cat wcdma
nodetach
lock
/dev/ttyUSB0
921600
user "card"
password "card"
crtscts
show-password
usepeerdns
noauth
noipdefault
novj
novjccomp
noccp
defaultroute
ipcp-accept-local
ipcp-accept-remote
connect '/usr/sbin/chat -s -v -f /etc/ppp/peers/chat-wcdma-connect'
disconnect '/usr/sbin/chat -s -v -f /etc/ppp/peers/chat-wcdma-disconnect'
[root@hemei]# cat chat-wcdma-connect
ABORT 'NO CARRIER'
ABORT 'ERROR'
ABORT 'NO DIALTONE'
ABORT 'BUSY'
ABORT 'NO ANSWER'
'' AT
OK ATZ
OK AT+CGDCONT=1,\"IP\",\"3gnet\",,0,0
OK AT+CFUN=1
OK ATDT*99#
CONNECT ''
[root@hemei]# cat chat-wcdma-disconnect
ABORT OK
ABORT BUSY
ABORT DELAYED
ABORT "NO ANSWER"
ABORT "NO CARRIER"
ABORT "NO DIALTONE"
ABORT VOICE
ABORT ERROR
ABORT RINGING
TIMEOUT 12
"" \K
"" \K
"" \K
"" +++ATH
"" +++ATH
"" +++ATH
"" ATZ
SAY "\nGoodbay\n"
[root@hemei]#
[root@hemei]# cat cdma2000
nodetach
lock
/dev/ttyUSB0
921600
user "[email protected]"
password "vnet.mobi"
crtscts
hide-password
usepeerdns
noauth
noipdefault
novj
novjccomp
noccp
defaultroute
ipcp-accept-local
ipcp-accept-remote
connect '/usr/sbin/chat -s -v -f /etc/ppp/peers/chat-cdma2000-connect'
disconnect '/usr/sbin/chat -s -v -f /etc/ppp/peers/chat-cdma2000-disconnect'
[root@hemei]#
[root@hemei]# cat chat-cdma2000-connect
ABORT 'NO CARRIER'
ABORT 'ERROR'
ABORT 'NO DIALTONE'
ABORT 'BUSY'
ABORT 'NO ANSWER'
'' AT
OK ATZ
OK AT+CFUN=1
OK ATDT#777
CONNECT ''
[root@hemei]#
[root@hemei]# cat chat-cdma2000-disconnect
ABORT OK
ABORT BUSY
ABORT DELAYED
ABORT "NO ANSWER"
ABORT "NO CARRIER"
ABORT "NO DIALTONE"
ABORT VOICE
ABORT ERROR
ABORT RINGING
TIMEOUT 12
"" \K
"" \K
"" \K
"" +++ATH
"" +++ATH
"" +++ATH
"" ATZ
SAY "\nGoodbay\n"
[root@hemei]#
[root@hemei]# cat tdscdma
nodetach
lock
/dev/ttyUSB0
460800
user "cmnet"
crtscts
modem
hide-password
usepeerdns
noauth
noipdefault
novj
novjccomp
noccp
defaultroute
ipcp-accept-local
ipcp-accept-remote
connect '/usr/sbin/chat -s -v -f /etc/ppp/peers/chat-tdscdma-connect'
disconnect '/usr/sbin/chat -s -v -f /etc/ppp/peers/chat-tdscdma-disconnect'
[root@hemei]#
[root@hemei]# cat chat-tdscdma-connect
ABORT 'NO CARRIER'
ABORT 'ERROR'
ABORT 'NO DIALTONE'
ABORT 'BUSY'
ABORT 'NO ANSWER'
'' AT
OK ATZ
OK ATE0V1
OK ATS0=0
OK AT+CGDCONT=1,\"IP\",\"cmnet\"
OK AT+CFUN=1
OK ATDT*99***1#
CONNECT
[root@hemei]#
[root@hemei]# cat chat-tdscdma-disconnect
ABORT OK
ABORT BUSY
ABORT DELAYED
ABORT "NO ANSWER"
ABORT "NO CARRIER"
ABORT "NO DIALTONE"
ABORT VOICE
ABORT ERROR
ABORT RINGING
TIMEOUT 12
"" \K
"" \K
"" \K
"" +++ATH
"" +++ATH
"" +++ATH
"" ATZ
SAY "\nGoodbay\n"
进入目录/var/run/,查看是否产出文件 ppp0-ok,如果有,则表示已拨号成功,ppp0-ok文件内会存储IP地址和DNS。
/etc下新建resolv.conf文件,将分配到的两个DNS服务器地址,添加到此文件中,内容如下:
nameserver 210.22.70.3
nameserver 211.95.1.97
ifconfig有信息
[root@hemei]# ifconfig
ppp0 Link encap:Point-to-Point Protocol
inet addr:10.45.210.114 P-t-P:10.64.64.64 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:9 errors:0 dropped:0 overruns:0 frame:0
TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:180 (180.0 B) TX bytes:216 (216.0 B)
如果3g设备插在板子上没有自动出现/dev/ttyUSBx:
1.
配置内核生成usbnet.ko (drivers/net/usb/)
Device Drivers --->
[*] Network device support --->
USB Network Adapters --->
编译希姆通厂家7100等模块的ndis驱动GobiNet,ko
2.
搞到板子上加载
insmod usbnet.ko
insmod GobiNet,ko
3.
模块插在班子上,会出现
/de/qcqmi0
ifconfig -a
有usb0接口出现
4.拨号
ndismanager /dev/qcqmi0
进入菜单进行拨号