Author Message

<  Device Information  ~  not able to switch modem

PostPosted: Tue Jan 10, 2012 1:28 pm Reply with quote
Posts: 21 Joined: Wed May 18, 2011 12:03 pm
I got free time after long. sir, here is the message which i get in the log file after enabling logging.
Code:
 

USB_ModeSwitch log from Tue Jan 10 16:49:19 IST 2012

raw args from udev: /1-2:1.0

Using global config file: /etc/usb_modeswitch.conf
Bus ID for device not given by udev.
 Trying to determine it from kernel name (1-2:1.0) ...
USB dir exists: /sys/bus/usb/devices/1-2
----------------
USB values from sysfs:
  manufacturer   USB Modem
  product   USB Modem
  serial   000000000000
----------------
SCSI attributes not needed, moving on
checking config: /usr/share/usb_modeswitch/1c9e:f000
! matched, now switching
 (running command: /usr/sbin/usb_modeswitch -I -W -c /usr/share/usb_modeswitch/1c9e:f000)

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

Reading config file: /usr/share/usb_modeswitch/1c9e:f000

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

 ! PLEASE REPORT NEW CONFIGURATIONS !

DefaultVendor=  0x1c9e
DefaultProduct= 0xf000
TargetVendor=   0x1c9e
TargetProduct=  not set
TargetClass=    not set
TargetProductList="9000,9603,9605"

DetachStorageOnly=0
HuaweiMode=0
SierraMode=0
SonyMode=0
GCTMode=0
KobilMode=0
MessageEndpoint=  not set
MessageContent="55534243123456788000000080000606f50402527000000000000000000000"
NeedResponse=0
ResponseEndpoint= not set
Interface=0x00

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


Looking for target devices ...
  searching devices, found USB ID 1d6b:0002
  searching devices, found USB ID 5986:0241
  searching devices, found USB ID 0bda:0158
  searching devices, found USB ID 1004:61a1
  searching devices, found USB ID 1c9e:f000
   found matching vendor ID
  searching devices, found USB ID 1d6b:0001
  searching devices, found USB ID 1d6b:0001
  searching devices, found USB ID 1d6b:0001
  searching devices, found USB ID 1d6b:0001
 No devices in target mode or class found
Looking for default devices ...
  searching devices, found USB ID 1d6b:0002
  searching devices, found USB ID 5986:0241
  searching devices, found USB ID 0bda:0158
  searching devices, found USB ID 1004:61a1
  searching devices, found USB ID 1c9e:f000
   found matching vendor ID
   found matching product ID
   adding device
  searching devices, found USB ID 1d6b:0001
  searching devices, found USB ID 1d6b:0001
  searching devices, found USB ID 1d6b:0001
  searching devices, found USB ID 1d6b:0001
 Found devices in default mode, class or configuration (1)
Accessing device 027 on bus 001 ...
Getting the current device configuration ...
 OK, got current device configuration (1)
Using endpoints 0x01 (out) and 0x81 (in)
Using endpoints 0x01 (out) and 0x81 (in)

USB description data (for identification)
-------------------------
Manufacturer: USB Modem
     Product: USB Modem
  Serial No.: 000000000000
-------------------------
Looking for active driver ...
 OK, driver found ("dummy")
 OK, driver "dummy" detached
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 ...
 Waiting for original device to vanish ...
 Waiting for original device to vanish ...
 Waiting for original device to vanish ...
 Waiting for original device to vanish ...
 Waiting for original device to vanish ...
 Waiting for original device to vanish ...
 Waiting for original device to vanish ...
 Waiting for original device to vanish ...
 Waiting for original device to vanish ...
 Waiting for original device to vanish ...
 Waiting for original device to vanish ...
 Waiting for original device to vanish ...
 Waiting for original device to vanish ...
 Waiting for original device to vanish ...
 Waiting for original device to vanish ...
 Waiting for original device to vanish ...
 Waiting for original device to vanish ...
 Waiting for original device to vanish ...
 Original device still present after the timeout

Mode switch most likely failed. Bye.

fail:
--------------------------------
(end of usb_modeswitch output)

USB dir exists: /sys/bus/usb/devices/1-2

