CDMA2000 3G Chat 拨号

本文详细介绍了如何使用CDMA2000 3G进行拨号,并通过AT指令配置设备,最终实现与网络的PPP连接。包括驱动加载、设备识别、信号强度检查、拨号脚本编写及使用pppd进行网络连接。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

使用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= 0
      D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
      P:  Vendor=2077 ProdID=7000 Rev= 0.00
      S:  Manufacturer=TW
      S:  Product=TW  COMMON
      C:* #Ifs= 3 Cfg#= 1 Atr=a0 MxPwr=500mA
      I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=usbserial_generic
      E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=128ms
      E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
      E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
      I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=usbserial_generic
      E:  Ad=84(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
      E:  Ad=04(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
      I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=usbserial_generic
      E:  Ad=86(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
      E:  Ad=06(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms

    2. 查看设备是否有ttyUSB0
      /tmp # ls /dev
      1-1        mtd1ro     null       ptyp6      tty        ttyp4      urandom
      1-1.2      mtd2       nvram      ptyp7      ttyS0      ttyp5      usb1
      console    mtd2ro     port       ptyp8      ttyS1      ttyp6      usb2
      full       mtd3       ppp        ptyp9      ttyS2      ttyp7      usbdev1.1
      gpio       mtd3ro     ptmx       ptypa      ttyS3      ttyp8      usbdev1.2
      kmem       mtd4       pts        ptypb      ttyUSB0    ttyp9      usbdev1.3
      kmsg       mtd4ro     ptyp0      ptypc      ttyUSB1    ttypa      usbdev2.1
      log        mtdblock0  ptyp1      ptypd      ttyUSB2    ttypb      zero
      mem        mtdblock1  ptyp2      ptype      ttyp0      ttypc
      mtd0       mtdblock2  ptyp3      ptypf      ttyp1      ttypd
      mtd0ro     mtdblock3  ptyp4      random     ttyp2      ttype
      mtd1       mtdblock4  ptyp5      shm        ttyp3      ttypf
      /tmp # 

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

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

  6. 开始拨号
    pppd file cdma2000 &

  7. 应该有如下信息
    /tmp # pppd file cdma200 &
    /tmp # speed 115200 not supported
    timeout set to 5 seconds
    abort on (DELAYED)
    abort on (BUSY)
    abort on (ERROR)
    abort on (NO DIALTONE)
    abort on (NO CARRIER)
    send (AT^M)
    expect (OK)
    AT^M^M
    OK
     -- got it
    
    send (ATH0^M)
    timeout set to 40 seconds
    send (AT^M)
    expect (OK)
    ^M
    ATH0^M^M
    OK
     -- got it
    
    send (ATDT#777^M)
    expect (CONNECT)
    ^M
    AT^M^M
    OK^M
    ATDT#777^M^M
    ^M
    CONNECT
     -- got it
    
    send (^M)
    Script /usr/sbin/chat -s -v -f /tmp/chat-cdma finished (pid 646), status = 0x0
    Serial connection established.
    speed 115200 not supported
    using channel 1
    Using interface ppp0
    Connect: ppp0 <--> /dev/ttyUSB0
    hotplug net INTERFACE=ppp0 ACTION=add
    rcvd [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 succeeded
    sent [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) received
    rcvd [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.254
    local  IP address 10.133.198.30
    remote IP address 172.25.8.43
    primary   DNS address 61.177.7.1
    secondary DNS address 218.2.135.1
    Script /tmp/ppp/ip-up started (pid 662)
    ipup_main():: /tmp/ppp/ip-up
    ipup_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. 拨号成功



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值