Author Message

<  Device Information  ~  Celot K-300 0x05c6x0x1000

PostPosted: Wed Apr 18, 2012 9:41 am
Posts: 16777212Joined: Wed Apr 18, 2012 8:21 am
Hello,

I have small trouble with my new modem Celot K-300. I am beginner in linux.

I have done:

1) copy /lib/udev/rules.d/61-option-modem-modeswitch.rules to /etc/udev/rules.d
2) in file /etc/udev/rules.d/61-option-modem-modeswitch.rules comment "#ATTRS{idVendor}=="05c6", ATTRS{idProduct}=="1000", RUN+="modem-modeswitch..."
3) if plugin my 3G modem now ... lsusb: ID 05c6:1000 Qualcomm, Inc.
4) Now I must with terminal run "eject sr1" or "eject /dev/sr1" command ... Yes now is modem working.

I would want try your usb_modeswitch for automatic switch.

Thank you

Vecino


This is my config file "celot":
Code:
#######################################################
# CELOT K-300

DefaultVendor= 0x05c6
DefaultProduct=0x1000

TargetVendor=  0x211f
TargetProduct= 0x6801

CheckSuccess=20

MessageContent="55534243123456780000000000000601000000000000000000000000000000"
NeedResponse=1



If run usb_modeswitch -c /home/vecino/celot:
Code:
Looking for target devices ...
 No devices in target mode or class found
Looking for default devices ...
 Found devices in default mode, class or configuration (1)
Accessing device 016 on bus 007 ...
Getting the current device configuration ...
 OK, got current device configuration (1)
Using endpoints 0x08 (out) and 0x87 (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: CELOT   
   Model String: CD-ROM         
Revision String: 1.00
-------------------------

USB description data (for identification)
-------------------------
Manufacturer: CELOT Corporation
     Product: USB MMC Storage
  Serial No.: 000000000002
-------------------------
Setting up communication with interface 0
Using endpoint 0x08 for message sending ...
Trying to send message 1 to endpoint 0x08 ...
 OK, message successfully sent
Reading the response to message 1 (CSW) ...
 OK, response successfully read (0 bytes).
Resetting response endpoint 0x87
Resetting message endpoint 0x08

Checking for mode switch (max. 20 times, once per second) ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 No new devices in target mode or class found

Mode switch has failed. Bye.



When the modem is working properly - lsusb:

Code:
Bus 007 Device 015: ID 211f:6801 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x211f
  idProduct          0x6801
  bcdDevice            0.00
  iManufacturer           1 CELOT Corporation
  iProduct                2 CELOT CDMA Products
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength          108
    bNumInterfaces          4
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              3 Data Interface
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0010  1x 16 bytes
        bInterval             128
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
    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              3 Data Interface
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x84  EP 4 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x04  EP 4 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              3 Data Interface
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x86  EP 6 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x06  EP 6 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        3
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     80 Bulk (Zip)
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x87  EP 7 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x08  EP 8 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
Device Status:     0x0000
  (Bus Powered)


Offline Profile
PostPosted: Wed Apr 18, 2012 10:41 pm
Site AdminPosts: 4699Joined: Sat Nov 03, 2007 12:30 am
Well, for a Linux beginner, you have certainly done a very good job here ...
I think we already have all the important bits together for this device.

I assume you have usb_modeswitch's data package installed, from your distribution or from source. Then you will have a file named "/lib/udev/rules.d/40-usb_modeswitch.rules". It should work from that place - if there is trouble (nothing happening at all), you can always copy or move it to "/etc/udev/rules.d" later.

You don't have to edit that file as there is already a line for all "05c6:1000" devices.

Now edit your config file. Just change the line with MessageContent:
Code:
MessageContent="5553424312345678000000000000061b000000020000000000000000000000"
Now - important! - rename your file to "05c6:1000:uMa=CELOT". Yes, that's right, you are putting information into the file name.

The last step is to put this file into the folder "/etc/usb_modeswitch.d".

For a peek into what is happening when you plug in after all that, set "EnableLogging" to 1 in the file "/etc/usb_modeswitch.conf".



Offline Profile
PostPosted: Thu Apr 19, 2012 8:56 am
Posts: 16777212Joined: Wed Apr 18, 2012 8:21 am
Dear Josh,

thank you for help. Yes I have usb_modeswitch's data package installed, from distro source (Linux Mint Debian Edition - 12). Could you please explain me for next time. How can I find the correct MessageContent for new device ?

I will be report my new knowledge in our Czech Linux community forum for new beginners.

Thanks

Vecino :)


My logfile now:

Code:
USB_ModeSwitch log from Thu Apr  19 00:31:39 CEST 2012

Raw args from udev: /7-2:1.0

Using global config file: /etc/usb_modeswitch.conf
Using top device dir /sys/bus/usb/devices/7-2
----------------
USB values from sysfs:
  manufacturer    CELOT Corporation
  product    USB MMC Storage
  serial    000000000002
----------------
bNumConfigurations is 1 - don't check for active configuration
Found packed config collection /usr/share/usb_modeswitch/configPack.tar.gz
Checking storage tree in sysfs ...
 loop 0/20
 loop 1/20
 loop 2/20
 Storage tree is ready