All done, exiting

at first when i plugged in the device it switched correctly but when i unplugged and then plugged it back then the log message was created which i have posed above..... please help!!!! :cry:


Offline
PostPosted: Tue Jan 10, 2012 1:40 pm Reply with quote
Posts: 21 Joined: Wed May 18, 2011 12:03 pm
Sir, i have also discovered something which might be useful for you. i noticed that a folder "/sys/bus/usb/devices/1-2" is created when i attach my device at first and it switches correctly. but when i remove my device then that folder is not deleted and that causes problem in switching. (i can say this because after removing my device the folder is not removed and after connecting my device again it does not switch. but, when i navigate to that folder after removing my device then the folder gets removed and then when i connect my device, it is able to switch properly.) sir, is there any way to automatically delete that specific folder as soon as i remove my device? :?:


Offline
PostPosted: Tue Jan 10, 2012 4:16 pm Reply with quote
Posts: 21 Joined: Wed May 18, 2011 12:03 pm
this is what happens when i boot my computer with my device plugged in.
Code:
 

USB_ModeSwitch log from Tue Jan 10 19:34:03 IST 2012

raw args from udev: /1-2:1.0

Using global config file: /etc/usb_modeswitch.conf
Bus ID for device not given by udev.
 Trying to determine it from kernel name (1-2:1.0) ...
USB dir exists: /sys/bus/usb/devices/1-2
----------------
USB values from sysfs:
  manufacturer   USB Modem
  product   USB Modem
  serial   000000000000
----------------
SCSI attributes not needed, moving on
checking config: /usr/share/usb_modeswitch/1c9e:f000
! matched, now switching
 (running command: /usr/sbin/usb_modeswitch -I -W -c /usr/share/usb_modeswitch/1c9e:f000)

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

Reading config file: /usr/share/usb_modeswitch/1c9e:f000

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

 ! PLEASE REPORT NEW CONFIGURATIONS !

DefaultVendor=  0x1c9e
DefaultProduct= 0xf000
TargetVendor=   0x1c9e
TargetProduct=  not set
TargetClass=    not set
TargetProductList="9000,9603,9605"

DetachStorageOnly=0
HuaweiMode=0
SierraMode=0
SonyMode=0
GCTMode=0
KobilMode=0
MessageEndpoint=  not set
MessageContent="55534243123456788000000080000606f50402527000000000000000000000"
NeedResponse=0
ResponseEndpoint= not set
Interface=0x00

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


Looking for target devices ...
  searching devices, found USB ID 1d6b:0002
  searching devices, found USB ID 1c9e:f000
   found matching vendor ID
  searching devices, found USB ID 5986:0241
  searching devices, found USB ID 0bda:0158
  searching devices, found USB ID 1d6b:0001
  searching devices, found USB ID 1d6b:0001
  searching devices, found USB ID 1d6b:0001
  searching devices, found USB ID 1d6b:0001
 No devices in target mode or class found
Looking for default devices ...
  searching devices, found USB ID 1d6b:0002
  searching devices, found USB ID 1c9e:f000
   found matching vendor ID
   found matching product ID
   adding device
  searching devices, found USB ID 5986:0241
  searching devices, found USB ID 0bda:0158
  searching devices, found USB ID 1d6b:0001
  searching devices, found USB ID 1d6b:0001
  searching devices, found USB ID 1d6b:0001
  searching devices, found USB ID 1d6b:0001
 Found devices in default mode, class or configuration (1)
Accessing device 002 on bus 001 ...
Getting the current device configuration ...
 OK, got current device configuration (1)
Using endpoints 0x01 (out) and 0x81 (in)
Using endpoints 0x01 (out) and 0x81 (in)

USB description data (for identification)
-------------------------
Manufacturer: USB Modem
     Product: USB Modem
  Serial No.: 000000000000
-------------------------
Looking for active driver ...
 OK, driver found ("dummy")
 OK, driver "dummy" detached
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 ...
  searching devices, found USB ID 1c9e:9605
   found matching vendor ID
   found matching product ID from list
  searching devices, found USB ID 1d6b:0002
  searching devices, found USB ID 5986:0241
  searching devices, found USB ID 0bda:0158
  searching devices, found USB ID 1d6b:0001
  searching devices, found USB ID 1d6b:0001
  searching devices, found USB ID 1d6b:0001
  searching devices, found USB ID 1d6b:0001

