感谢支持
我们一直在努力

华为ET128在TQ2440上的移植和使用[附相关文件]

讲解下华为ET128在TQ2440上的移植和使用,首先下载usb-modeswitch-1.1.3.tar.bz2 和 libusb-0.1.12.tar.gz 以及 ppp-2.4.5.tar.gz


相关文件下载在Linux公社FTP 的 1号服务器里,下载地址:


FTP地址:ftp://www.linuxidc.com


用户名:www.linuxidc.com


密码:www.muu.cc


在 2011年LinuxIDC.com\3月\华为ET128在TQ2440上的移植和使用[附相关文件]


下载方法见 http://www.linuxidc.net/thread-1187-1-1.html


(1)root@www.linuxidc.com-desktop:/www.linuxidc.com/3g# tar xvfj usb-modeswitch-1.1.3.tar.bz2
   root@www.linuxidc.com-desktop:/www.linuxidc.com/3g# tar zxvf libusb-0.1.12.tar.gz
   root@www.linuxidc.com-desktop:/www.linuxidc.com/3g# cd libusb-0.1.12
   root@www.linuxidc.com-desktop:/www.linuxidc.com/3g/libusb-0.1.12# ls
acinclude.m4  config.h.in    doc                libusb-config.in  Makefile.am  usb.h.in
aclocal.m4    config.sub     Doxyfile           libusb.pc.in      Makefile.in  usbi.h
apidocs       configure      Doxyfile.in        libusb.spec       missing      usbpp.cpp
AUTHORS       configure.in   error.c            libusb.spec.in    NEWS         usbpp.h
bsd.c         COPYING        error.h            LICENSE           README
ChangeLog     darwin.c       INSTALL.libusb     linux.c           README.in
compile       depcomp        INSTALL.libusb.in  linux.h           tests
config.guess  descriptors.c  install-sh         ltmain.sh         usb.c
  root@www.linuxidc.com-desktop:/www.linuxidc.com/3g/libusb-0.1.12# mkdir _install
  root@www.linuxidc.com-desktop:/www.linuxidc.com/3g/libusb-0.1.12# ./configure –prefix=/www.linuxidc.com/3g/libusb-0.1.12/_install/ –host=arm-linux CC=arm-linux-gcc CXX=arm-linux-g++
  root@www.linuxidc.com-desktop:/www.linuxidc.com/3g/libusb-0.1.12# make
  root@www.linuxidc.com-desktop:/www.linuxidc.com/3g/libusb-0.1.12# make install
  root@www.linuxidc.com-desktop:/www.linuxidc.com/3g/libusb-0.1.12# cd ..
  root@www.linuxidc.com-desktop:/www.linuxidc.com/3g# ls
libusb-0.1.12  libusb-0.1.12.tar.gz  usb-modeswitch-1.1.3  usb-modeswitch-1.1.3.tar.bz2
  root@www.linuxidc.com-desktop:/www.linuxidc.com/3g# cd usb-modeswitch-1.1.3
  root@www.linuxidc.com-desktop:/www.linuxidc.com/3g/usb-modeswitch-1.1.3# ls
ChangeLog  device_reference.txt  README            usb_modeswitch.c     usb_modeswitch.h
COPYING    Makefile              usb_modeswitch.1  usb_modeswitch.conf  usb_modeswitch.tcl
  root@www.linuxidc.com-desktop:/www.linuxidc.com/3g/usb-modeswitch-1.1.3# gedit Makefile &
  CC          = arm-linux-gcc
  CFLAGS      = -Wall -l usb -I/www.linuxidc.com/3g/libusb-0.1.12/_install/include -L/www.linuxidc.com/3g/libusb-0.1.12/_install/lib
 /*
  root@www.linuxidc.com-desktop:/www.linuxidc.com/3g/libusb-0.1.12# cd ..
  root@www.linuxidc.com-desktop:/www.linuxidc.com/3g# ls
  root@www.linuxidc.com-desktop:/www.linuxidc.com/3g# cd usb-modeswitch-1.1.3
  root@www.linuxidc.com-desktop:/www.linuxidc.com/3g/usb-modeswitch-1.1.3# ls
  root@www.linuxidc.com-desktop:/www.linuxidc.com/3g/usb-modeswitch-1.1.3# cd ..
  root@www.linuxidc.com-desktop:/www.linuxidc.com/3g# cd libusb-0.1.12/_install/
  root@www.linuxidc.com-desktop:/www.linuxidc.com/3g/libusb-0.1.12/_install# pwd
/www.linuxidc.com/3g/libusb-0.1.12/_install
  root@www.linuxidc.com-desktop:/www.linuxidc.com/3g/libusb-0.1.12/_install#
*/
  root@www.linuxidc.com-desktop:/www.linuxidc.com/3g/usb-modeswitch-1.1.3# make
