Here is some info **before** the device is switched:
# udevadm info --attribute-walk --name /dev/bus/usb/001/009
custom logging function 0x28c4008 registered
selinux=0
calling: info
device 0x28c41f0 has devpath '/devices/pci0000:00/0000:00:1e.0/0000:01:0e.2/usb1/1-2'
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/pci0000:00/0000:00:1e.0/0000:01:0e.2/usb1/1-2':
KERNEL=="1-2"
SUBSYSTEM=="usb"
DRIVER=="usb"
ATTR{configuration}=="Huawei Configuration"
ATTR{bNumInterfaces}==" 2"
ATTR{bConfigurationValue}=="1"
ATTR{bmAttributes}=="e0"
ATTR{bMaxPower}=="500mA"
ATTR{urbnum}=="5742"
ATTR{idVendor}=="12d1"
ATTR{idProduct}=="1446"
ATTR{bcdDevice}=="0000"
ATTR{bDeviceClass}=="00"
ATTR{bDeviceSubClass}=="00"
ATTR{bDeviceProtocol}=="00"
ATTR{bNumConfigurations}=="1"
ATTR{bMaxPacketSize0}=="64"
ATTR{speed}=="480"
ATTR{busnum}=="1"
ATTR{devnum}=="9"
ATTR{version}==" 2.00"
ATTR{maxchild}=="0"
ATTR{quirks}=="0x0"
ATTR{authorized}=="1"
ATTR{manufacturer}=="HUAWEI Technology"
ATTR{product}=="HUAWEI Mobile"
device 0x28c49f0 has devpath '/devices/pci0000:00/0000:00:1e.0/0000:01:0e.2/usb1'
looking at parent device '/devices/pci0000:00/0000:00:1e.0/0000:01:0e.2/usb1':
KERNELS=="usb1"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{configuration}==""
ATTRS{bNumInterfaces}==" 1"
ATTRS{bConfigurationValue}=="1"
ATTRS{bmAttributes}=="e0"
ATTRS{bMaxPower}==" 0mA"
ATTRS{urbnum}=="197"
ATTRS{idVendor}=="1d6b"
ATTRS{idProduct}=="0002"
ATTRS{bcdDevice}=="0206"
ATTRS{bDeviceClass}=="09"
ATTRS{bDeviceSubClass}=="00"
ATTRS{bDeviceProtocol}=="00"
ATTRS{bNumConfigurations}=="1"
ATTRS{bMaxPacketSize0}=="64"
ATTRS{speed}=="480"
ATTRS{busnum}=="1"
ATTRS{devnum}=="1"
ATTRS{version}==" 2.00"
ATTRS{maxchild}=="5"
ATTRS{quirks}=="0x0"
ATTRS{authorized}=="1"
ATTRS{manufacturer}=="Linux 2.6.31-19-generic ehci_hcd"
ATTRS{product}=="EHCI Host Controller"
ATTRS{serial}=="0000:01:0e.2"
ATTRS{authorized_default}=="1"
device 0x28c52e0 has devpath '/devices/pci0000:00/0000:00:1e.0/0000:01:0e.2'
looking at parent device '/devices/pci0000:00/0000:00:1e.0/0000:01:0e.2':
KERNELS=="0000:01:0e.2"
SUBSYSTEMS=="pci"
DRIVERS=="ehci_hcd"
ATTRS{vendor}=="0x1033"
ATTRS{device}=="0x00e0"
ATTRS{subsystem_vendor}=="0x1758"
ATTRS{subsystem_device}=="0x2001"
ATTRS{class}=="0x0c0320"
ATTRS{irq}=="11"
ATTRS{local_cpus}=="ff"
ATTRS{local_cpulist}=="0-7"
ATTRS{modalias}=="pci:v00001033d000000E0sv00001758sd00002001bc0Csc03i20"
ATTRS{enable}=="1"
ATTRS{broken_parity_status}=="0"
ATTRS{msi_bus}==""
ATTRS{companion}==""
device 0x28c5d20 has devpath '/devices/pci0000:00/0000:00:1e.0'
looking at parent device '/devices/pci0000:00/0000:00:1e.0':
KERNELS=="0000:00:1e.0"
SUBSYSTEMS=="pci"
DRIVERS==""
ATTRS{vendor}=="0x8086"
ATTRS{device}=="0x2418"
ATTRS{subsystem_vendor}=="0x0000"
ATTRS{subsystem_device}=="0x0000"
ATTRS{class}=="0x060400"
ATTRS{irq}=="0"
ATTRS{local_cpus}=="ff"
ATTRS{local_cpulist}=="0-7"
ATTRS{modalias}=="pci:v00008086d00002418sv00000000sd00000000bc06sc04i00"
ATTRS{enable}=="1"
ATTRS{broken_parity_status}=="0"
ATTRS{msi_bus}=="1"
device 0x28c69e0 has devpath '/devices/pci0000:00'
looking at parent device '/devices/pci0000:00':
KERNELS=="pci0000:00"
SUBSYSTEMS==""
DRIVERS==""
root@BristolAeroClub:/dev/bus/usb/001# cd /etc/usb_modeswitch.d
root@BristolAeroClub:/etc/usb_modeswitch.d# usb_modeswitch -c 12d1\:1446
Looking for target devices ...
No devices in target mode or class found
Looking for default devices ...
Found devices in default mode, class or configuration (1)
Accessing device 009 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)
Inquiring device details; driver will be detached ...
Looking for active driver ...
OK, driver found ("usb-storage")
OK, driver "usb-storage" detached
SCSI inquiry data (for identification)
-------------------------
Vendor String: HUAWEI
Model String: Mass Storage
Revision String: 2.31
-------------------------
USB description data (for identification)
-------------------------
Manufacturer: HUAWEI Technology
Product: HUAWEI Mobile
Serial No.: not provided
-------------------------
Setting up communication with interface 0 ...
Using endpoint 0x01 for message sending ...
Trying to send message 1 to endpoint 0x01 ...
Device seems to have vanished right after sending. Good.
Device is gone, skipping any further commands
Checking for mode switch (max. 20 times, once per second) ...
Searching for target devices ...
Searching for target devices ...
Searching for target devices ...
Searching for target devices ...
Searching for target devices ...
Searching for target devices ...
Found target device, now opening
Found correct target device
Mode switch succeeded. Bye.
root@BristolAeroClub:/etc/usb_modeswitch.d# lsusb
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 010: ID 12d1:140c Huawei Technologies Co., Ltd.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
root@BristolAeroClub:/etc/usb_modeswitch.d#
hoppy wrote:Yes, it is installed.
I'm fairly convinced this is down to udev not triggering the usb_modeswitch rule(s) for whatever reason but I can't work out why. As soon as I issue the usb_modeswitch -c command by hand it always seems to work.
So for me, we need to confirm if udev is matching the rule for 02d1:1446 and if not then why not?
Can we put some sort of debug/trace information in the usb_modeswitch.rules file to see what is happening?
How can we confirm that udev is reading and parsing the usb_modeswitch.rules file?
HoPpY
Josh wrote:Just to be on the safe side - did you install the "tcl" package?