Automatic Activation, Hotplug and UDEV, Configuration
Post Reply
jfwhitmore
Posts: 3
Joined: 21 May 2015, 15:22

usb_modeswitch doesn't work from first attempt.

Post by jfwhitmore » 21 May 2015, 16:07

I'm trying this out with a Huawei E398 v:12d1 p:1505 on Ubuntu Mate.

I'm not sure what the problem is but trying to auto switch from udev works now and again but generally not. Then after bootup when I run the switch command it seems to be ignored the first time. Well when I say it's being ignored it does output what looks good but there's no change on "lsusb".

When you re-run the same command you get the same output to the terminal and this time it works

Ideally I'd like to get this to work from udev as it's going to be used by end users who aren't going to like issuing "sudo" commands.




pi@boat-rpi:~/Desktop$ lsusb
Bus 001 Device 010: ID 0835:8502 Action Star Enterprise Co., Ltd
Bus 001 Device 009: ID 0835:8500 Action Star Enterprise Co., Ltd
Bus 001 Device 008: ID 12d1:1505 Huawei Technologies Co., Ltd. E398 LTE/UMTS/GSM Modem/Networkcard
Bus 001 Device 007: ID 0d62:0004 Darfon Electronics Corp. Keyboard
Bus 001 Device 006: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 001 Device 005: ID 0835:8501 Action Star Enterprise Co., Ltd
Bus 001 Device 004: ID 0835:8500 Action Star Enterprise Co., Ltd
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
pi@boat-rpi:~/Desktop$ cat /var/log/usb_modeswitch.log
pi@boat-rpi:~/Desktop$ sudo /root/switch.sh
[sudo] password for pi:
Look for default devices ...
product ID matched
Found devices in default mode (1)
Access device 008 on bus 001
Current configuration number is 1
Use interface number 0
Use endpoints 0x01 (out) and 0x81 (in)

USB description data (for identification)
-------------------------
Manufacturer: Huawei Technologies
Product: HUAWEI Mobile
Serial No.: not provided
-------------------------
Using standard Huawei switching message
Looking for active driver ...
OK, driver detached
Set up interface 0
Use endpoint 0x01 for message sending ...
Trying to send message 1 to endpoint 0x01 ...
OK, message successfully sent
Reset response endpoint 0x81
Reset message endpoint 0x01
-> Run lsusb to note any changes. Bye!

pi@boat-rpi:~/Desktop$ lsusb
Bus 001 Device 010: ID 0835:8502 Action Star Enterprise Co., Ltd
Bus 001 Device 009: ID 0835:8500 Action Star Enterprise Co., Ltd
Bus 001 Device 008: ID 12d1:1505 Huawei Technologies Co., Ltd. E398 LTE/UMTS/GSM Modem/Networkcard
Bus 001 Device 007: ID 0d62:0004 Darfon Electronics Corp. Keyboard
Bus 001 Device 006: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 001 Device 005: ID 0835:8501 Action Star Enterprise Co., Ltd
Bus 001 Device 004: ID 0835:8500 Action Star Enterprise Co., Ltd
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

pi@boat-rpi:~/Desktop$ cat /var/log/usb_modeswitch.log







Try a second time:






Bus 001 Device 010: ID 0835:8502 Action Star Enterprise Co., Ltd
Bus 001 Device 009: ID 0835:8500 Action Star Enterprise Co., Ltd
Bus 001 Device 008: ID 12d1:1505 Huawei Technologies Co., Ltd. E398 LTE/UMTS/GSM Modem/Networkcard
Bus 001 Device 007: ID 0d62:0004 Darfon Electronics Corp. Keyboard
Bus 001 Device 006: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 001 Device 005: ID 0835:8501 Action Star Enterprise Co., Ltd
Bus 001 Device 004: ID 0835:8500 Action Star Enterprise Co., Ltd
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

pi@boat-rpi:~/Desktop$ sudo /root/switch.sh
Look for default devices ...
product ID matched
Found devices in default mode (1)
Access device 008 on bus 001
Current configuration number is 1
Use interface number 0
Use endpoints 0x01 (out) and 0x81 (in)

USB description data (for identification)
-------------------------
Manufacturer: Huawei Technologies
Product: HUAWEI Mobile
Serial No.: not provided
-------------------------
Using standard Huawei switching message
Looking for active driver ...
No active driver found. Detached before or never attached
Set up interface 0
Use endpoint 0x01 for message sending ...
Trying to send message 1 to endpoint 0x01 ...
OK, message successfully sent
Reset response endpoint 0x81
Reset message endpoint 0x01
-> Run lsusb to note any changes. Bye!

Bus 001 Device 010: ID 0835:8502 Action Star Enterprise Co., Ltd
Bus 001 Device 009: ID 0835:8500 Action Star Enterprise Co., Ltd
Bus 001 Device 011: ID 12d1:1506 Huawei Technologies Co., Ltd. E398 LTE/UMTS/GSM Modem/Networkcard
Bus 001 Device 007: ID 0d62:0004 Darfon Electronics Corp. Keyboard
Bus 001 Device 006: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 001 Device 005: ID 0835:8501 Action Star Enterprise Co., Ltd
Bus 001 Device 004: ID 0835:8500 Action Star Enterprise Co., Ltd
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

LOM
Posts: 1404
Joined: 11 Jul 2012, 15:14
Location: Koh Samui, TH

Re: usb_modeswitch doesn't work from first attempt.

Post by LOM » 21 May 2015, 17:21

Raspberry pi with its crappy dwc_otg usb root hub driver, tell the maintainers of your distro to use the dwc2 driver.
Nothing we can do here, they are the only ones who can fix the problem.

jfwhitmore
Posts: 3
Joined: 21 May 2015, 15:22

Re: usb_modeswitch doesn't work from first attempt.

Post by jfwhitmore » 22 May 2015, 15:21

Cheers LOM,

thanks a million for that information. I'm running Ubuntu Mate so not sure what to do next. Might be possible to upgrade.

jfwhitmore
Posts: 3
Joined: 21 May 2015, 15:22

Re: usb_modeswitch doesn't work from first attempt.

Post by jfwhitmore » 23 May 2015, 00:14

So dwc2 is part of the kernel, but dwc3 is in there as well. Should I be rolling a kernel with dwc2 or jumping to dwc3?

Post Reply