免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2854 | 回复: 1
打印 上一主题 下一主题

电脑连接手机GPRS上网错误。。 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-10-29 19:41 |只看该作者 |倒序浏览
脚本是用网上找到的,貌似连接对了,但是不知道还是有什么地方错了。

Serial connection established.
using channel 8
Using interface ppp0
Connect: ppp0 <--> /dev/ttyUSB0
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <pcomp> <accomp>]
rcvd [LCP ProtRej id=0x2 21 01 01 00 0e 02 06 00 00 00 00 07 02 08 02]
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <pcomp> <accomp>]
rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <pcomp> <accomp>]
rcvd [LCP ConfReq id=0x3 <mru 1514> <asyncmap 0x0> <auth pap> <magic 0x0> <pcomp> <accomp>]
sent [LCP ConfRej id=0x3 <magic 0x0>]
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <pcomp> <accomp>]
rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <pcomp> <accomp>]
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <pcomp> <accomp>]
rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <pcomp> <accomp>]
(之后就一直是重复这两行内容)




这个是option

  1. #------------------------------------------------#
  2. # File:
  3. # /etc/ppp/gprs
  4. #
  5. # Description:
  6. # This file holds the serial cable and IrDA pppd options for GPRS phones

  7. # Tell the ppp-daemon to accept mangled data
  8. receive-all

  9. # Give some debug info
  10. debug
  11. kdebug 7

  12. # Print out all the option values which have been set.
  13. dump

  14. # Serial device to which terminal is connected;
  15. # with serial port (COM1 in Windows) use /dev/ttyS0
  16. # and with IrDA use /dev/ircomm0.
  17. #/dev/ircomm0 # IrDA
  18. /dev/ttyUSB0 # serial cable (NOTE: 这个地方你要改为真正的你用的串口,比如/dev/ttyS0)


  19. # Serial port line speed
  20. 115200

  21. # Turn off waiting of carrier detect or flow control signal
  22. # With IrDA it should be disabled with nocrtscts option.
  23. -crtscts # serial cable
  24. #nocrtscts # IrDA
  25. # Ignore carrier detect signal from the modem
  26. local

  27. # To keep pppd on the terminal
  28. nodetach

  29. # Accept the peer's idea of our local IP address
  30. ipcp-accept-local
  31. # Accept the peer's idea of its (remote) IP address
  32. ipcp-accept-remote

  33. # IP addresses:
  34. # - accept peers idea of our local address and set address peer as 10.0.0.1
  35. # (any address would do, since IPCP gives 0.0.0.0 to it)
  36. # - if you use the 10. network at home or something and pppd rejects it,
  37. # change the address to something else
  38. 0.0.0.0:0.0.0.0

  39. -chap
  40. #-pap

  41. # pppd must not propose any IP address to the peer!
  42. noipdefault

  43. # No ppp compression
  44. novj
  45. novjccomp
  46. nobsdcomp
  47. #nopcomp
  48. #noaccomp


  49. #papcrypt
  50. #nodeflate

  51. noauth


  52. #No ppp magic number
  53. nomagic

  54. # no asyn cmap
  55. asyncmap 0

  56. # Add default route
  57. defaultroute

  58. # Connect script
  59. connect /etc/ppp/peers/chap-gprs-connect

  60. # Disconnect script
  61. disconnect /etc/ppp/peers/chap-gprs-disconnect

  62. user "cmnet"
复制代码


这个是连接脚本

  1. #------------------------------------------------#
  2. #!/bin/sh
  3. #
  4. # File:
  5. # /etc/ppp/chat-gprs-connect
  6. #
  7. # Description:
  8. # chat script to open Sonera GPRS service with GPRS phones. If ppp
  9. # negotiation stalls, try restarting the phone. To try with other GPRS
  10. # operator setting, change the PDP contex setting. The settings work with
  11. # all Ericsson models, but Nokia 8310 does not suppor QoS parameters with
  12. # AT commands, so just delete those lines and it'll work.
  13. #
  14. # Set PDP context CID=1, protocol=IP, APN=internet:
  15. # AT+CGDCONT=1,"IP","internet","",0,0
  16. #
  17. # Set CID=1 QoS requirements from the network, not supported by 8310:
  18. # AT+CGQREQ=1,0,0,0,0,0
  19. #
  20. # Set CID=1 minimum acceptable QoS parameters, not supported by 8310:
  21. # AT+CGQMIN=1,0,0,0,0,0
  22. #
  23. # 'Call' CID=1 (activate PDP context one, perform GPRS attach):
  24. # ATD*99***1#
  25. #
  26. # ogin:-BREAK-ogin: \
  27. # TIMEOUT 5 \
  28. # assword: \
  29. # SAY "\nLogged in OK...\n" \

  30. # The actual chat script:
  31. exec chat \
  32. TIMEOUT 5 \
  33. ECHO ON \
  34. ABORT '\nBUSY\r' \
  35. ABORT '\nERROR\r' \
  36. ABORT '\nNO ANSWER\r' \
  37. ABORT '\nNO CARRIER\r' \
  38. ABORT '\nNO DIALTONE\r' \
  39. ABORT '\nRINGING\r\n\r\nRINGING\r' \
  40. '' AT \
  41. TIMEOUT 12 \
  42. SAY "Press CTRL-C to close the connection at any stage!" \
  43. SAY "\ndefining PDP context...\n" \
  44. OK AT+CGATT=1 \
  45. OK 'AT+CGDCONT=1,"IP","cmnet","",0,0' \
  46. TIMEOUT 120 \
  47. OK 'AT+CGDATA="PPP",1' \
  48. SAY "\nwaiting up to 2 mintues for connect...\n"\
  49. CONNECT ''\
  50. SAY "\nConnected. now logging in...\n" \
  51. SAY "\nIf the following ppp negotiations fail,\n" \
  52. SAY "try restarting the phone.\n"
  53. # NOTE: PDP context可能会因你的猫不同而有所区别,查它的手册来写吧

复制代码


'AT+CGDATA="PPP",1'
改成
'ATD*99#'
or
'ATD*99#***1#'
也是一样的效果。

[ 本帖最后由 blworld 于 2007-10-29 19:48 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2007-10-31 15:15 |只看该作者
目前的情况:
1.本来是使用的USB转串口的(本机没有串口),现在直接连到另一条带串口的PC(Windows),CMNET可以成功,CMWAP不成功,相同的设置。相同SIM卡在其他手机上CMWAP也可以成功(PC连手机都是)。
2.直接连到另一条带串口的PC(Linux)CMNET,CMWAP都不成功
3.UNIWAP,UNINET未测试。

简单的结论:USB转串口势必有问题。Linux的PPPD势必没有配置好。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP