Author Message

<  Setup Discussion  ~  [Ubuntu 13.10] Micromax 300c No Auto Switch

PostPosted: Fri Feb 21, 2014 4:52 pm Reply with quote
Posts: 2Joined: Fri Feb 21, 2014 3:03 pm
Hi there, I believe I have an issue with my device not auto switching.

I've installed the latest usb_modeswitch 2.1.0 by running sudo make install. The same for the data package.
My device is a Micromax 300c. Its details are as follows
Code:
Default ID 05c6:2001
Target ID  1e0e:cefe

This device is present and supported as per http://www.draisberghof.de/usb_modeswitch/device_reference.txt
Code:
..
########################################################
# D-Link DWM-162-U5, Micromax MMX 300c
#
# Contributor: Zhang Le

DefaultVendor=  0x05c6
DefaultProduct= 0x2001

TargetVendor=   0x1e0e
TargetProductList="ce16,cefe"

MessageContent="5553424312345678000000000000061b000000020000000000000000000000"

NeedResponse=1

..

Now when I plug my device in, this is the output I get in dmesg.
Code:
$ dmesg
..
[  243.636117] usb 5-1: new full-speed USB device number 3 using uhci_hcd
[  243.805166] usb 5-1: New USB device found, idVendor=05c6, idProduct=2001
[  243.805178] usb 5-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  243.805185] usb 5-1: Product: USB MMC Storage
[  243.805191] usb 5-1: Manufacturer: Qualcomm, Incorporated
[  243.805198] usb 5-1: SerialNumber: Mass Storage
[  243.807298] usb-storage 5-1:1.0: USB Mass Storage device detected
[  243.807721] scsi10 : usb-storage 5-1:1.0
[  243.891304] init: usb-modeswitch-upstart main process (3031) terminated with status 127
[  244.809231] scsi 10:0:0:0: CD-ROM            CDMA2000 Modem            2.31 PQ: 0 ANSI: 2
[  244.821168] sr1: scsi-1 drive
[  244.821317] sr 10:0:0:0: Attached scsi CD-ROM sr1
[  244.821397] sr 10:0:0:0: Attached scsi generic sg2 type 5
[  249.439158] sr1: CDROM (ioctl) error, command: Xdread, Read track info 52 01 00 00 00 01 00 00 08 00
[  249.439171] sr: Sense Key : Hardware Error [current]
[  249.439174] sr: Add. Sense: No additional sense information
[  249.517154] sr 10:0:0:0: ioctl_internal_command return code = 8070000
[  249.517159]    : Sense Key : Hardware Error [current]
[  249.517163]    : Add. Sense: No additional sense information

I have to manually run the following
Code:
$ sudo usb_modeswitch \
  --default-vendor 05c6 \
  --default-product 2001 \
  --target-vendor 1e0e \
  --target-product cefe \
  --message-content 5553424312345678000000000000061b000000020000000000000000000000
[sudo] password for ######:
Look for target devices ...
 No devices in target mode or class found
Look for default devices ...
   product ID matched
 Found devices in default mode (1)
Access device 003 on bus 005
Get the current device configuration ...
 OK, got current device configuration (1)
Use interface number 0
Use endpoints 0x08 (out) and 0x87 (in)

USB description data (for identification)
-------------------------
Manufacturer: Qualcomm, Incorporated
     Product: USB MMC Storage
  Serial No.: Mass Storage
-------------------------
Looking for active driver ...
 OK, driver detached
Set up interface 0
Use endpoint 0x08 for message sending ...
Trying to send message 1 to endpoint 0x08 ...
 OK, message successfully sent
Reset response endpoint 0x87
 Could not reset endpoint (probably harmless): -99
Reset message endpoint 0x08
 Could not reset endpoint (probably harmless): -99
-> Run lsusb to note any changes. Bye!

At this point the device has been switched but is still detected as usb_storage
Code:
$ dmesg
..
[  325.528086] usb 5-1: USB disconnect, device number 3
[  327.040114] usb 5-1: new full-speed USB device number 4 using uhci_hcd
[  327.205160] usb 5-1: New USB device found, idVendor=1e0e, idProduct=cefe
[  327.205171] usb 5-1: New USB device strings: Mfr=1, Product=2, SerialNumber=4
[  327.205179] usb 5-1: Product: Qualcomm CDMA Technologies MSM
[  327.205185] usb 5-1: Manufacturer: Qualcomm, Incorporated
[  327.205191] usb 5-1: SerialNumber: Mass Storage
[  327.216196] usb-storage 5-1:1.3: USB Mass Storage device detected
[  327.216367] scsi11 : usb-storage 5-1:1.3
[  328.221229] scsi 11:0:0:0: Direct-Access     CDMA2000 Modem            2.31 PQ: 0 ANSI: 2
[  328.221896] sd 11:0:0:0: Attached scsi generic sg2 type 0
[  328.234700] sd 11:0:0:0: [sdb] Attached SCSI removable disk


I have to manually run modprobe so that the device gets detected as modem.
Code:
$  sudo modprobe usbserial vendor=0x1e0e product=0xcefe