arm-linux-gcc -o usb_modeswitch usb_modeswitch.c -Wall -l usb -I/www.linuxidc.com/3g/libusb-0.1.12/_install/include -L/www.linuxidc.com/3g/libusb-0.1.12/_install/lib
(2)root@www.linuxidc.com-desktop:/www.linuxidc.com/3g# tar zxvf ppp-2.4.5.tar.gz
   root@www.linuxidc.com-desktop:/www.linuxidc.com/3g# cd ppp-2.4.5
   root@www.linuxidc.com-desktop:/www.linuxidc.com/3g/ppp-2.4.5# ls
Changes-2.3  contrib  linux    pppdump      README.eap-srp   README.MSCHAP81  README.sol2
chat         etc.ppp  modules  pppstats     README.linux     README.pppoe     scripts
common       FAQ      PLUGINS  README       README.MPPE      README.pppol2tp  SETUP
configure    include  pppd     README.cbcp  README.MSCHAP80  README.pwfd      solaris
   root@www.linuxidc.com-desktop:/www.linuxidc.com/3g/ppp-2.4.5# ./configure –prefix=arm-linux
   root@www.linuxidc.com-desktop:/www.linuxidc.com/3g/ppp-2.4.5# make CC=arm-linux-gcc
(3)linux-kernel + drvers
(4)root@www.linuxidc.com-desktop:/www.linuxidc.com/3g/libusb-0.1.12# cd _install/
root@www.linuxidc.com-desktop:/www.linuxidc.com/3g/libusb-0.1.12/_install# ls
bin  include  lib
root@www.linuxidc.com-desktop:/www.linuxidc.com/3g/libusb-0.1.12/_install# cd lib/
root@www.linuxidc.com-desktop:/www.linuxidc.com/3g/libusb-0.1.12/_install/lib# ls
libusb-0.1.so.4      libusb.a   libusbpp-0.1.so.4      libusbpp.a   libusbpp.so  pkgconfig
libusb-0.1.so.4.4.4  libusb.la  libusbpp-0.1.so.4.4.4  libusbpp.la  libusb.so
root@www.linuxidc.com-desktop:/www.linuxidc.com/3g/libusb-0.1.12/_install/lib# cp * /nfs/
root@www.linuxidc.com-desktop:/www.linuxidc.com/3g# cd ppp-2.4.5
root@www.linuxidc.com-desktop:/www.linuxidc.com/3g/ppp-2.4.5# ls
Changes-2.3  contrib  linux     pppd      README.cbcp     README.MSCHAP80  README.pwfd  solaris
chat         etc.ppp  Makefile  pppdump   README.eap-srp  README.MSCHAP81  README.sol2
common       FAQ      modules   pppstats  README.linux    README.pppoe     scripts
configure    include  PLUGINS   README    README.MPPE     README.pppol2tp  SETUP
root@www.linuxidc.com-desktop:/www.linuxidc.com/3g/ppp-2.4.5# chmod 777 chat/chat
root@www.linuxidc.com-desktop:/www.linuxidc.com/3g/ppp-2.4.5# chmod 777 pppd/pppd


root@www.linuxidc.com-desktop:/www.linuxidc.com/3g/ppp-2.4.5# cp chat/chat /nfs/    
root@www.linuxidc.com-desktop:/www.linuxidc.com/3g/ppp-2.4.5# cp pppd/pppd /nfs/

(5)内核配置:


华为ET128在TQ2440上的移植和使用[附相关文件]


华为ET128在TQ2440上的移植和使用[附相关文件]


华为ET128在TQ2440上的移植和使用[附相关文件]


华为ET128在TQ2440上的移植和使用[附相关文件]

