开启开发板(内核就是TQ的基础上+上前面的配置,文件系统直接用TQ的) 进入文件系统:
(1) /etc/init.d/rcS
mount -a
mkdir -p /dev/pts
mkdir /var/run
mount -t devpts devpts /dev/pts
mount -t usbfs usbfs /proc/bus/usb
(2)
[root@EmbedSky /]# mount -t nfs 192.168.1.28:/nfs /mnt -o nolock
[root@EmbedSky /]# cd /mnt/
[root@EmbedSky /mnt]# ls
chat libusb.so libusbpp.so
libusb-0.1.so.4 libusbpp-0.1.so.4 pppd
libusb-0.1.so.4.4.4 libusbpp-0.1.so.4.4.4 usb_modeswitch
libusb.a libusbpp.a
libusb.la libusbpp.la
[root@EmbedSky /mnt]# cp chat /usr/sbin/
[root@EmbedSky /mnt]# cp pppd /usr/sbin/
[root@EmbedSky /mnt]# cp usb_modeswitch /bin/
[root@EmbedSky /mnt]# cp libusb* /lib/
[root@EmbedSky /mnt]#
重启 插上3G
Please press Enter to activate this console. ifconfig eth0 hw ether 10:23:45:67:89:ab
eth0: link down
ifconfig eth0 192.168.1.6 netmask 255.255.255.0 up
add default gw 192.168.1.2
Done
[root@EmbedSky /]# eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
[root@EmbedSky /]# ifconfig eth0 down
[root@EmbedSky /]# usb_modeswitch -W -v 12d1 -p 1da1 -V 12d1 -P 1da1 -D 0 -H 1
Taking all parameters from the command line
* usb-modeswitch: handle USB devices with multiple modes
* Version 1.1.3 (C) Josua Dietze 2010
* Based on libusb0 (0.1.12 and above)
! PLEASE REPORT NEW CONFIGURATIONS !
DefaultVendor= 0x12d1
DefaultProduct= 0x1da1
TargetVendor= 0x12d1
TargetProduct= 0x1da1
TargetClass= not set
TargetProductList=""
DetachStorageOnly=0
HuaweiMode=1
SierraMode=0
SonyMode=0
GCTMode=0
MessageEndpoint= not set
MessageContent=""
NeedResponse=0
ResponseEndpoint= not set
Interface=0x00
InquireDevice enabled (default)
Success check disabled
System integratiousb 1-1: USB disconnect, address 2
n mode enabled
usb_set_debug: Setting debugging level to 15 (on)
usb_os_find_busses: Found 001
usb_os_find_busses: Skipping non bus directory devices
usb_os_find_devices: Found 002 on 001
usb_os_find_devices: Found 001 on 001
error obtaining child information: Inappropriate ioctl for device
Looking for target devices ...
searching devices, found USB ID 12d1:1da1
found matching vendor ID
found matching product ID
adding device
searching devices, found USB ID 1d6b:0001
Found devices in target mode or class (1)
Looking for default devices ...
searching devices, found USB ID 12d1:1da1
found matching vendor ID
found matching product ID
adding device
searching devices, found USB ID 1d6b:0001
Found devices in default mode or class (1)
Accessing device 002 on bus 001 ...
Ambiguous Class/InterfaceClass: 0x02/0x08Using endpoints 0x05 (out) and 0x85 (in)
Inquiring device details; driver will be detached ...
Looking for active driver ...
USB error: could not get bound driver: No data available
No driver found. Either detached before or never attached
SCSI inquiry data (for identification)
-------------------------
Vendor String: HUAWEI
Model String: Mobile CMCC CD
Revision String: 1.25
-------------------------
USB description data (for identification)
-------------------------
Manufacturer: HUAWEI Mobile
Product: HUAWEI Mobile System Solution
Serial No.: 000000-00-000000
-------------------------
Sending Huawei control message ...
USB error: error sending control message: Timer expired
Error: sending Huawei control message failed (error -62). Aborting.
[root@EmbedSky /]# usb 1-1: new full speed USB device using s3c2410-ohci and address 3
usb 1-1: New USB device found, idVendor=12d1, idProduct=1d09
usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1: Product: HUAWEI Mobile System Solution
usb 1-1: Manufacturer: HUAWEI Mobile
usb 1-1: SerialNumber: 000000-00-000000
usb 1-1: configuration #3 chosen from 1 choice
cdc_acm 1-1:3.1: ttyACM0: USB ACM device
cdc_acm 1-1:3.3: ttyACM1: USB ACM device
cdc_acm 1-1:3.5: ttyACM2: USB ACM device
[root@EmbedSky /]#
(3)开始拨号
[root@ZHENXI-> /mnt]# cd /etc/ppp
[root@ZHENXI-> ppp]# ls
chap-secrets peers
connect-chat pap-secrets resolv.conf
[root@ZHENXI-> ppp]# vi chap-secrets
any * any
[root@ZHENXI-> ppp]# vi connect-chat
TIMEOUT 15
ABORT '\nBUSY\r'
ABORT '\nNO ANSWER\r'
ABORT '\nRINGING\r\n\r\nRINGING\r'
TIMEOUT 40
' ' \rAT (前面是2个单引号)
OK ATS0=0
OK ATE0V1
OK AT+CGDCONT,"IP","CMNET" (此句最关键)
OK ATDT*99***1#
CONNECT
[root@ZHENXI-> ppp]# vi pap-secrets
guest hostname "*" -
master hostname "*" -
root hostname "*" -
support hostname "*" -
stats hostname "*" -
any * any
[root@ZHENXI-> ppp]# ls
chap-secrets connect-errors peers
connect-chat pap-secrets resolv.conf
[root@ZHENXI-> ppp]# cd peers/
[root@ZHENXI-> peers]# ls
gprs
[root@ZHENXI-> peers]# vi gprs
/dev/ttyACM1
460800
nocrtscts
modem
#noauth
nodetach(显示PPP拨号过程信息,去掉不显示)
usepeerdns
debug
noipdefault
defaultroute
user any
#0.0.0.0:0.0.0.0
ipcp-accept-local
ipcp-accept-remote
persist
connect '/usr/sbin/chat -s -v –f /etc/ppp/connect-chat'
[root@ZHENXI-> peers]# ls
gprs
[root@ZHENXI-> peers]# cd ..
执行 pppd call gprs即可拨号
[root@EmbedSky /]# pppd call gprs