- Ubuntu系统下无线上网卡的使用经验
- 发布时间:2009-01-02 16:56:16 浏览数:14208 发布者:tznktg 设置字体【大 中 小】
#2楼发布者:tznktg时间:2009-01-02 16:56:32
三、华为T618手机上网
华为T618是一款3G手机,在香港叫U626,支持GPRS和UMTS。我是使用USB线连在电脑上实现无线上网。原来这个手机只要使用usb线插入电脑后,/dev下就会出现ttyUSB0和ttyUSB1两个文件设备。但在一次修理后,这样不行了,估计是换了手机主板,ubuntu不能识别了。后来通过网上查找资料,找到了一种解决方法。
首先用lsusb命令验证手机是否被正确识别,并查找相关信息:
代码:
# lsusb | grep Huawei
Bus 003 Device 003: ID 12d1:1204 Huawei Technologies Co., Ltd.
# lsusb -v -s 003:003
Bus 003 Device 003: ID 12d1:1204 Huawei Technologies Co., Ltd.
............
idVendor 0x12d1 Huawei Technologies Co., Ltd.
idProduct 0x1204
bcdDevice 0.00
iManufacturer 1 HUAWEI Technologies
iProduct 2 HUAWEI Mobile
iSerial 0
............
记下idProduct和idVendor的值
创建/etc/udev/rules.d/50-huawei-t618.rules文件
内容如下:
代码:
SUBSYSTEM=="usb", SYSFS{idProduct}=="1204", SYSFS{idVendor}=="12d1", RUN+="/sbin/modprobe usbserial vendor=0x12d1 product=0x1204"
再重新插入手机的usb线,验证一下,如下就说明配置成功了:
代码:
# ls /dev/ttyU*
/dev/ttyUSB0 /dev/ttyUSB1
如果手机一插上就识别出ttyUSB0设置,以上操作就可以省略。
配置连接,图型界面的network-manager里并没有找到选择设备的选项,只好使用字符界面的pppconfig了。由于接入点配置在手机里面,所以也不涉及APN参数。就不贴图了,把选项列举一下:
代码:
sudo pppconfig
(1)选Create
(2)Provider Name:我用的是t618
(3)DNS:Dynamic,自动获得动态的DNS
(4)Authentication Method:CHAP
(5)Username和Password是不需要的
(6)Speed:如果是GPRS用115200就够了,EDGE就230400,UMTS就460800。HSDPA没用过,可能需要在后面再加一下0。
(7)Pulse or Tone:Tone
(8)Phone Number:*99#
(9)Choose Modem Config Method:否
(10)Manually Select Modem Port:/dev/ttyUSB0
(11)Finished Write files and return to main menu.
上网用:pon t618,下网用:poff就可以了。
还是存在不能替换默认网关的问题。如果想要自动成为默认网关,可以修改/etc/ppp/peers/t618,增加一行:
代码:
replacedefaultroute
三、ZTE mv68小灵通上网卡
这也是一个PCMCIA卡。这个卡让我困惑了很长时间,因为插上后并没有出现ttyUSB0设备,lsusb也什么也没找到。其实只要看下dmesg:
代码:
[ 763.480084] pccard: PCMCIA card inserted into slot 0
[ 763.483463] pcmcia: registering new device pcmcia0.0
[ 763.570883] 0.0: ttyS1 at I/O 0x2f8 (irq = 3) is a TI16750
设备就是ttyS1,不像huawei E630属于usbserial。
再用pppconfig配置拨号连接就可以了。与前面说的GPRS上网类似,不同的主要是电话号码、设备名,一般需要一个公用的用户名和口令。
#3楼发布者:tznktg时间:2009-01-02 16:56:49
(这是以前参考文章,刚才又去看已经没了,从google的快照贴过来,以免以后找不到)
Contents
* 1 Introduction
* 2 Prologue
* 3 Kernel prerequesits
* 4 Software
* 5 Links
[edit] Introduction
This is my first How-to so bear with me :-)
This guide is written for people who want to use their UMTS/HSDPA Card with Gentoo/Linux. The first part of this guide will tell you what kernel options you will need to get the hardware working. The next part will be the configuration for the datacard to establish a ppp connection to your provider. In my case it's T-Mobile Austria.
[edit] Prologue
I got a HSDPA data card for my work and was bored that I've to switch to win if I want to use the card. So I thought I'll give it a try and try to get it to work with Gentoo. After googling around I discovered that there were hardly any tutorials about that card. What I discovered (from Win) was, that the card is/uses it's own USB Controller, where the UMTS/HSDPA modem is connected to.
[edit] Kernel prerequesits
To use this PC Card, see this guide.
Because of the USB Controller you need the OHCI. Furthermore you need USB to Serial converter for the Modem.
代码:
Linux Kernel Configuration: USB Support
Device Drivers --->
USB support --->
<M> OHCI HCD support
<M> USB Serial Converter support --->
[*] USB Generic Serial Driver
<M> USB driver for GSM and CDMA modems
This was my worst Problem, cause I've a Centrino Notebook which uses the UHCI support, so I thought, the USB thing has to be ok. With these options enabled, the Hardware should work.
To check this, lspci should show the USB Contoller:
# lspci -v | grep NEC
04:00.0 USB Controller: NEC Corporation USB (rev 43) (prog-if 10 [OHCI])
04:00.1 USB Controller: NEC Corporation USB (rev 43) (prog-if 10 [OHCI])
And the USB Device should show up as well:
# lsusb
Bus 006 Device 002: ID 12d1:1001
# lsusb -v -s 006:002
Bus 006 Device 002: ID 12d1:1001
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x12d1
idProduct 0x1001
bcdDevice 0.00
iManufacturer 1 HUAWEI Technologies
iProduct 2 HUAWEI Mobile
iSerial 0
bNumConfigurations 1
If the card is correctly recognized there the usbserial module should create new tty devices:
# find /dev/ | grep ttyU
/dev/ttyUSB2
/dev/ttyUSB1
/dev/ttyUSB0
This is your HSDPA Card.
If this links aren't created you should try to load usbserial with this command:
1. modprobe usbserial vendor=0x12d1 product=0x1001
Vendor and Product ID can be found by typing lsusb command
After this operation links to usb should appear ind /dev/tts directory
To establish the PPP connection to the provider, ppp support has to be enabled in the kernel:
代码:
Linux Kernel Configuration: PPP Support
Device Drivers --->
Network device support --->
<M> PPP (point-to-point protocol) support
<M> PPP support for async serial ports
[edit] Software
To initialize the card, enter the PIN code and login into the network, there is a small program on sourceforge which does that: Linux UMTS/GPRS command-line tool
Download that tool and install it by typing make and make install in the source directory.
To Log into the Network, show Homenetwork and Signal strength:
# comgt
Trying list of devices
SIM ready
Waiting for Registration..(120 sec max)
Registered on Home network: "23203",2
Signal Quality: 17,99
Ok, your card is ready, now you need to establish a PPP connection to your provider. I'm using kppp, but you can use any pppd frontend you want. This is my configfile for kppp:
File: /home/chris/.kde/share/config/kppprc
代码:
[Account0]
AccountingEnabled=0
AccountingFile=
Authentication=3
AutoDNS=1
AutoName=0
BeforeConnect=xterm -e /usr/local/bin/comgt -x -d /dev/ttyUSB2
BeforeDisconnect=
CallbackPhone=
CallbackType=0
Command=
DNS=
DefaultRoute=1
DisconnectCommand=
Domain=
ExDNSDisabled=0
Gateway=0.0.0.0
IPAddr=0.0.0.0
Name=web'n'walk
Password=1234
Phonenumber=*99***1#
ScriptArguments=
ScriptCommands=
StorePassword=1
SubnetMask=0.0.0.0
Username=user
VolumeAccountingEnabled=0
pppdArguments=defaultroute,crtscts,modem,noipdefault,usepeerdns,novj,debug
[General]
AutomaticRedial=0
DefaultAccount=web'n'walk
DefaultModem=HUAWAI
DisconnectOnXServerExit=1
DockIntoPanel=1
NumberOfAccounts=2
NumberOfModems=3
PPPDebug=0
QuitOnDisconnect=0
RedialOnNoCarrier=0
ShowLogWindow=1
[Graph]
Background=255,255,255
Enabled=true
InBytes=0,0,255
OutBytes=255,0,0
Text=0,0,0
[Modem0]
AnswerResponse=CONNECT
AnswerString=ATA
BusyResponse=BUSY
BusyWait=0
ConnectResponse=CONNECT
DLPResponse=DIGITAL LINE DETECTED
Device=/dev/ttyUSB0
DialString=ATD
Enter=CR
EscapeGuardTime=50
EscapeResponse=OK
EscapeString=+++
FlowControl=Hardware [CRTSCTS]
HangUpResponse=OK
HangupString=+++ATH
InitDelay=50
InitResponse=OK
InitString=AT+CFUN=1
InitString1=AT+CGDCONT=1,"IP","gprsinternet","",0,0
Name=HUAWAI
NoCarrierResponse=NO CARRIER
NoDialToneDetection=ATX3
NoDialToneResp=NO DIALTONE
PreInitDelay=50
RingResponse=RING
Speed=460800
Timeout=82
ToneDuration=70
UseLockFile=1
Volume=0
VolumeHigh=M1L3
VolumeMedium=M1L1
VolumeOff=M0L0
WaitForDialTone=1
[WindowPosition]
WindowPositionConWinX=487
WindowPositionConWinY=498
WindowPositionStatWinX=815
WindowPositionStatWinY=485
Don't forget to change the Access Point Name (APN) value on the InitString1=AT+CGDCONT=1,"IP","gprsinternet","",0,0 line from "gprsinternet" to the actual Internet APN. If you don't know the Internet APN, ask your service provider.
Now you have to start Kppp and simply push on connect. If you haven't entered the PIN yet, a window pops up where you have to enter it. After that, the card gets initialized and the PPP connection gets established. In your panel you can see a little icon (world) which shows you the activity. By right clicking on it you can get the actual status of your connection and disconnect from the network.
This HOWTO should also work for Huawei E620 and E618 data cards, however with that card you may experience lock-ups after you insert and reboots after you remove the card. In that case, you have to get a newer hardware revision of the card.
EDIT: Chris Wiggins had to remove the wait for dial tone option which was causing pppd to die unexpectedly with exit status 1:
KPPP > Configure > Modems > Huawei > Modem > Uncheck wait for dialtone before dialing
I hope this will help you. Here are two links where I got information:
[edit] Links
I've found this two tutorials on the net.
* HOWTO by Samiux
* HOWTO by Tazz_Tux
Discussion forum about the Huawei E620 Data Card problems:
* HUAWEI E620/Laptop Hangs (Vodacom3G)?
---KeX- 14:52, 1 February 2007 (UTC)
Retrieved from "http://gentoo-wiki.com/Huawei_E630"
Category: UMTS