特殊:Badtitle/NS100:Forum/hardware/Option3gCard

来自Ubuntu中文
Wikibot留言 | 贡献2009年5月12日 (二) 16:51的版本
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳到导航跳到搜索

{{#ifexist: :Forum/hardware/Option3gCard/zh | | {{#ifexist: Forum/hardware/Option3gCard/zh | | {{#ifeq: {{#titleparts:Forum/hardware/Option3gCard|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:Forum/hardware/Option3gCard|1|-1|}} | zh | | }}

HOWTO: Using Option 3G PCMCIA card on Edgy

Check if the computer supports the card out-of-the-box

See this list for compability: http://www.pharscape.org/component/option,com_frontpage/Itemid,1/limit,4/limitstart,4/

sudo tail -f /var/log/syslog

When you insert the card, you should see something like the following:

Nov 19 13:22:04 localhost kernel: [17179828.256000] pccard: CardBus card inserted into slot 0
Nov 19 13:22:04 localhost kernel: [17179828.256000] yenta EnE: chaning testregister 0xC9, 04 -> 04
Nov 19 13:22:04 localhost NetworkManager: <debug info>^I[1163938924.453689] nm_hal_device_added (): New device added (hal udi is '/org/freedesktop/Hal/devices/pci_1033_35').
Nov 19 13:22:04 localhost NetworkManager: <debug info>^I[1163938924.567560] nm_hal_device_added (): New device added (hal udi is '/org/freedesktop/Hal/devices/pci_1033_35_0').
Nov 19 13:22:04 localhost kernel: [17179828.432000] ohci_hcd: 2005 April 22 USB 1.1 'Open' Host Controller (OHCI) Driver (PCI)
Nov 19 13:22:04 localhost kernel: [17179828.432000] PCI: Enabling device 0000:02:00.0 (0000 -> 0002)
Nov 19 13:22:04 localhost kernel: [17179828.432000] ACPI: PCI Interrupt 0000:02:00.0[A] -> Link [LNKA] -> GSI 10 (level, low) -> IRQ 10
Nov 19 13:22:04 localhost kernel: [17179828.432000] PCI: Setting latency timer of device 0000:02:00.0 to 64
Nov 19 13:22:04 localhost kernel: [17179828.432000] ohci_hcd 0000:02:00.0: OHCI Host Controller
Nov 19 13:22:04 localhost kernel: [17179828.432000] ohci_hcd 0000:02:00.0: new USB bus registered, assigned bus number 5
Nov 19 13:22:04 localhost kernel: [17179828.432000] ohci_hcd 0000:02:00.0: irq 10, io mem 0xe2000000
Nov 19 13:22:04 localhost kernel: [17179828.516000] usb usb5: configuration #1 chosen from 1 choice
Nov 19 13:22:04 localhost kernel: [17179828.516000] hub 5-0:1.0: USB hub found
Nov 19 13:22:04 localhost kernel: [17179828.516000] hub 5-0:1.0: 1 port detected
Nov 19 13:22:04 localhost kernel: [17179828.620000] PCI: Enabling device 0000:02:00.1 (0000 -> 0002)
Nov 19 13:22:04 localhost kernel: [17179828.620000] ACPI: PCI Interrupt 0000:02:00.1[B] -> Link [LNKA] -> GSI 10 (level, low) -> IRQ 10
Nov 19 13:22:04 localhost kernel: [17179828.620000] PCI: Setting latency timer of device 0000:02:00.1 to 64
Nov 19 13:22:04 localhost kernel: [17179828.620000] ohci_hcd 0000:02:00.1: OHCI Host Controller
Nov 19 13:22:04 localhost kernel: [17179828.620000] ohci_hcd 0000:02:00.1: new USB bus registered, assigned bus number 6
Nov 19 13:22:04 localhost kernel: [17179828.620000] ohci_hcd 0000:02:00.1: irq 10, io mem 0xe2001000
Nov 19 13:22:04 localhost kernel: [17179828.708000] usb usb6: configuration #1 chosen from 1 choice
Nov 19 13:22:04 localhost kernel: [17179828.708000] hub 6-0:1.0: USB hub found
Nov 19 13:22:04 localhost kernel: [17179828.708000] hub 6-0:1.0: 1 port detected
Nov 19 13:22:05 localhost NetworkManager: <debug info>^I[1163938925.006258] nm_hal_device_added (): New device added (hal udi is '/org/freedesktop/Hal/devices/usb_device_0_0_0000_02_00_1').
Nov 19 13:22:05 localhost NetworkManager: <debug info>^I[1163938925.065330] nm_hal_device_added (): New device added (hal udi is '/org/freedesktop/Hal/devices/usb_device_0_0_0000_02_00_0').
Nov 19 13:22:05 localhost NetworkManager: <debug info>^I[1163938925.110200] nm_hal_device_added (): New device added (hal udi is '/org/freedesktop/Hal/devices/usb_device_0_0_0000_02_00_1_if0').
Nov 19 13:22:05 localhost NetworkManager: <debug info>^I[1163938925.172053] nm_hal_device_added (): New device added (hal udi is '/org/freedesktop/Hal/devices/usb_device_0_0_0000_02_00_0_if0').
Nov 19 13:22:05 localhost NetworkManager: <debug info>^I[1163938925.250977] nm_hal_device_added (): New device added (hal udi is '/org/freedesktop/Hal/devices/usb_device_0_0_0000_02_00_0_usbraw').
Nov 19 13:22:05 localhost NetworkManager: <debug info>^I[1163938925.296604] nm_hal_device_added (): New device added (hal udi is '/org/freedesktop/Hal/devices/usb_device_0_0_0000_02_00_1_usbraw').
Nov 19 13:22:07 localhost kernel: [17179831.068000] ohci_hcd 0000:02:00.1: wakeup
Nov 19 13:22:07 localhost kernel: [17179831.452000] usb 6-1: new full speed USB device using ohci_hcd and address 2
Nov 19 13:22:07 localhost kernel: [17179831.664000] usb 6-1: configuration #1 chosen from 1 choice
Nov 19 13:22:07 localhost NetworkManager: <debug info>^I[1163938927.861818] nm_hal_device_added (): New device added (hal udi is '/org/freedesktop/Hal/devices/usb_device_af0_6300__Serial_Numbe').
Nov 19 13:22:07 localhost NetworkManager: <debug info>^I[1163938927.909043] nm_hal_device_added (): New device added (hal udi is '/org/freedesktop/Hal/devices/usb_device_af0_6300__Serial_Numbe_if0').
Nov 19 13:22:07 localhost NetworkManager: <debug info>^I[1163938927.968372] nm_hal_device_added (): New device added (hal udi is '/org/freedesktop/Hal/devices/usb_device_af0_6300__Serial_Numbe_if1').
Nov 19 13:22:08 localhost NetworkManager: <debug info>^I[1163938928.012860] nm_hal_device_added (): New device added (hal udi is '/org/freedesktop/Hal/devices/usb_device_af0_6300__Serial_Numbe_if2').
Nov 19 13:22:08 localhost NetworkManager: <debug info>^I[1163938928.078164] nm_hal_device_added (): New device added (hal udi is '/org/freedesktop/Hal/devices/usb_device_af0_6300__Serial_Numbe_if3').
Nov 19 13:22:08 localhost kernel: [17179832.012000] usbcore: registered new driver usbserial
Nov 19 13:22:08 localhost kernel: [17179832.012000] drivers/usb/serial/usb-serial.c: USB Serial support registered for generic
Nov 19 13:22:08 localhost kernel: [17179832.012000] usbcore: registered new driver usbserial_generic
Nov 19 13:22:08 localhost kernel: [17179832.012000] drivers/usb/serial/usb-serial.c: USB Serial Driver core
Nov 19 13:22:08 localhost kernel: [17179832.016000] drivers/usb/serial/usb-serial.c: USB Serial support registered for Option 3G data card
Nov 19 13:22:08 localhost kernel: [17179832.016000] option 6-1:1.0: Option 3G data card converter detected
Nov 19 13:22:08 localhost kernel: [17179832.020000] usb 6-1: Option 3G data card converter now attached to ttyUSB0
Nov 19 13:22:08 localhost kernel: [17179832.020000] option 6-1:1.1: Option 3G data card converter detected
Nov 19 13:22:08 localhost kernel: [17179832.020000] usb 6-1: Option 3G data card converter now attached to ttyUSB1
Nov 19 13:22:08 localhost kernel: [17179832.020000] option 6-1:1.2: Option 3G data card converter detected
Nov 19 13:22:08 localhost kernel: [17179832.020000] usb 6-1: Option 3G data card converter now attached to ttyUSB2
Nov 19 13:22:08 localhost kernel: [17179832.020000] option 6-1:1.3: Option 3G data card converter detected
Nov 19 13:22:08 localhost kernel: [17179832.020000] usb 6-1: Option 3G data card converter now attached to ttyUSB3
Nov 19 13:22:08 localhost kernel: [17179832.020000] usbcore: registered new driver option
Nov 19 13:22:08 localhost kernel: [17179832.020000] drivers/usb/serial/option.c: Option Card (PC-Card to) USB to Serial Driver: v0.4
Nov 19 13:22:08 localhost NetworkManager: <debug info>^I[1163938928.194435] nm_hal_device_added (): New device added (hal udi is '/org/freedesktop/Hal/devices/usb_device_af0_6300__Serial_Numbe_if2_serial_usb_2').
Nov 19 13:22:08 localhost NetworkManager: <debug info>^I[1163938928.218645] nm_hal_device_added (): New device added (hal udi is '/org/freedesktop/Hal/devices/usb_device_af0_6300__Serial_Numbe_if0_serial_usb_0').
Nov 19 13:22:08 localhost NetworkManager: <debug info>^I[1163938928.242503] nm_hal_device_added (): New device added (hal udi is '/org/freedesktop/Hal/devices/usb_device_af0_6300__Serial_Numbe_if3_serial_usb_3').
Nov 19 13:22:08 localhost NetworkManager: <debug info>^I[1163938928.281788] nm_hal_device_added (): New device added (hal udi is '/org/freedesktop/Hal/devices/usb_device_af0_6300__Serial_Numbe_usbraw').
Nov 19 13:22:08 localhost NetworkManager: <debug info>^I[1163938928.305524] nm_hal_device_added (): New device added (hal udi is '/org/freedesktop/Hal/devices/usb_device_af0_6300__Serial_Numbe_if1_serial_usb_1').

Also ensure that you have it listed in lsusb:

lsusb

You should be able to find a line like this:

Bus 006 Device 002: ID 0af0:6300 Option

You now have a generic USB modem set up at /dev/ttyUSB0. Let's use wvdial to handle the ppp connection. Edit/create /etc/wvdial.conf. Mine is as follows:

[Dialer Defaults]

 Area Code =
 Phone = *99#
 Username = dummy
 Password = dummy
 Ask Password = 0
 Dial Command = ATD
 Stupid Mode = 1
 Compuserve = 0
 Force Address =
 Idle Seconds = 3000
 DialMessage1 =
 DialMessage2 =
 Auto DNS = 1

[Dialer pin]

Init1 = AT+CPIN=1234

[Dialer option]

 Modem = /dev/ttyUSB0
 Baud = 115200
 Init2 = ATZ
 Init3 = ATQ0 V1 E1 S0=0 &C1 &D2
 ISDN = 0
 Modem Type = Analog Modem

[Dialer 2gonly]

 Init4 = AT+COPS=0,0,"Vodacom-SA",0

[Dialer 3gonly]

 Init4 = AT+COPS=0,0,"Vodacom-SA",2

[Dialer DATA]

 Init5 = AT+CGDCONT=1,"IP","data.tre.dk","0.0.0.0",0,0

[Dialer VIP]

 Init5 = AT+CGDCONT=1,"IP","vip.tre.dk","0.0.0.0",0,0

[Dialer 384k]

 Init6 = AT+CGEQMIN=1,4,64,384,64,384
 Init7 = AT+CGEQREQ=1,4,64,384,64,384

[Dialer 144k]

 Init6 = AT+CGEQMIN=1,4,64,144,64,144
 Init7 = AT+CGEQREQ=1,4,64,144,64,144

[Dialer 64k]

 Init6 = AT+CGEQMIN=1,4,64,64,64,64
 Init7 = AT+CGEQREQ=1,4,64,64,64,64

You will need to change some of the settings in the file according to your local network. I think the phone number *99# is used by all networks for packet switched data, but check with your network. Importantly, you must replace the digits 1234 in the [pin] section with your sim card's PIN. The sections [Dialer internet], [Dialer myapn] and [Dialer myapn] sets up three APNs used by the Vodacom network. Again, check with your network, but "internet" is likely to work. You may want to adjust the idle-time in the above wvdial.conf, as 3 seconds (3000 milliseconds) may be to little for the card to settle, or to high for your patience. If you don't have a 3phone, I highly suggest that you visit the store where you got the datacard, and get them to remove the pin! - Believe me, this procedure may end up asking for the PUK-code, and then you need a 3phone as well. (No linux software support PUK entering yet, AFAIK!) remember to replace the APN in the above. (the entered one is data.tre.dk) Use this command to connect:

sudo wvdial pin option 3gonly DATA VIP

And explained: wvdial - the application itself. pin - runs the pincode part (don't use this argument if you had the pin removed from the card.) option - the main parametres. 3gonly - Sticks to the 3g networks 2gonly - Sticks to the 2g networks NON of the 2 above - chooses the best network automatically. DATA - Runs the [dialer DATA] section. VIP - Runs the [dialer VIP] section. The 2 above sets 2 different APN's - If one don't work, the other will the used...

Removing the card

It is a good idea to switch off the card before unplugging by typing

sudo cardctl eject