Found target device, now opening

Found target device 005 on bus 001

Target device description data
-------------------------
Manufacturer: USB Modem
     Product: Modem Configuration
  Serial No.: 1234567890ABCDEF
-------------------------
 Found correct target device

Mode switch succeeded. Bye.

ok:1c9e:9605
--------------------------------
(end of usb_modeswitch output)

USB dir exists: /sys/bus/usb/devices/1-2
Driver module is "option", ID path is /sys/bus/usb-serial/drivers/option1

Now checking for newly created serial devices ...
 new serial devices found, driver has bound
Checking for AVOID_RESET_QUIRK attribute
 AVOID_RESET_QUIRK activated

All done, exiting

and yes the above mentioned trick does not work now!!!! i don't know why it was working earlier?????????


Offline
PostPosted: Tue Jan 10, 2012 8:09 pm Reply with quote
Site Admin Posts: 6524 Joined: Sat Nov 03, 2007 12:30 am
Can you test with the latest package version? It is available in Debian Sid:
http://packages.debian.org/sid/usb-modeswitch

The trouble with the sys tree points to the kernel or udev.
I assume it does not change if you wait a bit after unplugging?



Offline
PostPosted: Wed Jan 11, 2012 9:46 am Reply with quote
Posts: 21 Joined: Wed May 18, 2011 12:03 pm
sir, i was not able to install that package as ubuntu software centre was telling that it dependency not satisfiable. then i tried to compile from source and got the following error message.
Code:
root@utkarsh-GA-880GM-UD2H:/home/utkarsh/Downloads/usb-modeswitch-1.2.1# make install
gcc -o usb_modeswitch usb_modeswitch.c -Wall -l usb
usb_modeswitch.c:58:17: fatal error: usb.h: No such file or directory
compilation terminated.
make: *** [usb_modeswitch] Error 1

sir, i also have opensuse 12.1 which shows the same error.
Is there any way to correct this problem? :?: :!:


Offline
PostPosted: Wed Jan 11, 2012 10:02 am Reply with quote
Posts: 21 Joined: Wed May 18, 2011 12:03 pm
I managed to install the latest version. I will post the log file in a few hours as now electricity supply is cut off in my locality. :wink:


