![](https://i-blog.csdnimg.cn/blog_migrate/a4c26d1e5885305701be709a3d33442f.gif)
3G modem: | Huawei E180(WCDMA) |
3G SIM Card: | China Unicom 3G Card(WO) |
CPU/Board | FSL P1022DS RevC board |
Linux: | Linux-2.6.35 |
二、步骤
1. | 向linux内核中添加3G模块的驱动(USB转串口的驱动)和PPP协议的支持 |
2. | 下载ppp-2.4.5源码并进行交叉编译(toolchian:powerpc-linux-)。 将拨号上网所需的两个应用程序pppd和chat拷贝到开发板/usr/sbin文件夹下。 将改好的脚本文件ppp-on,ppp-on-dialer存放在/etc/ppp目录下。 将含有域名解析服务器地址的文件resolv.conf拷贝到/etc目录下。 |
3. | 进入 /etc/ppp 目录 ,执行 ./ppp-on。 进行网络测试 |
三、具体工作
1. 向linux内核添加3G模块的驱动(USB转串口的驱动)
usb 1-1: new high speed USB device using fsl-ehci and address3 usb 1-1: New USB device found, idVendor=12d1,idProduct=1001 usb 1-1: New USB device strings: Mfr=3, Product=2,SerialNumber=0 usb 1-1: Product: HUAWEI Mobile usb 1-1: Manufacturer: HUAWEI Technology option 1-1:1.0: GSM modem (1-port) converter detected usb 1-1: GSM modem (1-port) converter now attached tottyUSB0 option 1-1:1.1: GSM modem (1-port) converter detected usb 1-1: GSM modem (1-port) converter now attached tottyUSB1 option 1-1:1.2: GSM modem (1-port) converter detected usb 1-1: GSM modem (1-port) converter now attached tottyUSB2 scsi7 : usb-storage 1-1:1.3 scsi8 : usb-storage 1-1:1.4 scsi 7:0:0:0: CD-ROM sr0: scsi-1 drive Uniform CD-ROM driver Revision: 3.20 sr 7:0:0:0: Attached scsi generic sg1 type 5 scsi 8:0:0:0: Direct-Access sd 8:0:0:0: Attached scsi generic sg2 type 0 sd 8:0:0:0: [sdb] Attached SCSI removabledisk |
2. 向Linux内核中添加PPP协议的支持
<*> |
ls /dev/ppp -l crw-rw---- |
3. 交叉编译拨号上网需要的拨号工具pppd和chat
#cd |
4. 配置拨号脚本文件
# These are the parameters. Change as needed. TELEPHONE=*99# ACCOUNT= PASSWORD= LOCAL_IP=0.0.0.0 REMOTE_IP=0.0.0.0 # Remote IP address if desired. Normally0.0.0.0 NETMASK=255.255.255.0 DIALER_SCRIPT=/etc/ppp/ppp-on-dialer exec /usr/sbin/pppd debug lock modem crtscts /dev/ttyUSB0 115200\ |
2) ppp-on-dialer配置文件的内容:
#!/bin/sh exec chat -v \ TIMEOUT 5 \ ABORT ABORT ABORT '' \rAT OK OK CONNECT '' |
3) 设置正确的域名解析服务器地址
nameserver 202.106.195.68 nameserver 202.106.46.151 |
5. 应用测试
ppp0 |