Reading SCSI values ...
----------------
SCSI values from sysfs:
 vendor    CELOT 
 model    CD-ROM         
 rev    1.00
----------------
checking config: /etc/usb_modeswitch.d/05c6:1000:uMa=CELOT
matching usb(manufacturer)
  match string1 (exact):  CELOT
  match string2 (blanks): CELOT
 device string: CELOT Corporation
! matched. Reading config data
Using config file from override folder /etc/usb_modeswitch.d
Logger is /usr/bin/logger
config: TargetVendor set to 211f
config: TargetProduct set to 6801
Driver module is "option", ID path is /sys/bus/usb-serial/drivers/option1

Command to be run:
usb_modeswitch -I -W -D -s 20 -u -1 -b 7 -g 2 -v 05c6 -p 1000 -f $configBuffer

Verbose debug output of usb_modeswitch and libusb follows
(Note that some USB errors are to be expected in the process)
--------------------------------

Reading long config from command line

 * usb_modeswitch: handle USB devices with multiple modes
 * Version 1.2.3 (C) Josua Dietze 2012
 * Based on libusb0 (0.1.12 and above)

 ! PLEASE REPORT NEW CONFIGURATIONS !

DefaultVendor=  0x05c6
DefaultProduct= 0x1000
TargetVendor=   0x211f
TargetProduct=  0x6801
TargetClass=    not set
TargetProductList=""

DetachStorageOnly=0
HuaweiMode=0
SierraMode=0
SonyMode=0
QisdaMode=0
GCTMode=0
KobilMode=0
SequansMode=0
MobileActionMode=0
CiscoMode=0
MessageEndpoint=  not set
MessageContent="5553424312345678000000000000061b000000020000000000000000000000"
NeedResponse=0
ResponseEndpoint= not set

InquireDevice disabled
Success check enabled, max. wait time 20 seconds
System integration mode enabled


Use given bus/device number: 007/002 ...
Looking for default devices ...
 bus/device number matched
  searching devices, found USB ID 05c6:1000
   found matching vendor ID
   found matching product ID
   adding device
 Found device in default mode, class or configuration (1)
Skipping the check for the current configuration
Using first interface: 0x00
Using endpoints 0x08 (out) and 0x87 (in)

USB description data (for identification)
-------------------------
Manufacturer: CELOT Corporation
     Product: USB MMC Storage
  Serial No.: 000000000002
-------------------------
Looking for active driver ...
 OK, driver found ("usb-storage")
 OK, driver "usb-storage" detached
Setting up communication with interface 0
Using endpoint 0x08 for message sending ...
Trying to send message 1 to endpoint 0x08 ...
 OK, message successfully sent
Resetting response endpoint 0x87
 Could not reset endpoint (probably harmless): -9
Resetting message endpoint 0x08
 Could not reset endpoint (probably harmless): -9
 Device is gone, skipping any further commands
Bus/dev search active, referring success check to wrapper. Bye.

ok:busdev
--------------------------------
(end of usb_modeswitch output)

Checking success of mode switch for max. 20 seconds ...
 Waiting for device file system (1 sec.) ...
 Reading attributes ...
 All attributes matched
Mode switching was successful, found 211f:6801 (CELOT Corporation: CELOT CDMA Products)
Now checking for bound driver ...
 driver has bound, device is known
Checking for AVOID_RESET_QUIRK kernel attribute
 AVOID_RESET_QUIRK activated

All done, exiting


Offline Profile
PostPosted: Fri Apr 20, 2012 7:25 pm
Site AdminPosts: 4699Joined: Sat Nov 03, 2007 12:30 am
Seems that everything is working smoothly now. If you want, give me a name of your choice (via PM or mail) and I'll include you as the contributor of this device.

To make any new device work I usually give this advice:
  • if the vendor ID is known, try existing config files, just adapting the product ID
  • if this does not apply (or doesn't work), look what the Windows driver is doing to switch the mode. This usually involves installing the on-board driver/software, then re-plugging the device while "sniffing" on the data exchange between driver and device, using one of the tools available for that purpose.
Finding the relevant command that initiates the mode switch is a matter of logic thinking. In most cases no deeper knowledge of USB protocols is required though it helps obviously.

The central point is to find the right device ID for sniffing. The "install" device which contains the driver/software will be visible ("present") only for a moment once the stick is plugged in with the driver already in place.
That means that the "sniffing hook" has to be attached in advance to a device ID that is not currently active but appears in a long list of all devices ever connected to the computer's ports.

Because the "install" device is only short-lived, the sniffing log will stop growing very soon. And just before it ends there has to be our mode switching command somewhere. At the bottom you will usually find a SURPRISE_REMOVAL system message. Switching modes is like an unplug event for the computer.

See the main doc page, paragraph "Contribute" for a link to the SniffUSB program (up to Win XP only) and a link to an example case.



Offline Profile

Display posts from previous:  Sort by:

All times are UTC + 1 hour [ DST ]
Page 1 of 1
4 posts
Users browsing this forum: No registered users and 1 guest
Search for:
Post new topic  Reply to topic
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum