Automatic Activation, Hotplug and UDEV, Configuration
Post Reply
tutu10
Posts: 1
Joined: 26 Jun 2019, 09:13

Exception for usb-modeswitch

Post by tutu10 » 26 Jun 2019, 10:04

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.

Pelzflorian
Posts: 3
Joined: 26 May 2019, 08:02

Re: Exception for usb-modeswitch

Post by Pelzflorian » 27 Jun 2019, 21:05

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.)

Josh
Site Admin
Posts: 6569
Joined: 03 Nov 2007, 00:30

Re: Exception for usb-modeswitch

Post by Josh » 12 Oct 2019, 12:34

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.

Post Reply