Offline
PostPosted: Wed Jan 11, 2012 3:26 pm Reply with quote
Posts: 21 Joined: Wed May 18, 2011 12:03 pm
i assume the software for debian did not install correctly on ubuntu. see what i got in the log! it's different from the ones which i posted earlier (using opensuse 12.1)
Code:
*** glibc detected *** /usr/sbin/usb_modeswitch_dispatcher: double free or corruption (!prev): 0x0000000001659c00 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x78a96)[0x7f4a542d5a96]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x6c)[0x7f4a542d9d7c]
/usr/lib/x86_64-linux-gnu/libjim.so.0debian2(+0x2d9b1)[0x7f4a546299b1]
/usr/lib/x86_64-linux-gnu/libjim.so.0debian2(+0x2df06)[0x7f4a54629f06]
/usr/lib/x86_64-linux-gnu/libjim.so.0debian2(+0x1d906)[0x7f4a54619906]
/usr/lib/x86_64-linux-gnu/libjim.so.0debian2(Jim_EvalObj+0x252)[0x7f4a54619d72]
/usr/lib/x86_64-linux-gnu/libjim.so.0debian2(Jim_EvalObj+0x36e)[0x7f4a54619e8e]
/usr/lib/x86_64-linux-gnu/libjim.so.0debian2(+0x1e77f)[0x7f4a5461a77f]
/usr/lib/x86_64-linux-gnu/libjim.so.0debian2(+0x1d906)[0x7f4a54619906]
/usr/lib/x86_64-linux-gnu/libjim.so.0debian2(Jim_EvalObj+0x252)[0x7f4a54619d72]
/usr/lib/x86_64-linux-gnu/libjim.so.0debian2(Jim_EvalObj+0x36e)[0x7f4a54619e8e]
/usr/lib/x86_64-linux-gnu/libjim.so.0debian2(+0x20468)[0x7f4a5461c468]
/usr/lib/x86_64-linux-gnu/libjim.so.0debian2(+0x1d906)[0x7f4a54619906]
/usr/lib/x86_64-linux-gnu/libjim.so.0debian2(Jim_EvalObj+0x252)[0x7f4a54619d72]
/usr/lib/x86_64-linux-gnu/libjim.so.0debian2(+0x1d906)[0x7f4a54619906]
/usr/lib/x86_64-linux-gnu/libjim.so.0debian2(Jim_EvalObj+0x252)[0x7f4a54619d72]
/usr/lib/x86_64-linux-gnu/libjim.so.0debian2(+0x20bec)[0x7f4a5461cbec]
/usr/lib/x86_64-linux-gnu/libjim.so.0debian2(+0x1d951)[0x7f4a54619951]
/usr/lib/x86_64-linux-gnu/libjim.so.0debian2(Jim_EvalObj+0x252)[0x7f4a54619d72]
/usr/lib/x86_64-linux-gnu/libjim.so.0debian2(Jim_EvalObj+0x36e)[0x7f4a54619e8e]
/usr/lib/x86_64-linux-gnu/libjim.so.0debian2(+0x20bec)[0x7f4a5461cbec]
/usr/lib/x86_64-linux-gnu/libjim.so.0debian2(+0x1d951)[0x7f4a54619951]
/usr/lib/x86_64-linux-gnu/libjim.so.0debian2(Jim_EvalObj+0x252)[0x7f4a54619d72]
/usr/sbin/usb_modeswitch_dispatcher[0x4009d5]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed)[0x7f4a5427e30d]
/usr/sbin/usb_modeswitch_dispatcher[0x400a99]
======= Memory map: ========
00400000-00407000 r-xp 00000000 08:02 3411753                            /usr/sbin/usb_modeswitch_dispatcher
00606000-00607000 rw-p 00006000 08:02 3411753                            /usr/sbin/usb_modeswitch_dispatcher
015fb000-01682000 rw-p 00000000 00:00 0                                  [heap]
7f4a4fdea000-7f4a4fdff000 r-xp 00000000 08:02 1314706                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7f4a4fdff000-7f4a4fffe000 ---p 00015000 08:02 1314706                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7f4a4fffe000-7f4a4ffff000 r--p 00014000 08:02 1314706                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7f4a4ffff000-7f4a50000000 rw-p 00015000 08:02 1314706                    /lib/x86_64-linux-gnu/libgcc_s.so.1
7f4a50000000-7f4a50021000 rw-p 00000000 00:00 0
7f4a50021000-7f4a54000000 ---p 00000000 00:00 0
7f4a54059000-7f4a5405b000 r-xp 00000000 08:02 1314715                    /lib/x86_64-linux-gnu/libdl-2.13.so
7f4a5405b000-7f4a5425b000 ---p 00002000 08:02 1314715                    /lib/x86_64-linux-gnu/libdl-2.13.so
7f4a5425b000-7f4a5425c000 r--p 00002000 08:02 1314715                    /lib/x86_64-linux-gnu/libdl-2.13.so
7f4a5425c000-7f4a5425d000 rw-p 00003000 08:02 1314715                    /lib/x86_64-linux-gnu/libdl-2.13.so
7f4a5425d000-7f4a543f2000 r-xp 00000000 08:02 1314714                    /lib/x86_64-linux-gnu/libc-2.13.so
7f4a543f2000-7f4a545f1000 ---p 00195000 08:02 1314714                    /lib/x86_64-linux-gnu/libc-2.13.so
7f4a545f1000-7f4a545f5000 r--p 00194000 08:02 1314714                    /lib/x86_64-linux-gnu/libc-2.13.so
7f4a545f5000-7f4a545f6000 rw-p 00198000 08:02 1314714                    /lib/x86_64-linux-gnu/libc-2.13.so
7f4a545f6000-7f4a545fc000 rw-p 00000000 00:00 0
7f4a545fc000-7f4a54642000 r-xp 00000000 08:02 3408242                    /usr/lib/x86_64-linux-gnu/libjim.so.0debian2.0.73
7f4a54642000-7f4a54842000 ---p 00046000 08:02 3408242                    /usr/lib/x86_64-linux-gnu/libjim.so.0debian2.0.73
7f4a54842000-7f4a54845000 r--p 00046000 08:02 3408242                    /usr/lib/x86_64-linux-gnu/libjim.so.0debian2.0.73
7f4a54845000-7f4a54846000 rw-p 00049000 08:02 3408242                    /usr/lib/x86_64-linux-gnu/libjim.so.0debian2.0.73
7f4a54846000-7f4a54867000 r-xp 00000000 08:02 1314794                    /lib/x86_64-linux-gnu/ld-2.13.so
7f4a54a4f000-7f4a54a52000 rw-p 00000000 00:00 0
7f4a54a62000-7f4a54a66000 rw-p 00000000 00:00 0
7f4a54a66000-7f4a54a67000 r--p 00020000 08:02 1314794                    /lib/x86_64-linux-gnu/ld-2.13.so
7f4a54a67000-7f4a54a69000 rw-p 00021000 08:02 1314794                    /lib/x86_64-linux-gnu/ld-2.13.so
7fff254d3000-7fff254f4000 rw-p 00000000 00:00 0                          [stack]
7fff255ff000-7fff25600000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]


