其实在Ubuntu下干活,主要目的是为了用Erlang开发个未来准备运行在该平台下的新东西,闲的时候就尝试折腾Ubuntu系统上的各种配置,晚上睡觉前又有了收获。
继下午搞定局域网连接打印机之后,刚才顺利搞定了CDMA PCMCIA卡拨号上网,大致的情况汇报如下。
[coolcode]
#sudo apt-get install setserial pcmciautils (安装两个工具)
#sudo pccartctl info (还可以用status, eject, ls 等子命令,具体的看man)
#dmesg |grep tty (得到类似下面的东西)
[ 34.574046] 0.0: ttyS0 at I/O 0x3f8 (irq = 3) is a 16C950/954
可以得知 ttyS0 就是cdma卡设备,继续后面的操作
#sudo vim /etc/wvdial.conf 输入下面的内容
[Modem0]
Modem = /dev/ttyS0
Baud = 57600
SetVolume = 1
Dial Command = ATDT
Init1 = ATZ
FlowControl = Hardware (CRTSCTS)
[Dialer Defaults]
Phone = #777
Username = card
Password = card
Stupid Mode = 1
Inherits = Modem0
继续后面的操作
#sudo vim /var/lib/setserial/autoserial.conf (输入下面的内容)
/dev/ttyS0 uart 16950/954 port 0x03f8 irq 3 baud_base 230400 spd_normal skip_test
或者你也可以不做上面的修改,之接运行下面的命令也可以,只不过需要每次拨号前都运行一次
#sudo setserial /dev/ttyS0 baud_base 230400 (这个东西有些专业,需要咨询相关人士)
这时,配置工作完成,可以进行拨号了
#sudo wvdial
应该可以看到类似下面的输出内容就表示成功了,否则你就试试重头再来吧。
–> WvDial: Internet dialer version 1.60
–> Initializing modem.
–> Sending: ATZ
OK
–> Modem initialized.
–> Sending: ATDT#777
–> Waiting for carrier.
CONNECT
–> Carrier detected. Starting PPP immediately.
–> Starting pppd at Wed Aug 6 03:04:20 2008
–> Pid of pppd: 7610
–> Using interface ppp0
–> pppd: ��[06][08]��[06][08][18]�[06][08]
–> pppd: ��[06][08]��[06][08][18]�[06][08]
–> pppd: ��[06][08]��[06][08][18]�[06][08]
–> pppd: ��[06][08]��[06][08][18]�[06][08]
–> pppd: ��[06][08]��[06][08][18]�[06][08]
–> pppd: ��[06][08]��[06][08][18]�[06][08]
–> local IP address 211.145.32.130
–> pppd: ��[06][08]��[06][08][18]�[06][08]
–> remote IP address 220.192.0.22
–> pppd: ��[06][08]��[06][08][18]�[06][08]
–> primary DNS address 220.192.0.131
–> pppd: ��[06][08]��[06][08][18]�[06][08]
–> secondary DNS address 220.192.8.58
–> pppd: ��[06][08]��[06][08][18]�[06][08]
窗口不要关闭,否则就断线了,如果主动想断线,可以按 CTRL + C ,会看到下面的内容输出:
Caught signal 2: Attempting to exit gracefully…
–> Terminating on signal 15
–> pppd: ��[06][08]��[06][08][18]�[06][08]
–> Connect time 0.4 minutes.
–> pppd: ��[06][08]��[06][08][18]�[06][08]
–> pppd: ��[06][08]��[06][08][18]�[06][08]
–> Disconnecting at Wed Aug 6 03:04:41 2008
[/coolcode]
在连接上网后,可以使用 ifconfig -a 看看网络连接情况,应该能看到 ppp0 网络设备的参数。
补充说明,网上有高人提示如下:
如果拨号成功后网络依然不通,可能是因为默认路由的问题所致,可以运行下述命令解决
#netstat -rn (查看当前路由表,或者命令 route 也可以)
#route add default ppp0 (添加默认的路由)
此时应该全部成功了,希望你也能和我一样幸运! 🙂
注: 我的CDMA卡是PANDA的牌子,很普通的一个国产便宜货,通过 pccardctl info 命令可以看到如下信息:
#pccardctl info
PRODID_1=”PANDA”
PRODID_2=”CDMA”
PRODID_3=”CARD”
PRODID_4=”D”
MANFID=0279,950b
FUNCID=2
怎么文章出现乱码呢?
[Comment ID #29929 Will Be Quoted Here]
不是乱码, 那个就是看到的原来的东西。
Michael,哈哈,是越来越厉害了呀,死鸟:)
[Comment ID #29936 Will Be Quoted Here]
哈哈,其实没啥技术含量 🙁
Thank you, I have recently been looking for information approximately this subject for a
while and yours is the best I’ve came upon so far.
However, what concerning the bottom line? Are you sure
concerning the source?
Great blog here! Also your website loads up fast!
What host are you using? Can I get your affiliate link to your
host? I wish my site loaded up as fast as yours lol
I delight in, cause I discovered exactly what I
was taking a look for. You have ended my four day long hunt!
God Bless you man. Have a great day. Bye
Nice post. I learn something totally new and challenging on blogs I stumbleupon on a daily basis.
It’s always exciting to read articles from other writers and use something from other web sites.
Hi! I’ve been following your site for some time now and
finally got the courage to go ahead and give
you a shout out from Kingwood Texas! Just wanted to tell you keep up the good work!
Hi, I would like to subscribe for this website to take newest updates, thus where can i do
it please assist.