开启开发板(内核就是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

(如果出现报错couldn’t open ppp database /var/run/pppd2.tdb这一个错误


解决办法


mkdir /var/run


解释:pppd2.tdb这个文件是pppd程序生成的如果没有run这个目录的话只要建一个目录就可以了)


timeout set to 15 seconds


abort on (\nBUSY\r)


abort on (\nNO ANSWER\r)


abort on (\nRINGING\r\n\r\nRINGING\r)


timeout set to 40 seconds


send (^MAT^M)


expect (OK)


^M


OK


 — got it


 


send (ATS0=0^M)


expect (OK)


^M


^MAT^M^M


OK


 — got it


 


send (ATE0V1^M)


expect (OK)


^M


ATS0=0^M^M


OK


 — got it


 


send (AT+CGDCONT=1,”IP”,”CMNET”^M)


expect (OK)


^M


ATE0V1^M^M


OK


 — got it


 


send (ATDT*99***1#^M)


expect (CONNECT)


^M


^M


OK^M


^M


CONNECT


 — got it


 


Script /usr/sbin/chat -s -v -f /etc/ppp/connect-chat finished (pid 517), status = 0x0


Serial connection established.


using channel 1


Using interface ppp0


Connect: ppp0 <–> /dev/ttyACM1


Warning – secret file /etc/ppp/pap-secrets has world and/or group access


sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x93c5851b> <pcomp> <accomp>]


rcvd [LCP ConfReq id=0x1 <asyncmap 0xa0000> <auth pap>]


sent [LCP ConfAck id=0x1 <asyncmap 0xa0000> <auth pap>]


rcvd [LCP ConfRej id=0x1 <magic 0x93c5851b> <pcomp> <accomp>]


sent [LCP ConfReq id=0x2 <asyncmap 0x0>]


rcvd [LCP ConfAck id=0x2 <asyncmap 0x0>]


Warning – secret file /etc/ppp/pap-secrets has world and/or group access


sent [PAP AuthReq id=0x1 user=”any” password=<hidden>]


rcvd [PAP AuthAck id=0x1 “Login OK”]


Remote message: Login OK


PAP authentication succeeded


sent [CCP ConfReq id=0x1 <deflate 15> <deflate(old#) 15> <bsd v1 15>]


sent [IPCP ConfReq id=0x1 <compress VJ 0f 01> <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]


rcvd [LCP ProtRej id=0x2 80 fd 01 01 00 0f 1a 04 78 00 18 04 78 00 15 03 2f]


Protocol-Reject for ‘Compression Control Protocol’ (0x80fd) received


sent [IPCP ConfReq id=0x1 <compress VJ 0f 01> <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]


sent [IPCP ConfReq id=0x1 <compress VJ 0f 01> <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]


rcvd [IPCP ConfReq id=0x1 <addr 192.200.1.21>]


sent [IPCP ConfAck id=0x1 <addr 192.200.1.21>]


rcvd [IPCP ConfRej id=0x1 <compress VJ 0f 01>]


sent [IPCP ConfReq id=0x2 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]


rcvd [IPCP ConfNak id=0x2 <addr 10.160.193.31> <ms-dns1 211.141.16.99> <ms-dns2 211.136.17.107>]


sent [IPCP ConfReq id=0x3 <addr 10.160.193.31> <ms-dns1 211.141.16.99> <ms-dns2 211.136.17.107>]


rcvd [IPCP ConfAck id=0x3 <addr 10.160.193.31> <ms-dns1 211.141.16.99> <ms-dns2 211.136.17.107>]


local  IP address 10.160.193.31


remote IP address 192.200.1.21


primary   DNS address 211.141.16.99


secondary DNS address 211.136.17.107


[root@ZHENXI-> ppp]# ls


chap-secrets    connect-errors  peers


connect-chat    pap-secrets     resolv.conf


[root@ZHENXI-> ppp]# vi resolv.conf


nameserver 211.141.16.99


nameserver 211.136.17.107


这2个为上面PPP拨号成功时返回的DNS,将其加入resolv.conf文件即可

赞(0) 打赏
转载请注明出处:服务器评测 » 华为ET128在TQ2440上的移植和使用[附相关文件]
分享到: 更多 (0)

听说打赏我的人,都进福布斯排行榜啦!

支付宝扫一扫打赏

微信扫一扫打赏