USB_ModeSwitch log from Wed Jan  11 18:51:23 IST 2012

Raw args from udev: /1-6:1.0

Using global config file: /etc/usb_modeswitch.conf
Using top device dir /sys/bus/usb/devices/1-6
----------------
USB values from sysfs:
  manufacturer   USB Modem
  product   USB Modem
  serial   000000000000
----------------
bNumConfigurations is 1 - don't check for active configuration
Found packed config collection /usr/share/usb_modeswitch/configPack.tar.gz

compiling from source is also giving error.


Offline
PostPosted: Wed Jan 11, 2012 3:37 pm Reply with quote
Posts: 21 Joined: Wed May 18, 2011 12:03 pm
sir, whenever i plug in my device into usb hub, it switches automatically. here is the log-->
Code:
USB_ModeSwitch log from Wed Jan  11 19:02:41 IST 2012

Raw args from udev: /1-3.1:1.0

Using global config file: /etc/usb_modeswitch.conf
Using top device dir /sys/bus/usb/devices/1-3.1
----------------
USB values from sysfs:
  manufacturer   USB Modem
  product   USB Modem
  serial   000000000000
----------------
bNumConfigurations is 1 - don't check for active configuration
Found packed config collection /usr/share/usb_modeswitch/configPack.tar.gz
SCSI attributes not needed, moving on
checking config: /etc/usb_modeswitch.d/1c9e:f000
! matched. Reading config data
Using config file from override folder /etc/usb_modeswitch.d
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 1 -g 11 -v 1c9e -p f000 -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.1 (C) Josua Dietze 2011
 * Based on libusb0 (0.1.12 and above)

 ! PLEASE REPORT NEW CONFIGURATIONS !

DefaultVendor=  0x1c9e
DefaultProduct= 0xf000
TargetVendor=   0x1c9e
TargetProduct=  not set
TargetClass=    not set
TargetProductList="9000,9603,9605,9607"

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

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


Use given bus/device number: 001/011 ...
Looking for default devices ...
 bus/device number matched
  searching devices, found USB ID 1c9e:f000
   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 0x01 (out) and 0x81 (in)

USB description data (for identification)
-------------------------
Manufacturer: USB Modem
     Product: USB Modem
  Serial No.: 000000000000
-------------------------
Looking for active driver ...
 OK, driver found ("usb-storage")
 OK, driver "usb-storage" detached
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
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 ...
 Device file system is up, reading attributes ...
 Device file system is up, reading attributes ...
 Device file system is up, reading attributes ...
 Device file system is up, reading attributes ...
 Device file system is up, reading attributes ...
 Device file system is up, reading attributes ...
 Device file system is up, reading attributes ...
 Device file system is up, reading attributes ...
 Device file system is up, reading attributes ...
 Device file system is up, reading attributes ...
 Device file system is up, reading attributes ...
 Device file system is up, reading attributes ...
 Device file system is up, reading attributes ...
 Device file system is up, reading attributes ...
 Device file system is up, reading attributes ...
 Device file system is up, reading attributes ...
 Device file system is up, reading attributes ...
 Device file system is up, reading attributes ...
 Device file system is up, reading attributes ...
 Device file system is up, reading attributes ...
