Page 1 of 1

Exception for usb-modeswitch

Posted: 26 Jun 2019, 10:04
by tutu10
Usb-modeswitch makes easier to use USB modem. But looks like it works for any USB device, including my mobile so that I can't access the memory card because it's changed to serial device by usb-modeswitch.
When using Debian without usb-modeswitch package installed, the memory card can be accessed as storage.
So, I wonder if there's any kind of "exception" for usb-modeswitch so it doesn't turn my mobile to serial device.
Thanks for help.

Re: Exception for usb-modeswitch

Posted: 27 Jun 2019, 21:05
by Pelzflorian
If you can find out with lsusb which device it is, maybe it should be removed from

Code: Select all

/usr/lib/udev/rules.d/40-usb_modeswitch.rules
so to modeswitch it, USB_ModeSwitch would have to be invoked manually and it does not get modeswitched automatically. (The clean way would be to edit the package manager package to change this file, otherwise changes will be overwritten when updating.) Maybe it should then be removed upstream’s udev file as well (then the package would not need changing).

(I am no USB_ModeSwitch developer.)

Re: Exception for usb-modeswitch

Posted: 12 Oct 2019, 12:34
by Josh
tutu10 wrote:I wonder if there's any kind of "exception" for usb-modeswitch so it doesn't turn my mobile to serial device.
Thanks for help.
There are several ways to do that.


1. The global approach - affects all USB modems etc.:

Edit "/etc/usb_modeswitch.conf" and change

Code: Select all

DisableSwitching=0
to

Code: Select all

DisableSwitching=1
That should be OK as long as you don't use USB modems or other USB devices that have their Windows drivers on-board.


2. The 'smart' approach - affects only your phone:

Create a file in "/etc/usb_modeswitch.d" named after the USB ID of your phone (before the mode switch), for instance "12d1:3c4d". Edit the file and put in this:

Code: Select all

# Hands off my phone! Do nothing for ID 12d1:3c4d
Configuration=0
The comment line on top is optional, of course.

To determine the USB ID of the phone in un-switched mode, disable mode-switching globally (termporarily) as described in 1., then plug in your phone, then run the command "lsusb" in a terminal window. It's likely that you will discover your phone in the result list, along with its ID.
If you have trouble with that, post the result list here.