原安装环境是:
IBM T43/ Ubuntu 7.10
------------从这里开始------------
配置过程主要是参考下边这段,已经在我自己的IBM本本上调试成功。但是有的人反映modem not responding,请参考后边的解决方案。
==================================
1. 硬件信息中看看能不能认出来你的无线上网卡
$ dmesg
可以看到
0.0: ttyS3 at I/O 0x2e8 (irq = 20) is a 16C950/954
这样的输出.
2.映射到/dev/modem
$ sudo ln -sf /dev/ttyS3 /dev/modem
3.由于wvdial在ubuntu中已经默认安装(7.04),所以可以直接这样
$ sudo gedit /etc/wvdial.conf
更改为如下配置:
[Modem0]
Modem = /dev/modem
Baud = 57600
SetVolume = 0
Dial Command = ATDT
Init1 = ATZ
FlowControl = Hardware (CRTSCTS)
[Dialer Defaults]
Username = CARD
Password = CARD
Phone = #777
Stupid Mode = 1
Inherits = Modem0
5.安装setserial
用新立得搜索关键字就可以安装了。当然,我猜
$ sudo apt-get install setserial
也是可以的.^_^
然后
$ sudo setserial /dev/ttyS3 baud_base 230400
6.完成后就可以拨号上网了,在终端输入
$ wvdial
正常的话应该可以看到如下的信息:
--> WvDial: Internet dialer version 1.56
--> Cannot set information for serial port.
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Modem initialized.
--> Sending: ATDT#777
--> Waiting for carrier.
ATDT#777
CONNECT
--> Carrier detected. Starting PPP immediately.
--> Starting pppd at Fri Jun 1 20:14:28 2007
--> Warning: Could not modify /etc/ppp/pap-secrets: Permission denied
--> --> PAP (Password Authentication Protocol) may be flaky.
--> Warning: Could not modify /etc/ppp/chap-secrets: Permission denied
--> --> CHAP (Challenge Handshake) may be flaky.
--> Pid of pppd: 12836
--> Using interface ppp0
--> local IP address 220.192.92.222
--> remote IP address 220.192.80.129
--> primary DNS address 220.192.8.58
--> secondary DNS address 220.192.32.103
==================================
分析,大部分不成功的原因是抢占端口造成not responding,我自己的机器上发现,是因为挂了外接的u
sb硬盘盒。
改个端口,或者手动(setserial)调试一下,查看一下端口。因为大部分linux都默认只是启动4个,如下列表
/dev/ttyS0 (COM1), port 0x3f8, irq 4
/dev/ttyS1 (COM2), port 0x2f8, irq 3
/dev/ttyS2 (COM3), port 0x3e8, irq 4
/dev/ttyS3 (COM4), port 0x2e8, irq 3
IRQ 3: COM2
IRQ 4: COM1
IRQ 5: LPT2(手册里好像推荐使用这个端口,是打印机的,但是不用那么麻烦)
IRQ 7: LPT1
--------------------------
所有端口号
--------------------------
IRQ 0 Timer channel 0
IRQ 1 Keyboard
IRQ 2 Cascade for controller 2
IRQ 3 Serial port 2
IRQ 4 Serial port 1
IRQ 5 Parallel port 2 (Reserved in PS/2)
IRQ 6 Floppy diskette
IRQ 7 Parallel port 1
IRQ 8 Real-time clock
IRQ 9 Redirected to IRQ2
IRQ 10 Reserved
IRQ 11 Reserved
IRQ 12 Reserved (Auxiliary device in PS/2)
IRQ 13 Math coprocessor
IRQ 14 Hard disk controller
IRQ 15 Reserved
所以有人在网上写道,有中断号 20,我比较孤陋寡闻。:(
下边的部分是帮助你查看大致问题所在
可以 man setserial看一下帮助。
以下几个命令参数很有用的
1. baud_base xxx 上边有提到不再介绍
2. irq x 设置端口号,一般系统会自动分配,但是有时候也会有些问题,所以需要在这里尝试一下
sudo setserial /dev/ttySn(n=0,1,2,3)
3. closing_wait xxx 默认的是3000,可以适当的调整
sudo setserial /dev/ttySn(n=0,1,2,3,)
上边主要是设置参数,下边的是查看用的参数
1. -g 可以查看单个ttySn,也可以查看所有的
sudo setserial -g /dev/ttyS*
/dev/ttyS0, UART: undefined, Po/dev/ttyS0, UART: undefined, Port: 0x03f8, IRQ: 4
/dev/ttyS1, UART: unknown, Port: 0x02f8, IRQ: 3
/dev/ttyS2, UART: 16950/954, Port: 0x03e8, IRQ: 3(这个就是系统分配的中断,现在显示正常,如果显示,resource busy....之类的,就需要改中断号,或者把不用的设备拿掉,或者换个端口试试,例如鼠标,硬盘盒)
/dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3
Cannot get serial info: Invalid argument
rt: 0x03f8, IRQ: 4
/dev/ttyS1, UART: unknown, Port: 0x02f8, IRQ: 3
/dev/ttyS2, UART: 16950/954, Port: 0x03e8, IRQ: 3
/dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3
Cannot get serial info: Invalid argument
从上边的列表能看得出有三个用了一个中断号3。
2. -a 查看一下ttyS2的明细信息
sudo setserial -a /dev/ttyS2
/dev/ttyS2, Line 2, UART: 16950/954, Port: 0x03e8, IRQ: 3
Baud_base: 230400, close_delay: 50, divisor: 0
closing_wait: none
Flags: spd_normal skip_test
看到closing_wait : none,我重新设置了一下为3000
然后用上边的命令再次确认。
然后回上边参考的部分,再次试试看。
sudo wvdial
WvDial<*1>: WvDial: Internet dialer version 1.56
WvDial<*1>: Initializing modem.
WvDial<*1>: Sending: ATZ
WvDial<*1>: Sending: ATQ0
WvDial Modem<*1>: OK
WvDial<*1>: Re-Sending: ATZ
WvDial Modem<*1>: OK
WvDial<*1>: Initializing modem.
WvDial<*1>: Sending: ATZ
WvDial<*1>: Sending: ATQ0
WvDial Modem<*1>: OK
WvDial<*1>: Re-Sending: ATZ
WvDial Modem<*1>: OK
WvDial<*1>: Initializing modem.
WvDial<*1>: Sending: ATZ
WvDial<*1>: Sending: ATQ0
WvDial Modem<*1>: OK
WvDial<*1>: Re-Sending: ATZ
WvDial Modem<*1>: OK
有反应了,不再是modem not responding
我重复了大概5次,终于成功上网了
WvDial<*1>: WvDial: Internet dialer version 1.56
WvDial<*1>: Initializing modem.
WvDial<*1>: Sending: ATZ
WvDial<*1>: Sending: ATQ0
WvDial Modem<*1>: OK
WvDial<*1>: Re-Sending: ATZ
WvDial Modem<*1>: OK
WvDial<*1>: Initializing modem.
WvDial<*1>: Sending: ATZ
WvDial<*1>: Sending: ATQ0
WvDial Modem<*1>: OK
WvDial<*1>: Re-Sending: ATZ
WvDial Modem<*1>: OK
WvDial<*1>: Initializing modem.
WvDial<*1>: Sending: ATZ
WvDial Modem<*1>: OK
WvDial<*1>: Modem initialized.
WvDial<*1>: Sending: ATDT#777
WvDial<*1>: Waiting for carrier.
WvDial Modem<*1>: CONNECT
WvDial<*1>: Carrier detected. Starting PPP immediately.
WvDial<Notice>: Starting pppd at Wed Nov 28 20:21:54 2007
WvDial<Notice>: Pid of pppd: 6289
WvDial<*1>: Using interface ppp0
WvDial<*1>: pppd: