as the topic states I've the strange problem that usb_modeswitch behaves unpredictable.
I've an Alcatel X602D usb modem (Vendor=1bbb ProdID=022c) and an raspberry pi (with the latest Raspbian Jessie updates and Linux 4.9.35-v7+). According to Debian's usb-modeswitch-data changelog the modem is supported since version 20150115-1 (which I have installed).
Installed packages:
Code: Select all
$ dpkg -l | grep usb-modeswitch
ii usb-modeswitch 2.2.0+repack0-2 armhf mode switching tool for controlling "flip flop" USB devices
ii usb-modeswitch-data 20150115-1 all mode switching data for usb-modeswitch
As a secondary problem no log files are created, although I set it in the config file /etc/usb_modeswitch.conf. It's only content is
Most of the time I get the following output for "dmesg -T":DisableSwitching=0
EnableLogging=1
"usb-devices" then says as expected:[Fr Jul 28 06:04:51 2017] usb 1-1.2: new high-speed USB device number 4 using dwc_otg
[Fr Jul 28 06:04:51 2017] usb 1-1.2: New USB device found, idVendor=1bbb, idProduct=022c
[Fr Jul 28 06:04:51 2017] usb 1-1.2: New USB device strings: Mfr=2, Product=1, SerialNumber=0
[Fr Jul 28 06:04:51 2017] usb 1-1.2: Product: HSPA+ USB Modem
[Fr Jul 28 06:04:51 2017] usb 1-1.2: Manufacturer: Spreadtrum
[Fr Jul 28 06:04:51 2017] usb-storage 1-1.2:1.0: USB Mass Storage device detected
[Fr Jul 28 06:04:51 2017] scsi host0: usb-storage 1-1.2:1.0
Only sometimes the following happens:T: Bus=01 Lev=02 Prnt=02 Port=01 Cnt=02 Dev#= 4 Spd=480 MxCh= 0
D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 2
P: Vendor=1bbb ProdID=022c Rev=00.00
S: Manufacturer=Spreadtrum
S: Product=HSPA+ USB Modem
C: #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=250mA
I: If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
dmesg:
usb-devices:[Fr Jul 28 04:38:24 2017] usb 1-1.2: new high-speed USB device number 4 using dwc_otg
[Fr Jul 28 04:38:24 2017] usb 1-1.2: New USB device found, idVendor=1bbb, idProduct=022c
[Fr Jul 28 04:38:24 2017] usb 1-1.2: New USB device strings: Mfr=2, Product=1, SerialNumber=0
[Fr Jul 28 04:38:24 2017] usb 1-1.2: Product: HSPA+ USB Modem
[Fr Jul 28 04:38:24 2017] usb 1-1.2: Manufacturer: Spreadtrum
[Fr Jul 28 04:38:24 2017] usb-storage 1-1.2:1.0: USB Mass Storage device detected
[Fr Jul 28 04:38:24 2017] scsi host0: usb-storage 1-1.2:1.0
[Fr Jul 28 04:38:24 2017] usb 1-1.2: usbfs: interface 0 claimed by usb-storage while 'usb_modeswitch' sets config #2
Should look that way all the time. As the dmesg-output shows the hardware is always recognized with the correct vendor and product IDs. So it doesn't make sense that sometimes usb_modeswitch get triggered and sometimes doesn't. And even if my modeswitch-data package was too old it still should work with the configs I made.T: Bus=01 Lev=02 Prnt=02 Port=01 Cnt=02 Dev#= 4 Spd=480 MxCh= 0
D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 2
P: Vendor=1bbb ProdID=022c Rev=00.00
S: Manufacturer=Spreadtrum
S: Product=HSPA+ USB Modem
C: #Ifs= 4 Cfg#= 2 Atr=80 MxPwr=200mA
I: If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)
I: If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)
I: If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)
I: If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)
To make sure I already tried writing my own rules in in /lib/udev/rules.d/40-usb_modeswitch.rules like
ATTRS{idVendor}=="1bbb", ATTRS{idProduct}=="022c", RUN+="usb_modeswitch '%b/%k'"
and other variations with no effect.
I also created /etc/usb_modeswitch.d/1bbb:022c with
But it still doesn't work every time.#Alcatel X602D
Configuration=2
Then I tried to make init-scripts to execute usb_modeswitch this way, but I might have been to stupid for that.
I'm aware that even if usb_modeswitch works I still have to load the correct drivers via modprobe. But I'm mostly not even getting this far (also I'd like to make this an automatic task - maybe via 40-usb_modeswitch.rules? But one step at a time).
Manually executing usb_modeswitch seems to work btw. But still no logfiles and I don't know why.
Might this be a bug in this version? Seems to be a bit old. I could try later versions but the jessie repository only has this one.