Hi LOM ,
Thanks a lot for your reply. It's amazing we are in the same timezone.
Rasperberry pi can exec eject command to switch the usb dongle.
The eject command is from "sudo apt-get install eject".
What's the different between the Linux-eject & usb-modeswitch -K ?
Here is the Linux-Eject result.
#####First , I plugin'd the doungle , dmesg :
pi@raspberrypi ~ $ sudo dmesg -c
[ 9429.248334] usb 1-1.3.2: new high-speed USB device number 24 using dwc_otg
[ 9429.349712] usb 1-1.3.2: New USB device found, idVendor=2001, idProduct=a401
[ 9429.349746] usb 1-1.3.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 9429.349764] usb 1-1.3.2: Product: Mobile Connect
[ 9429.349781] usb 1-1.3.2: Manufacturer: Mobile Connect
[ 9429.349798] usb 1-1.3.2: SerialNumber: 0123456789ABCDEF
[ 9429.352261] usb-storage 1-1.3.2:1.0: USB Mass Storage device detected
[ 9429.352832] scsi host16: usb-storage 1-1.3.2:1.0
[ 9430.349078] scsi 16:0:0:0: Direct-Access SD Storage 0000 PQ: 0 ANSI: 2
[ 9430.350567] sd 16:0:0:0: Attached scsi generic sg0 type 0
[ 9430.352301] scsi 16:0:0:1: CD-ROM Mass Storage 0000 PQ: 0 ANSI: 2
[ 9430.352792] sd 16:0:0:0: [sda] Unit Not Ready
[ 9430.352817] sd 16:0:0:0: [sda]
[ 9430.352831] Sense Key : 0x5 [current]
[ 9430.352858] sd 16:0:0:0: [sda]
[ 9430.352869] ASC=0x20 ASCQ=0x0
[ 9430.357048] sd 16:0:0:0: [sda] READ CAPACITY failed
[ 9430.357086] sd 16:0:0:0: [sda]
[ 9430.357101] Result: hostbyte=0x00 driverbyte=0x08
[ 9430.357117] sd 16:0:0:0: [sda]
[ 9430.357129] Sense Key : 0x5 [current]
[ 9430.357158] sd 16:0:0:0: [sda]
[ 9430.357169] ASC=0x20 ASCQ=0x0
[ 9430.358640] sd 16:0:0:0: [sda] Write Protect is off
[ 9430.358706] sd 16:0:0:0: [sda] Mode Sense: 0f 00 00 00
[ 9430.359526] sd 16:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 9430.365002] sr 16:0:0:1: [sr0] scsi-1 drive
[ 9430.366633] sr 16:0:0:1: Attached scsi CD-ROM sr0
[ 9430.367402] sd 16:0:0:0: [sda] Unit Not Ready
[ 9430.367413] sd 16:0:0:0: [sda]
[ 9430.367428] Sense Key : 0x5 [current]
[ 9430.367436] sd 16:0:0:0: [sda]
[ 9430.367444] ASC=0x20 ASCQ=0x0
[ 9430.367490] sr 16:0:0:1: Attached scsi generic sg1 type 5
[ 9430.375969] sd 16:0:0:0: [sda] READ CAPACITY failed
[ 9430.375982] sd 16:0:0:0: [sda]
[ 9430.375993] Result: hostbyte=0x00 driverbyte=0x08
[ 9430.376004] sd 16:0:0:0: [sda]
[ 9430.376016] Sense Key : 0x5 [current]
[ 9430.376024] sd 16:0:0:0: [sda]
[ 9430.376031] ASC=0x20 ASCQ=0x0
[ 9430.377214] sd 16:0:0:0: [sda] Attached SCSI removable disk
pi@raspberrypi ~ $
pi@raspberrypi ~ $
pi@raspberrypi ~ $
pi@raspberrypi ~ $
pi@raspberrypi ~ $
pi@raspberrypi ~ $
pi@raspberrypi ~ $
pi@raspberrypi ~ $
pi@raspberrypi ~ $
pi@raspberrypi ~ $
#####Second, I exec eject /dev/sr0 , dmesg :
pi@raspberrypi ~ $ eject /dev/sr0
pi@raspberrypi ~ $ sudo dmesg
[ 9488.925158] usb 1-1.3.2: USB disconnect, device number 24
[ 9488.927593] sd 16:0:0:0: [sda] Synchronizing SCSI cache
[ 9488.927917] sd 16:0:0:0: [sda]
[ 9488.927938] Result: hostbyte=0x01 driverbyte=0x00
[ 9489.258476] usb 1-1.3.2: new high-speed USB device number 25 using dwc_otg
[ 9489.362271] usb 1-1.3.2: New USB device found, idVendor=2001, idProduct=7e19
[ 9489.362296] usb 1-1.3.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 9489.362313] usb 1-1.3.2: Product: Mobile Connect
[ 9489.362330] usb 1-1.3.2: Manufacturer: Mobile Connect
[ 9489.362347] usb 1-1.3.2: SerialNumber: 0123456789ABCDEF
[ 9489.369692] usb-storage 1-1.3.2:1.5: USB Mass Storage device detected
[ 9489.370338] scsi host17: usb-storage 1-1.3.2:1.5
[ 9490.369546] scsi 17:0:0:0: Direct-Access SD Storage 0000 PQ: 0 ANSI: 2
[ 9490.371244] sd 17:0:0:0: Attached scsi generic sg0 type 0
[ 9490.373994] sd 17:0:0:0: [sda] Unit Not Ready
[ 9490.374039] sd 17:0:0:0: [sda]
[ 9490.374062] Sense Key : 0x5 [current]
[ 9490.374094] sd 17:0:0:0: [sda]
[ 9490.374122] ASC=0x20 ASCQ=0x0
[ 9490.377046] sd 17:0:0:0: [sda] READ CAPACITY failed
[ 9490.377073] sd 17:0:0:0: [sda]
[ 9490.377087] Result: hostbyte=0x00 driverbyte=0x08
[ 9490.377102] sd 17:0:0:0: [sda]
[ 9490.377112] Sense Key : 0x5 [current]
[ 9490.377135] sd 17:0:0:0: [sda]
[ 9490.377146] ASC=0x20 ASCQ=0x0
[ 9490.377672] sd 17:0:0:0: [sda] Write Protect is off
[ 9490.377697] sd 17:0:0:0: [sda] Mode Sense: 0f 00 00 00
[ 9490.378369] sd 17:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 9490.382858] sd 17:0:0:0: [sda] Unit Not Ready
[ 9490.382869] sd 17:0:0:0: [sda]
[ 9490.382896] Sense Key : 0x5 [current]
[ 9490.382918] sd 17:0:0:0: [sda]
[ 9490.382935] ASC=0x20 ASCQ=0x0
[ 9490.385977] sd 17:0:0:0: [sda] READ CAPACITY failed
[ 9490.385987] sd 17:0:0:0: [sda]
[ 9490.385997] Result: hostbyte=0x00 driverbyte=0x08
[ 9490.386007] sd 17:0:0:0: [sda]
[ 9490.386075] Sense Key : 0x5 [current]
[ 9490.386083] sd 17:0:0:0: [sda]
[ 9490.386091] ASC=0x20 ASCQ=0x0
[ 9490.387182] sd 17:0:0:0: [sda] Attached SCSI removable disk
### BTW , here is the usb-modeswitch -K result , it does not work.
[ 9705.624994] sd 18:0:0:0: [sda] Attached SCSI removable disk
[ 9714.211395] sd 18:0:0:0: [sda] Synchronizing SCSI cache
[ 9714.214771] sd 18:0:0:0: [sda]
[ 9714.214803] Result: hostbyte=0x00 driverbyte=0x08
[ 9714.214821] sd 18:0:0:0: [sda]
[ 9714.214832] Sense Key : 0x5 [current]
[ 9714.214857] sd 18:0:0:0: [sda]
[ 9714.214869] ASC=0x20 ASCQ=0x0
### I think it is the sames as usb_modeswitch -M 5553424368e6c6811200000080010c03000000120000000000000000000000
Thanks a lot for your great help !!!