The output of dmesg this time is
Code:
$ dmesg
..
[  610.312658] usbcore: registered new interface driver usbserial
[  610.312676] usbcore: registered new interface driver usbserial_generic
[  610.312691] usbserial: USB Serial support registered for generic
[  610.312711] usbserial_generic 5-1:1.0: The "generic" usb-serial driver is only for testing and one-off prototypes.
[  610.312713] usbserial_generic 5-1:1.0: Tell linux-usb@vger.kernel.org to add your device to a proper driver.
[  610.312716] usbserial_generic 5-1:1.0: generic converter detected
[  610.312933] usb 5-1: generic converter now attached to ttyUSB0
[  610.312950] usbserial_generic 5-1:1.1: The "generic" usb-serial driver is only for testing and one-off prototypes.
[  610.312952] usbserial_generic 5-1:1.1: Tell linux-usb@vger.kernel.org to add your device to a proper driver.
[  610.312955] usbserial_generic 5-1:1.1: generic converter detected
[  610.313012] usb 5-1: generic converter now attached to ttyUSB1
[  610.313022] usbserial_generic 5-1:1.2: The "generic" usb-serial driver is only for testing and one-off prototypes.
[  610.313025] usbserial_generic 5-1:1.2: Tell linux-usb@vger.kernel.org to add your device to a proper driver.
[  610.313027] usbserial_generic 5-1:1.2: generic converter detected
[  610.313081] usb 5-1: generic converter now attached to ttyUSB2

From now on my device works as expected. I then go on to to use NetworkManager to connect to the Internet.

I need to run usb_modeswitch every time the device is plugged in. modprobe is run only once after I boot up my machine. I have enabled logging in /etc/usb_modeswitch.conf but I see no log under /var/log/usb_modeswitch.log

I would like to figure out why my device is not switching automatically. I remember it used to switch previously on a different machine that used to run Ubuntu 12.04, and usb_modeswitch was installed via Ubuntu repos.

P.S.
Contents of /etc/usb_modeswitch.d is blank even after install
Code:
$ ls /etc/usb_modeswitch.d


Contents of 05c6:2001 in the data package usb-modeswitch-data-20140129.tar.bz2 seems to be missing MessageContent
Code:
 
$ cat ./usb-modeswitch-data-20140129/usb_modeswitch.d/05c6:2001
# D-Link DWM-162-U5, Micromax MMX 300c
TargetVendor=  0x1e0e
TargetProductList="ce16,cefe"
StandardEject=1
$


Offline Profile
PostPosted: Fri Feb 21, 2014 6:08 pm Reply with quote
Posts: 1102Location: Koh Samui, THJoined: Wed Jul 11, 2012 3:14 pm
Ubuntu (Debian) does a repack of usb_modeswitch and installs it in a slightly different way
from the recommended, your problems are caused by that.
Did you check if 2.1.0 is available as an upgrade from Canonical? It has recently gone into Debian so may be available now as an Ubuntu package upgrade, if not then it ought to be available within short time.


If the update isn't available yet then I suggest that you for simplicity in the meantime create a script:

usb_modeswitch -v 05c6 - p 2001 -I -W -K
modprobe usb_wwan
modprobe option
echo "1e0e cefe" > /sys/bus/usb-serial/drivers/option1/new_id


Can you please post the output from lsusb -v -d 1e0e:cefe when he dongle has switched mode.


Offline Profile
PostPosted: Fri Feb 21, 2014 6:28 pm Reply with quote
Posts: 2Joined: Fri Feb 21, 2014 3:03 pm
LOM wrote:
usb_modeswitch -v 05c6 - p 2001 -I -W -K
modprobe usb_wwan
modprobe option
echo "1e0e cefe" > /sys/bus/usb-serial/drivers/option1/new_id

Where should i save the above script?

LOM wrote:
Can you please post the output from lsusb -v -d 1e0e:cefe when he dongle has switched mode.

Code:
$ lsusb -v -d 1e0e:cefe

Bus 005 Device 006: ID 1e0e:cefe Qualcomm / Option
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x1e0e Qualcomm / Option
  idProduct          0xcefe
  bcdDevice            0.00
  iManufacturer           1
  iProduct                2
  iSerial                 4
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength          108
    bNumInterfaces          4
    bConfigurationValue     1
    iConfiguration          0
    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              3
      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        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              3
      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        2
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              3
      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        3
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     80 Bulk-Only
      iInterface              4
      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


LOM wrote:
Did you check if 2.1.0 is available as an upgrade from Canonical? It has recently gone into Debian so may be available now as an Ubuntu package upgrade, if not then it ought to be available within short time.

Ubuntu has been bundling very old versions for quite some time. v1.2.4 is being distributed since April 2012, and the Data package hasn't changed since August 2012 Source http://packages.ubuntu.com/search?keywords=usb-modeswitch


Offline Profile

Display posts from previous:  Sort by:

All times are UTC + 1 hour [ DST ]
Page 1 of 1
3 posts
Users browsing this forum: No registered users and 2 guests
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
cron