Mode switching may have failed. Exiting

in spite of this happening, my modem switches correctly :!: :!: :!:


Offline
PostPosted: Thu Jan 12, 2012 8:44 pm Reply with quote
Site Admin Posts: 6524 Joined: Sat Nov 03, 2007 12:30 am
Hmm, maybe your product ID is different now?

Please try this slightly changed dispatcher script in the source folder and run "make install" again:
http://www.draisberghof.de/usb_modeswit ... switch.tcl

It will explicitly log the values it has found after the mode switch. Otherwise, there is no difference to the release version.
You might want to set "EnableLogging" to 1 in "usb_modeswitch.conf". If you do it in the source folder, it will always install with that setting so you don't have to re-edit it in "/etc" every time.

If you still get the compile error when "make install", check if you have the libusb-dev package on your system.



Offline
PostPosted: Fri Jan 13, 2012 1:19 pm Reply with quote
Posts: 21 Joined: Wed May 18, 2011 12:03 pm
sir, i managed to install from source by installing 'libusb-devel' and 'libusb-compat-devel' on opensuse 12.1. here is the log that is created if i boot my computer with the device plugged in (it switches correctly):
Code:



USB_ModeSwitch log from Fri Jan 13 16:40:44 IST 2012

Raw args from udev: /1-2:1.0

Using global config file: /etc/usb_modeswitch.conf
Using top device dir /sys/bus/usb/devices/1-2
    idVendor:                  1c9e
    idProduct:                 f000
    bConfigurationValue:       1
    manufacturer:              USB Modem
    product:                   USB Modem
    serial:                    000000000000
    devnum:                    2
    busnum:                    1
    bNumConfigurations:        1
----------------
USB values from sysfs:
  manufacturer   USB Modem
  product   USB Modem
  serial   000000000000
----------------
bNumConfigurations is 1 - don't check for active configuration
SCSI attributes not needed, moving on
checking config: /etc/usb_modeswitch.d/1c9e:f000
! matched. Reading config data
Using config file from override folder /etc/usb_modeswitch.d
config: TargetVendor set to 1c9e
config: TargetProductList set to 9000,9603,9605,9607
config: CheckSuccess set to 20
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 1 -g 2 -v 1c9e -p f000 -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.1 (C) Josua Dietze 2011
 * Based on libusb0 (0.1.12 and above)

 ! PLEASE REPORT NEW CONFIGURATIONS !

DefaultVendor=  0x1c9e
DefaultProduct= 0xf000
TargetVendor=   0x1c9e
TargetProduct=  not set
TargetClass=    not set
TargetProductList="9000,9603,9605,9607"

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

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


Use given bus/device number: 001/002 ...
Looking for default devices ...
 bus/device number matched
  searching devices, found USB ID 1c9e:f000
   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 0x01 (out) and 0x81 (in)

USB description data (for identification)
-------------------------
Manufacturer: USB Modem
     Product: USB Modem
  Serial No.: 000000000000
-------------------------
Looking for active driver ...
 OK, driver found; name unknown, limitation of libusb1
 OK, driver "unkown" detached
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
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 ...
 Device file system is up, reading attributes ...
    idVendor:                  1c9e
    idProduct:                 f000
    bConfigurationValue:       1
    manufacturer:              USB Modem
    product:                   USB Modem
    serial:                    000000000000
    devnum:                    2
    busnum:                    1
    bNumConfigurations:        1
    1-2:1.0/bInterfaceClass:   08
 Device file system is up, reading attributes ...
    idVendor:                  1c9e
    idProduct:                 9605
    bConfigurationValue:       1
    manufacturer:              USB Modem
    product:                   Modem Configuration
    serial:                    1234567890ABCDEF
    devnum:                    5
    busnum:                    1
    bNumConfigurations:        1
    1-2:1.0/bInterfaceClass:   ff
 All attributes matched
