If you're next to certain that you have the right values for your device, followed all the hints (see Known working hardware), and USB_ModeSwitch seems to do something run after run but to no effect, there are most likely system issues involved. Almost all distributions today are using "udev" as a device and hotplug manager, and in some cases this daemon is not able to "release" the established connection of a switched device and to see it as a freshly plugged one (after all, this is something outside the USB specs).
There are several ways to analyze and tackle these problems:
Kernel related issues
In newer kernels, some device families (Huawei, ZTE since 2.6.26) get a special treatment in the usb-storage code to enable switching right away. You don't even need USB_ModeSwitch anymore; on the other hand you have no choice of accessing the "CD-ROM" part of your device. Plus, there were cases when the special treatment obviously brought no results and even prevented USB_ModeSwitch to work properly afterwards (happened with ZTE devices, error "-2").
In case of trouble, look into "unusual_devs.h" in the "drivers/usb/storage" folder of your kernel source. If your default ID (vendor and product ID of the storage part) can be found there and you get errors when running USB_ModeSwitch, try first to blacklist "usb-storage". If that helps, you should consider rebuilding your kernel with the entry in "unusual_devs.h" deactivated. The only thing that will happen is that usb-storage works in the default way afterwards.
I found a tip in the Russian Gentoo wiki to do exactly what I just suggested for the
ZTE MF626.
Annother way of influencing the kernel behaviour is the parameter "delay_use" of "usb-storage" which sets the time in seconds after plugging when the storage device will actually be used (and mounted). The default value is 5; this might affect the switching result in some way, especially when using an udev rule. I'd be interested to learn about good or bad results of playing around with it.
Add in /etc/modprobe.conf:
options usb-storage delay_use=1 (or 10, or other)
Kernel Support
Standby for more content ...
Contribute
USB_ModeSwitch comes quite handy for experimenting with your own hardware if not supported yet. You could try this approach:
Note the device's Vendor and Product ID from /proc/bus/usb/devices (or from the output of "lsusb"); the assigned driver is usually "usb-storage". Then try spying out the USB communication to the device with the same ID inside M$ Windoze.
I recommend this tool: "SniffUSB" ( http://www.pcausa.com/Utilities/UsbSnoop/default.htm).
This is the extremely short version. There is a very good case example from Mark A. Ziesemer here:
Alltel UM175AL USB EVDO under Ubuntu Hardy Heron
Please post any improvements, new device information and/or bug reports to the ModeSwitchForum !
If you know about a new device configuration you can send me an old-fashioned - and at your demand confidential - e-mail (see below).
Whodunit
Copyright (C) 2007, 2008, 2009 Josua Dietze (usb_admin at this domain)
Command line parsing, decent usage/config output and handling, bugfixes added by:
- Joakim Wennergren (jokedst) (gmail.com)
TargetClass parameter implementation to support new Option devices/firmware:
- Paul Hardwick (http://www.pharscape.org)
Created with initial help from:
- "usbsnoop2libusb.pl" by Timo Lindfors (http://iki.fi/lindi/usb/usbsnoop2libusb.pl)
Config file parsing stuff borrowed from:
- Guillaume Dargaud (http://www.gdargaud.net/Hack/SourceCode.html)
Hexstr2bin function borrowed from:
- Jouni Malinen (http://hostap.epitest.fi/wpa_supplicant, from "common.c")
Code, ideas and other input from:
- Aki Makkonen
- Denis Sutter
- Lucas Benedičič
- Roman Laube
- Luigi Iotti
- Vincent Teoh
- Tommy Cheng
- Daniel Cooper
- Andrew Bird
More contributors (device specific) are listed in the config file. Thanks to everyone at the forum too!
History
Version 1.0.2, 2009/06/08
Some output bugs fixed
Version 1.0.1, 2009/06/08
Added output of descriptor strings for further identification
Version 1.0.0, 2009/06/03
Attention: possible incompatibilities for command line control! On/off flags don't require arguments anymore (-H, -S, -O, -d, -R, -n, new: -I), meaning "-R 0" does a reset like "-R 1" or "-R"; long option names changed to standard format (e.g. --HuaweiMode to --huawei-mode); added device inquiry, for future help with device identification; catch error -19 as possible success; send and response endpoints now autoselected (consequently NeedResponse is back); code cleanup; new devices
Version 0.9.7, 2009/04/15
Updated SonyMode, MD 400 now stable; automatic default endpoint detection from Andrew Bird
Version 0.9.7beta, 2009/03/15
Major code clean up, optional success control (both suggested by Daniel Cooper), new devices
Version 0.9.6, 2009/01/08
Special modes added for Sierra and Sony Ericsson, new devices
Version 0.9.5, 2008/10/27
New options for USB tuning added (jokedst), lots of new devices, clean up
Version 0.9.4, 2008/06/09
Compat fix for libusb on FreeBSD quirks, more devices
Version 0.9.4beta2, 2008/03/19
Udev 'release' fix
Version 0.9.4beta, 2008/03/16
Multiple device support
Version 0.9.3, 2008/03/09
More devices, no other changes from 0.9.3beta
Version 0.9.3beta, 2007/12/30
New TargetClass parameter for recent Option firmware (Paul Hardwick), more devices
Version 0.9.2, 2007/11/02
New Huawei mode (code from Miroslav Bobovsky, added by Denis Sutter), more devices
Version 0.9.1beta, 2007/09/11
Added command line parsing (jokedst), cleaned up config stuff (jokedst), bug fixes, doc updates
Version 0.9beta, 2007/08/12
Name change from "icon_switch", parameter file and generalizing
Version 0.2, 2006/09/25
Code cleaning, more messages
Version 0.1, 2006/09/24
Just very basic functionality ...
Legal
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details:
http://www.gnu.org/licenses/gpl.txt