手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

Linux环境下CDMA 1X 无线上网的实现

[日期:2008-01-25] 来源:Linux公社  作者:Muddybooot [字体:大 中 小]

如果内核已经包含上诉驱动,在插入USB网卡后,通过 dmesg 可以看到相应的网卡硬件信息

hub 2-0:1.0: state 7 ports 2 chg 0000 evt 0006
uhci_hcd 0000:00:1d.1: port 1 portsc 0c80,00
hub 2-0:1.0: over-current change on port 1
hub 2-0:1.0: trying to enable port power on non-switchable hub
uhci_hcd 0000:00:1d.1: port 2 portsc 0893,00
hub 2-0:1.0: over-current change on port 2
hub 2-0:1.0: trying to enable port power on non-switchable hub
hub 2-0:1.0: port 2, status 0101, change 0009, 12 Mb/s
hub 2-0:1.0: debounce: port 2: total 100ms stable 100ms status 0x101
usb 2-2: new full speed USB device using uhci_hcd and address 5
usb 2-2: default language 0x0409
usb 2-2: new device strings: Mfr=1, Product=2, SerialNumber=3
usb 2-2: Product: CP2102 USB to UART Bridge Controller
usb 2-2: Manufacturer: Silicon Labs
usb 2-2: SerialNumber: 0001
usb 2-2: uevent
usb 2-2: configuration #1 chosen from 1 choice
usb 2-2: adding 2-2:1.0 (config #1, interface 0)
usb 2-2:1.0: uevent
usbserial_generic 2-2:1.0: usb_probe_interface
usbserial_generic 2-2:1.0: usb_probe_interface - got id
cp2101 2-2:1.0: usb_probe_interface
cp2101 2-2:1.0: usb_probe_interface - got id
cp2101 2-2:1.0: cp2101 converter detected
usb 2-2: reset full speed USB device using uhci_hcd and address 5
usb 2-2: cp2101 converter now attached to ttyUSB0
drivers/usb/core/inode.c: creating file '005'
hub 2-0:1.0: state 7 ports 2 chg 0000 evt 0004

然后安装拨号程序 (ppp、wvdial)

创建拨号配置文件 /etc/wvdial.conf

[Modem0]
Modem = /dev/ttyUSB0
Baud = 230400
SetVolume = 0
Dial Command = ATDT
Init1 = ATZ
FlowControl = Hardware (CRTSCTS)

[Dialer cdma]
Username = CARD
Password = CARD
Phone = #777
Stupid Mode = 1
Inherits = Modem0

这个配置文件应该是联通通用的,拨号用户名和密码都是固定的,它的计费是通过插在USB网卡里面的SIM卡对应的手机号码来的。

注意:上面的 Baud (传输速率) 后面的值很重要,如果设置错误,将无法拨号,提示下面的错误:

--> Initializing modem.
--> Sending: ATZ
--> Sending: ATQ0
--> Re-Sending: ATZ
--> Modem not responding.

因为偶用的这个无线网卡的上网速率为 230.4Kbps (包装盒上面有),所以对应的 Baud 值应设为 230400,有的地方可能不同,根据情况适当调整即可,将上网速率 x 1000 即可

最后输入 wvdial cdma 开始拨号

# wvdial cdma
--> WvDial: Internet dialer version 1.54.0
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Modem initialized.
--> Sending: ATDT#777
--> Waiting for carrier.
ATDT#777
CONNECT
$DCON
$DCONTYPE:2,2
--> Carrier detected.  Starting PPP immediately.
--> Starting pppd at Thu Jan 24 10:58:41 2008
--> pid of pppd: 4964
--> Using interface ppp0
--> Authentication (CHAP) started
--> Authentication (CHAP) successful
--> local  IP address 220.203.36.20
--> remote IP address 220.192.136.5
--> primary   DNS address 220.192.8.58
--> secondary DNS address 220.192.32.103
--> Script /etc/ppp/ip-up run successful
--> Default route Ok.
--> Nameserver (DNS) Ok.
--> Connected... Press Ctrl-C to disconnect

可以看到拨号成功了,哈哈~~~~ 享受无线上网的乐趣吧~~~

后记:

    原以为很麻烦,没想到如此简单,呵呵~~~~ 还是老子那句话:
    “世上事有难易乎?为之,则难者亦易矣,不为,则易者亦难矣。”

    要是上网速度再快一点就好了,230.4Kbps 只能看看网页、聊聊天,真实下载速度只有 230.4/8 = 28 Kbyte/s 左右,要更快,估计要等 CDMA 2x/3x 或 3G了

linux
相关资讯       Linux技巧 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款