Yes, it works! Thank you.
But it doesn't seem to be perfect. In lsusb results, there are some "unrecognized" messages.
ttyUSB0, ttyUSB1, ttyUSB2 and ttyUSB3 are generated and only /dev/ttyUSB2 can be operated as a modem.
When I used CHU-628S modem, /dev/ttyUSB0 was a modem and /dev/ttyUSB3 can be also available to send AT command using the screen command during 3G connection. So I can monitor the modem and also send SMS.
But with this new modem, the others do not respond to AT command in screen command.
1. Could you give me more information on the above matter...
In Windows, it's possible to using SMS during 3G connection.
Actually I need the extra port for SMS to control the ubuntu box with SMS.
I am configuring the ubuntu 8.04 server (kernel 2.6.24-25-server) as a 3G router according to
Ziesemer's method.
2. To automate the execution of usb_modeswitch, I added 80-usb_modeswith.rules in /etc/udev/rules.d/ according to Ziesemer's method, but it did not work.
So I added the followings in the end of /etc/rc.local:
/etc/rc.local
....
/usr/sbin/usb_modeswitch
modprobe option
echo "0x16d8 0x700a" > /sys/bus/usb-serial/drivers/option1/new_id
/etc/init.d/networking restart # to reexecute ppp connection
exit 0
Please give some comments on automation.
3. Differences between versions
At the beginning I installed usb_modeswitch using "sudo aptitude install usb-modeswitch" according to
this method. The installed version was 0.9.6 (not the latest version) and the endpoint should be specified in conf file.
3-1. usb_modeswitch0.9.6 + old modem (CHU-628S) + rc.local: OK. 3G connection successful in both cold boot and warm boot(reboot)
3-2. USB_modeswitch0.9.6 + new modem (CHU-629S) + rc.local: only usb_modeswitch successful during cold boot, so "/etc/init.d/networking restart" should be executed again. During reboot it's OK.
3-3. usb_modeswitch1.0.5 + old modem (CHU-628S) + rc.local: The login prompt does not appear. So I should log on to tty2. When I executed it again, usb_modeswitch stops after displaying the following messages.
OK, driver found ("usb-storage")
OK, driver "usb-storage" detached
Sometimes usb_modeswitch shows sending OK message, but there are no ttyUSBs.
3-4. usb_modeswitch1.0.5 + new modem (CHU-629S) + rc.local: only usb_modeswitch successful during cold boot, so "/etc/init.d/networking restart" should be executed again. During reboot it's OK.(the same with 3-2)
Messages from usb_modeswitch of CHU-629S
Code: Select all
Looking for target devices ...
No devices in target mode or class found
Looking for default devices ...
Found default devices (1)
Accessing device 011 on bus 004 ...
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
Received inquiry data (detailed identification)
-------------------------
Vendor String: CMOTECH
Model String: Mass Storage
Revision String: 2.3
-------------------------
Device description data (identification)
-------------------------
Manufacturer: CMOTECH CO., LTD.
Product: CMOTECH CDMA Technologies
Serial No.: 1234567890ABCDEF
-------------------------
Setting up communication with interface 0 ...
Trying to send the message to endpoint 0x01 ...
OK, message successfully sent
Device is gone, skipping any further commands
-> Run lsusb to note any changes. Bye.
lsusb -v -d 0x16d8:0x700a
Code: Select all
Bus 004 Device 012: ID 16d8:700a
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x16d8
idProduct 0x700a
bcdDevice 0.00
iManufacturer 2 CMOTECH CO., LTD.
iProduct 1 CMOTECH CDMA Technologies
iSerial 3 1234567890ABCDEF
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 188
bNumInterfaces 5
bConfigurationValue 1
iConfiguration 5 CMOTECH Configuration
bmAttributes 0xa0
(Bus Powered)
Remote Wakeup
MaxPower 500mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 255 Vendor Specific Subclass
bInterfaceProtocol 255 Vendor Specific Protocol
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 32
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 32
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 255 Vendor Specific Subclass
bInterfaceProtocol 255 Vendor Specific Protocol
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 32
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 32
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 2
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 8 Mass Storage
bInterfaceSubClass 6 SCSI
bInterfaceProtocol 80 Bulk (Zip)
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x03 EP 3 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 3
bAlternateSetting 0
bNumEndpoints 3
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 255 Vendor Specific Subclass
bInterfaceProtocol 255 Vendor Specific Protocol
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x84 EP 4 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 5
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x85 EP 5 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 32
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x04 EP 4 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 32
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 4
bAlternateSetting 0
bNumEndpoints 3
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 255 Vendor Specific Subclass
bInterfaceProtocol 255 Vendor Specific Protocol
iInterface 0
** UNRECOGNIZED: 05 24 00 10 01
** UNRECOGNIZED: 0d 24 0f 01 00 00 00 00 00 40 01 00 00
** UNRECOGNIZED: 05 24 06 04 04
** UNRECOGNIZED: 15 24 12 20 01 98 b0 6a 49 b0 9e 48 96 94 46 d9 9a 28 ca 4e 5d
** UNRECOGNIZED: 06 24 13 00 01 04
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x86 EP 6 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 5
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x87 EP 7 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 32
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x05 EP 5 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 32
Device Qualifier (for other device speed):
bLength 10
bDescriptorType 6
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
bNumConfigurations 1
Device Status: 0x0000
(Bus Powered)
dmesg after usb_modeswitch
Code: Select all
[ 4115.120841] usb 4-1: usbfs: process 7347 (usb_modeswitch) did not claim interface 0 before use
[ 4115.121891] usb 4-1: USB disconnect, address 11
[ 4120.535752] usb 4-1: new high speed USB device using ehci_hcd and address 12
[ 4120.688580] usb 4-1: configuration #1 chosen from 1 choice
[ 4120.690497] option 4-1:1.0: GSM modem (1-port) converter detected
[ 4120.690844] usb 4-1: GSM modem (1-port) converter now attached to ttyUSB0
[ 4120.690977] option 4-1:1.1: GSM modem (1-port) converter detected
[ 4120.691139] usb 4-1: GSM modem (1-port) converter now attached to ttyUSB1
[ 4120.715445] scsi12 : SCSI emulation for USB Mass Storage devices
[ 4120.717431] option 4-1:1.3: GSM modem (1-port) converter detected
[ 4120.717845] usb 4-1: GSM modem (1-port) converter now attached to ttyUSB2
[ 4120.718015] option 4-1:1.4: GSM modem (1-port) converter detected
[ 4120.718207] usb 4-1: GSM modem (1-port) converter now attached to ttyUSB3
[ 4120.719418] usb-storage: device found at 12
[ 4120.719424] usb-storage: waiting for device to settle before scanning
[ 4125.705114] usb-storage: device scan complete
[ 4125.706314] scsi 12:0:0:0: Direct-Access CMOTECH Mass Storage 2.3 PQ: 0 ANSI: 2
[ 4125.707080] scsi 12:0:0:1: Direct-Access CMOTECH Mass Storage 2.3 PQ: 0 ANSI: 2
[ 4125.708977] sd 12:0:0:0: [sdb] 119808 512-byte hardware sectors (61 MB)
[ 4125.710378] sd 12:0:0:0: [sdb] Write Protect is off
[ 4125.710399] sd 12:0:0:0: [sdb] Mode Sense: 0f 0e 00 00
[ 4125.710404] sd 12:0:0:0: [sdb] Assuming drive cache: write through
[ 4125.713697] sd 12:0:0:0: [sdb] 119808 512-byte hardware sectors (61 MB)
[ 4125.714545] sd 12:0:0:0: [sdb] Write Protect is off
[ 4125.714555] sd 12:0:0:0: [sdb] Mode Sense: 0f 0e 00 00
[ 4125.714560] sd 12:0:0:0: [sdb] Assuming drive cache: write through
[ 4125.714646] sdb: unknown partition table
[ 4125.718000] sd 12:0:0:0: [sdb] Attached SCSI removable disk
[ 4125.718082] sd 12:0:0:0: Attached scsi generic sg2 type 0
[ 4125.719362] sd 12:0:0:1: [sdc] Attached SCSI removable disk
[ 4125.719435] sd 12:0:0:1: Attached scsi generic sg3 type 0