I tried to configure my wireless adapter to auto unmount and switch but not worked.
Before (manual) switch:
Code: Select all
lsusb
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 002: ID 03f0:134a Hewlett-Packard Optical Mouse
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 006: ID 0bda:1a2b Realtek Semiconductor Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 002: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Code: Select all
~$ lsusb
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 002: ID 03f0:134a Hewlett-Packard Optical Mouse
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 009: ID 2001:331d D-Link Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 002: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Code: Select all
https://askubuntu.com/questions/43805/help-with-implementing-usb-modeswitch
The content of the file :
Code: Select all
# D-Link DWA-171
TargetVendor= 0x2001
TargetProduct= 0x331d
After reboot the dongle not mounts (at least) but stay on disk mode. When I run this command :
Code: Select all
$ sudo usb_modeswitch -c /etc/usb_modeswitch.conf
Look for target devices ...
No devices in target mode or class found
Look for default devices ...
Found devices in default mode (1)
Access device 010 on bus 001
Get the current device configuration ...
Current configuration number is 1
Use interface number 0
with class 8
Warning: no switching method given. See documentation
-> Run lsusb to note any changes. Bye!
Code: Select all
$ sudo usb_modeswitch -KW -v 0bda -p 1a2b
Code: Select all
Take all parameters from the command line
* usb_modeswitch: handle USB devices with multiple modes
* Version 2.5.2 (C) Josua Dietze 2017
* Based on libusb1/libusbx
! PLEASE REPORT NEW CONFIGURATIONS !
DefaultVendor= 0x0bda
DefaultProduct= 0x1a2b
StandardEject=1
Look for default devices ...
found USB ID 1d6b:0002
found USB ID 03f0:134a
found USB ID 1d6b:0001
found USB ID 0bda:1a2b
vendor ID matched
product ID matched
found USB ID 1d6b:0002
found USB ID 0a12:0001
found USB ID 1d6b:0001
Found devices in default mode (1)
Access device 010 on bus 001
Get the current device configuration ...
Current configuration number is 1
Use interface number 0
with class 8
Use endpoints 0x0b (out) and 0x8a (in)
USB description data (for identification)
-------------------------
Manufacturer: D-Link Corporation
Product: DISK
Serial No.: not provided
-------------------------
Sending standard EJECT sequence
Looking for active drivers ...
OK, driver detached
Set up interface 0
Use endpoint 0x0b for message sending ...
Trying to send message 1 to endpoint 0x0b ...
OK, message successfully sent
Read the response to message 1 (CSW) ...
Response successfully read (13 bytes), status 1
Trying to send message 2 to endpoint 0x0b ...
OK, message successfully sent
Read the response to message 2 (CSW) ...
Response successfully read (13 bytes), status 0
Trying to send message 3 to endpoint 0x0b ...
Device seems to have vanished right after sending. Good.
Device is gone, skip any further commands
-> Run lsusb to note any changes. Bye!