ubuntu 在 R40e 上 還有 Debian 在 Sempron 2600 上

2012年2月14日 星期二

D-Link HSPDA Dongle - DWN-156

會先出現 cd rom,然後要切 modeswitch,才會出現 serial port。
在 windows 上會出現三個 serial port (其中一個是 USB Modem):
  1. D-Link HSPDA DataCard Diagnostics Interface
  2. D-Link HSPDA DataCard NMEA Device
  3. D-Link HSPDA DataCard Propertiery USB Modem

這又是一個 有 usb cdrom 模式的 3g dongle。
剛插入系統,會是 cd rom。
要先 switch 到 modem 後,才會出現 usb serial。

剛插入時,vid , pid 是:
New USB device found, idVendor=07d1, idProduct=a804
mount 再 umount 後,vid, pid 是:
New USB device found, idVendor=07d1, idProduct=7e11
但是這時後也沒有出現 usb serial port。



大概用兩個步驟:
  1. usb-modeswitch, 切換到 modem mode
  2. 手動 load usb-serial ,指定 vid, pid

usb-modeswitch:

debian 已經有安裝,但是 /etc/usb_modeswitch.d/ 下面沒有 07d1:a804 的設定檔,
所以要寫 /etc/usb_modeswitch.d/ 下的 vid:pid 檔:
sudo vi /etc/usb_modeswitch.d/07d1:a804 ######################################################## # D-Link DWM-156 HSUPA 3.75G USB Modem DefaultVendor= 0x07d1 DefaultProduct=0xa804 TargetVendor= 0x07d1 TargetProduct= 0x7e11 MessageContent="5553424312345678000000000000061b000000020000000000000000000000" CheckSuccess=20 寫好就可以用 usb_modeswitch 來切了..

先插入 dwn-156, dmesg 內容是: [25387.281621] usb 2-1.1.4.2: new high speed USB device using ehci_hcd and address 19 [25387.391940] usb 2-1.1.4.2: New USB device found, idVendor=07d1, idProduct=a804 [25387.391946] usb 2-1.1.4.2: New USB device strings: Mfr=3, Product=2, SerialNumber=4 [25387.391950] usb 2-1.1.4.2: Product: D-Link WCDMA Technologies MSM [25387.391954] usb 2-1.1.4.2: Manufacturer: D-Link,Incorporated [25387.391957] usb 2-1.1.4.2: SerialNumber: MF112DDLKD010000 [25387.392114] usb 2-1.1.4.2: configuration #1 chosen from 1 choice [25387.394534] scsi16 : SCSI emulation for USB Mass Storage devices [25387.394655] usb-storage: device found at 19 [25387.394659] usb-storage: waiting for device to settle before scanning [25392.392130] usb-storage: device scan complete [25392.392810] scsi 16:0:0:0: CD-ROM HSPA USB SCSI CD-ROM 2.31 PQ: 0 ANSI: 2 [25392.397282] sr1: scsi-1 drive [25392.397481] sr 16:0:0:0: Attached scsi CD-ROM sr1 [25392.397632] sr 16:0:0:0: Attached scsi generic sg4 type 5 用 usb_modeswitch 來切換 mode: $ sudo usb_modeswitch -c /etc/usb_modeswitch.d/07d1:a804 Looking for target devices ... No devices in target mode or class found Looking for default devices ... Found devices in default mode or class (1) Accessing device 022 on bus 002 ... Using endpoints 0x01 (out) and 0x81 (in) Using endpoints 0x01 (out) and 0x81 (in) Inquiring device details; driver will be detached ... Looking for active driver ... OK, driver found ("usb-storage") OK, driver "usb-storage" detached SCSI inquiry data (for identification) ------------------------- Vendor String: HSPA Model String: USB SCSI CD-ROM Revision String: 2.31 ------------------------- USB description data (for identification) ------------------------- Manufacturer: D-Link,Incorporated Product: D-Link WCDMA Technologies MSM Serial No.: MF112DDLKD010000 ------------------------- Setting up communication with interface 0 ... Using endpoint 0x01 for message sending ... Trying to send message 1 to endpoint 0x01 ... OK, message successfully sent Resetting response endpoint 0x81 Resetting message endpoint 0x01 Checking for mode switch (max. 20 times, once per second) ... Waiting for original device to vanish ... Waiting for original device to vanish ... Original device can't be accessed anymore. Good. Searching for target devices ... Found correct target device Mode switch succeeded. Bye.
看一下 dmesg: [38715.226573] usb 2-1.1.4.2: new high speed USB device using ehci_hcd and address 23 [38715.337316] usb 2-1.1.4.2: New USB device found, idVendor=07d1, idProduct=7e11 [38715.337321] usb 2-1.1.4.2: New USB device strings: Mfr=3, Product=2, SerialNumber=4 [38715.337324] usb 2-1.1.4.2: Product: D-Link WCDMA Technologies MSM [38715.337327] usb 2-1.1.4.2: Manufacturer: D-Link,Incorporated [38715.337329] usb 2-1.1.4.2: SerialNumber: MF112DDLKD010000 [38715.337460] usb 2-1.1.4.2: configuration #1 chosen from 1 choice
已經切換了。

然後動 load usb-serial module,指定 vid,pid sudo modprobe usbserial vendor=0x07d1 product=0x7e11
dmesg 可以看到 ttyUSB 出現: [38715.339951] usbserial_generic 2-1.1.4.2:1.0: generic converter detected [38715.340069] usb 2-1.1.4.2: generic converter now attached to ttyUSB0 [38715.340178] usbserial_generic 2-1.1.4.2:1.1: generic converter detected [38715.340280] usb 2-1.1.4.2: generic converter now attached to ttyUSB1 [38715.340537] scsi20 : SCSI emulation for USB Mass Storage devices [38715.340695] usb-storage: device found at 23 [38715.340699] usb-storage: waiting for device to settle before scanning [38715.340788] usbserial_generic 2-1.1.4.2:1.3: generic converter detected [38715.340889] usb 2-1.1.4.2: generic converter now attached to ttyUSB2 [38720.337127] usb-storage: device scan complete

這時候,在 panel 的 network widget 就可以看到 "Chungwha Telecom..",
打勾 就可以連上了。



ref: http://www.draisberghof.de/usb_modeswitch/bb/viewtopic.php?t=817&sid=e08d0632f3a91e6379a0367bd258809c

沒有留言:

標籤

網誌存檔