CDMA2000 3G Chat 拨号

来源:互联网 发布:天龙八部配乐知乎 编辑:程序博客网 时间:2024/04/29 15:43

使用CDMA2000 3G拨号

  1. 加载驱动
    insmod usbserial vendor=0x#### product=0x####

  2. 查看驱动是否加载正常
    1. 查看驱动
      T:  Bus=01 Lev=02 Prnt=02 Port=01 Cnt=01 Dev#=  3 Spd=12  MxCh= 0D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1P:  Vendor=2077 ProdID=7000 Rev= 0.00S:  Manufacturer=TWS:  Product=TW  COMMONC:* #Ifs= 3 Cfg#= 1 Atr=a0 MxPwr=500mAI:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=usbserial_genericE:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=128msE:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0msE:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0msI:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=usbserial_genericE:  Ad=84(I) Atr=02(Bulk) MxPS=  64 Ivl=0msE:  Ad=04(O) Atr=02(Bulk) MxPS=  64 Ivl=0msI:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=usbserial_genericE:  Ad=86(I) Atr=02(Bulk) MxPS=  64 Ivl=0msE:  Ad=06(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms

    2. 查看设备是否有ttyUSB0
      /tmp # ls /dev1-1        mtd1ro     null       ptyp6      tty        ttyp4      urandom1-1.2      mtd2       nvram      ptyp7      ttyS0      ttyp5      usb1console    mtd2ro     port       ptyp8      ttyS1      ttyp6      usb2full       mtd3       ppp        ptyp9      ttyS2      ttyp7      usbdev1.1gpio       mtd3ro     ptmx       ptypa      ttyS3      ttyp8      usbdev1.2kmem       mtd4       pts        ptypb      ttyUSB0    ttyp9      usbdev1.3kmsg       mtd4ro     ptyp0      ptypc      ttyUSB1    ttypa      usbdev2.1log        mtdblock0  ptyp1      ptypd      ttyUSB2    ttypb      zeromem        mtdblock1  ptyp2      ptype      ttyp0      ttypcmtd0       mtdblock2  ptyp3      ptypf      ttyp1      ttypdmtd0ro     mtdblock3  ptyp4      random     ttyp2      ttypemtd1       mtdblock4  ptyp5      shm        ttyp3      ttypf/tmp # 

  3. 使用atcmd(自己写的串口小程序)查看at+csq回应信号强度
    /tmp # ./atcmd -f /dev/ttyUSB2 at+csquse 115200bps to setup modem [COMMAND]:  at+csq[RESPONSE]:  at+csq  +CSQ:18,99    OK/tmp # 
  4. 编写chat脚本,名称为chat-cdma
    TIMEOUT 5ABORT "DELAYED"ABORT "BUSY"ABORT "ERROR"ABORT "NO DIALTONE"ABORT "NO CARRIER"''   AT'OK-+++\c-OK' ATH0TIMEOUT 40'' ATOK ATDT#777CONNECT ''

  5. 编写pppd脚本,名称为 cdma2000
    /dev/ttyUSB0 115200 crtscts modem debug nodetachusepeerdnsdefaultrouteuser "card"password "card"0.0.0.0:0.0.0.0connect '/usr/sbin/chat -s -v -f /tmp/chat-cdma'

  6. 开始拨号
    pppd file cdma2000 &

  7. 应该有如下信息
    /tmp # pppd file cdma200 &/tmp # speed 115200 not supportedtimeout set to 5 secondsabort on (DELAYED)abort on (BUSY)abort on (ERROR)abort on (NO DIALTONE)abort on (NO CARRIER)send (AT^M)expect (OK)AT^M^MOK -- got itsend (ATH0^M)timeout set to 40 secondssend (AT^M)expect (OK)^MATH0^M^MOK -- got itsend (ATDT#777^M)expect (CONNECT)^MAT^M^MOK^MATDT#777^M^M^MCONNECT -- got itsend (^M)Script /usr/sbin/chat -s -v -f /tmp/chat-cdma finished (pid 646), status = 0x0Serial connection established.speed 115200 not supportedusing channel 1Using interface ppp0Connect: ppp0 <--> /dev/ttyUSB0hotplug net INTERFACE=ppp0 ACTION=addrcvd [LCP ConfReq id=0x0 <mru 1444> <asyncmap 0x0> <auth chap MD5> <magic 0x612bb048> <pcomp> <accomp>]sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xefc224ff> <pcomp> <accomp>]sent [LCP ConfAck id=0x0 <mru 1444> <asyncmap 0x0> <auth chap MD5> <magic 0x612bb048> <pcomp> <accomp>]rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0xefc224ff> <pcomp> <accomp>]rcvd [CHAP Challenge id=0x1 <b820149be6070f8a8a8d63ed868b9353>, name = "JSTELECOM"]sent [CHAP Response id=0x1 <692583c8ff95bf1e046e2306e76db352>, name = "card"]rcvd [CHAP Success id=0x1 "Welcome to JSTELECOM."]CHAP authentication succeeded: Welcome to JSTELECOM.CHAP authentication succeededsent [CCP ConfReq id=0x1 <mppe -H -M -S -L -D +C>]sent [IPCP ConfReq id=0x1 <compress VJ 0f 01> <addr 192.168.1.1> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]rcvd [IPCP ConfReq id=0x0 <addr 172.25.8.43>]sent [IPCP ConfAck id=0x0 <addr 172.25.8.43>]rcvd [LCP ProtRej id=0x1 80 fd]Protocol-Reject for 'Compression Control Protocol' (0x80fd) receivedrcvd [IPCP ConfRej id=0x1 <compress VJ 0f 01>]sent [IPCP ConfReq id=0x2 <addr 192.168.1.1> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]rcvd [IPCP ConfNak id=0x2 <addr 10.133.198.30> <ms-dns1 61.177.7.1> <ms-dns2 218.2.135.1>]sent [IPCP ConfReq id=0x3 <addr 10.133.198.30> <ms-dns1 61.177.7.1> <ms-dns2 218.2.135.1>]rcvd [IPCP ConfAck id=0x3 <addr 10.133.198.30> <ms-dns1 61.177.7.1> <ms-dns2 218.2.135.1>]not replacing existing default route via 192.168.3.254local  IP address 10.133.198.30remote IP address 172.25.8.43primary   DNS address 61.177.7.1secondary DNS address 218.2.135.1Script /tmp/ppp/ip-up started (pid 662)ipup_main():: /tmp/ppp/ip-upipup_main: argc=6.ipup_main: argv[1]=ppp0.ipup_main: argv[2]=/dev/ttyUSB0.ipup_main: argv[3]=9600.ipup_main: argv[4]=10.133.198.30.ipup_main: argv[5]=172.25.8.43.ipup_main: pppd_pid=645.ipup_main: DEVICE=/dev/ttyUSB0.ipup_main: PPPLOGNAME=admin.ipup_main: LINKNAME=.ipup_main: BUNDLE=.ipup_main: MACREMOTE=.ipup_main: PEERNAME=.Script /tmp/ppp/ip-up finished (pid 662), status = 0x0

  8. 拨号成功



原创粉丝点击