Mode switching was successful, found 1c9e:9605 (USB Modem: Modem Configuration)
Now checking for newly created ports ...
 new ports found, device is known to driver
Checking for AVOID_RESET_QUIRK kernel attribute
 AVOID_RESET_QUIRK activated

All done, exiting

but when i unplug it and plug it again then it is not able to switch and here is the log message generated:
Code:



USB_ModeSwitch log from Fri Jan 13 16:37:07 IST 2012

Raw args from udev: /1-2:1.0

Using global config file: /etc/usb_modeswitch.conf
Using top device dir /sys/bus/usb/devices/1-2
    idVendor:                  1c9e
    idProduct:                 f000
    bConfigurationValue:       1
    manufacturer:              USB Modem
    product:                   USB Modem
    serial:                    000000000000
    devnum:                    9
    busnum:                    1
    bNumConfigurations:        1
----------------
USB values from sysfs:
  manufacturer   USB Modem
  product   USB Modem
  serial   000000000000
----------------
bNumConfigurations is 1 - don't check for active configuration
SCSI attributes not needed, moving on
checking config: /etc/usb_modeswitch.d/1c9e:f000
! matched. Reading config data
Using config file from override folder /etc/usb_modeswitch.d
config: TargetVendor set to 1c9e
config: TargetProductList set to 9000,9603,9605,9607
config: CheckSuccess set to 20
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 1 -g 9 -v 1c9e -p f000 -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.1 (C) Josua Dietze 2011
 * Based on libusb0 (0.1.12 and above)

 ! PLEASE REPORT NEW CONFIGURATIONS !

DefaultVendor=  0x1c9e
DefaultProduct= 0xf000
TargetVendor=   0x1c9e
TargetProduct=  not set
TargetClass=    not set
TargetProductList="9000,9603,9605,9607"

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

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


Use given bus/device number: 001/009 ...
Looking for default devices ...
 bus/device number matched
  searching devices, found USB ID 1c9e:f000
   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 0x01 (out) and 0x81 (in)

USB description data (for identification)
-------------------------
Manufacturer: USB Modem
     Product: USB Modem
  Serial No.: 000000000000
-------------------------
Looking for active driver ...
 OK, driver found; name unknown, limitation of libusb1
 OK, driver "unkown" detached
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
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 ...
 Device file system is up, reading attributes ...
    idVendor:                  1c9e
    idProduct:                 f000
    bConfigurationValue:       1
    manufacturer:              USB Modem
    product:                   USB Modem
    serial:                    000000000000
    devnum:                    9
    busnum:                    1
    bNumConfigurations:        1
    1-2:1.0/bInterfaceClass:   08
...
[repeat]
...
 Device file system is up, reading attributes ...
    idVendor:                  1c9e
    idProduct:                 f000
    bConfigurationValue:       1
    manufacturer:              USB Modem
    product:                   USB Modem
    serial:                    000000000000
    devnum:                    9
    busnum:                    1
    bNumConfigurations:        1
    1-2:1.0/bInterfaceClass:   08
Mode switching may have failed. Exiting


Offline
PostPosted: Sat Jan 14, 2012 12:37 am Reply with quote
Site Admin Posts: 6524 Joined: Sat Nov 03, 2007 12:30 am
What happens if you use the hub again?


Offline
PostPosted: Sat Jan 14, 2012 6:44 am Reply with quote
Posts: 21 Joined: Wed May 18, 2011 12:03 pm
this is what happens when i use my usb hub again (it switches correctly):
Code:



USB_ModeSwitch log from Sat Jan 14 10:08:51 IST 2012

Raw args from udev: /1-3.1:1.0

Using global config file: /etc/usb_modeswitch.conf
Using top device dir /sys/bus/usb/devices/1-3.1
----------------
USB values from sysfs:
  manufacturer   USB Modem
  product   USB Modem
  serial   000000000000
----------------
bNumConfigurations is 1 - don't check for active configuration
SCSI attributes not needed, moving on
checking config: /etc/usb_modeswitch.d/1c9e:f000
! matched. Reading config data
Using config file from override folder /etc/usb_modeswitch.d
config: TargetVendor set to 1c9e
config: TargetProductList set to 9000,9603,9605,9607
config: CheckSuccess set to 20
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 1 -g 6 -v 1c9e -p f000 -f $configBuffer

Verbose debug output of usb_modeswitch and libusb follows
(Note that some USB errors are to be expected in the process)
--------------------------------
usb_set_debug: Setting debugging level to 15 (on)
usb_os_find_busses: Found 007
usb_os_find_busses: Found 006
usb_os_find_busses: Found 005
usb_os_find_busses: Found 004
usb_os_find_busses: Found 003
usb_os_find_busses: Found 002
usb_os_find_busses: Found 001
usb_os_find_devices: Found 001 on 007
usb_os_find_devices: Found 001 on 006
usb_os_find_devices: Found 001 on 005
usb_os_find_devices: Found 001 on 004
usb_os_find_devices: Found 001 on 003
usb_os_find_devices: Found 001 on 002
usb_os_find_devices: Found 006 on 001
usb_os_find_devices: Found 003 on 001
skipped 1 class/vendor specific interface descriptors
skipped 1 class/vendor specific interface descriptors
usb_os_find_devices: Found 002 on 001
usb_os_find_devices: Found 001 on 001
error obtaining child information: Inappropriate ioctl for device
error obtaining child information: Inappropriate ioctl for device

Reading long config from command line

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

 ! PLEASE REPORT NEW CONFIGURATIONS !

DefaultVendor=  0x1c9e
DefaultProduct= 0xf000
TargetVendor=   0x1c9e
TargetProduct=  not set
TargetClass=    not set
TargetProductList="9000,9603,9605,9607"

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

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


Use given bus/device number: 001/006 ...
Looking for default devices ...
 bus/device number matched
  searching devices, found USB ID 1c9e:f000
   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 0x01 (out) and 0x81 (in)

USB description data (for identification)
-------------------------
Manufacturer: USB Modem
     Product: USB Modem
  Serial No.: 000000000000
-------------------------
Looking for active driver ...
 OK, driver found ("usb-storage")
 OK, driver "usb-storage" detached
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
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 ...
 Device file system is up, reading attributes ...
 Device file system is up, reading attributes ...
 All attributes matched
Mode switching was successful, found 1c9e:9605 (USB Modem: Modem Configuration)
Now checking for newly created ports ...
 new ports found, device is known to driver
Checking for AVOID_RESET_QUIRK kernel attribute
 AVOID_RESET_QUIRK activated

All done, exiting

(this is the result in ubuntu 11.10) (the usb hub is integrated in my monitor)


Offline
PostPosted: Sat Jan 14, 2012 3:41 pm Reply with quote
Site Admin Posts: 6524 Joined: Sat Nov 03, 2007 12:30 am
Honestly, I can't say that I have an idea why the switching after a "hot plug" fails.

There are some values that you can tweak though if we assume that the strange behaviour is somehow timing related (it often is in the mode switching "business").

Edit your config file and add the parameters "WaitBefore=<n>" and "ReleaseDelay=<n>".
The former will wait for a number of seconds before the switching command is actually transmitted, giving the device a break after plugging.
The latter will keep the device "grabbed" for a number of seconds after the switching command was sent.

Both parameters are known to have helped with at least one modem model. You can try any combination.



Offline
PostPosted: Sun Jan 15, 2012 3:36 am Reply with quote
Posts: 21 Joined: Wed May 18, 2011 12:03 pm
sir,
i am going to another town for a few days today. so, i won't be able to reply for about a week or 5-6 days. so, before i leave i want to give you a useful information. my usb modem also supports micro sd card upto 8GB. so i plugged it in with 1GB sd card inserted in it. In ubuntu, as soon as the sd-card was mounted the modem switched correctly (even without usb-hub). but in opensuse 12.1 the sd-card did not mount and so the modem was not switched. do you know what's happening?


Offline

Display posts from previous:  Sort by:

All times are UTC+02:00
Page 2 of 2
29 posts
Go to page   Previous 1 2
Users browsing this forum: No registered users and 5 guests
Search for:
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