Author Message

<  Setup Discussion  ~  modeswitch not working on bootup for MF691

PostPosted: Wed Oct 22, 2014 3:27 am Reply with quote
Posts: 2Joined: Wed Oct 22, 2014 2:49 am
The modeswitch for MF691 (T-Mobile Rocket 2.0) (v=19d2, p=1201/1203) usually does not work during bootup on a raspberry, but does work on hot-plugin.
Since I am building a standalone system, it needs to work on bootup.

Log output for both a successful and unsuccessful modeswitch during bootup is here:


/* First, a succesful modeswitch during boot (happens rarely) */
/* Note: A hot-plugin always works */

pi@raspberrypi:/var/log$ cat usb_modeswitch_1-1.5

USB_ModeSwitch log from Thu Jan 01 00:00:07 UTC 1970

Use global config file: /etc/usb_modeswitch.conf
Raw args from udev: /1-1.5

Use top device dir /sys/bus/usb/devices/1-1.5
Check class of first interface ...
Interface class is 08.

----------------
USB values from sysfs:
manufacturer T-Mobile
product WebConnect Rocket 2.0
serial 87EEEB78561015379D71144A9049CAD14FC53CA7
----------------
bNumConfigurations is 1 - don't check for active configuration
ConfigList: /usr/share/usb_modeswitch/19d2:1201
SCSI attributes not needed, move on
Check config: /usr/share/usb_modeswitch/19d2:1201
! matched. Read config data
config: TargetVendor set to 19d2
config: TargetProduct set to 1203
Driver module is "option", ID path is /sys/bus/usb-serial/drivers/option1

Command to be run:
usb_modeswitch -W -D -s 20 -u -1 -b 1 -g 5 -v 19d2 -p 1201 -f $configBuffer

Verbose debug output of usb_modeswitch and libusb follows
(Note that some USB errors are to be expected in the process)
--------------------------------

Read long config from command line

* usb_modeswitch: handle USB devices with multiple modes
* Version 2.2.0 (C) Josua Dietze 2014
* Based on libusb1/libusbx

! PLEASE REPORT NEW CONFIGURATIONS !

DefaultVendor= 0x19d2
DefaultProduct= 0x1201
TargetVendor= 0x19d2
TargetProduct= 0x1203

StandardEject=1
NeedResponse=0
Success check enabled, max. wait time 20 seconds
System integration mode enabled

Use given bus/device number: 001/005 ...
Look for default devices ...
bus/device number matched
found USB ID 19d2:1201
vendor ID matched
product ID matched
Found devices in default mode (1)
Use interface number 0
Use endpoints 0x01 (out) and 0x81 (in)

USB description data (for identification)
-------------------------
Manufacturer: T-Mobile
Product: WebConnect Rocket 2.0
Serial No.: 87EEEB78561015379D71144A9049CAD14FC53CA7
-------------------------
Sending standard EJECT sequence
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
Read the response to message 1 (CSW) ...
Response successfully read (13 bytes).
Trying to send message 2 to endpoint 0x01 ...
[ 0.000000] [000001ad] libusbx: error [op_clear_halt] clear_halt failed error -1 errno 71
[ 0.000502] [000001ad] libusbx: error [op_clear_halt] clear_halt failed error -1 errno 71
OK, message successfully sent
Read the response to message 2 (CSW) ...
Response successfully read (13 bytes).
Reset response endpoint 0x81
[timestamp] [threadID] facility level [function call] <message>
--------------------------------------------------------------------------------
Could not reset endpoint (probably harmless): -99
Reset message endpoint 0x01
Could not reset endpoint (probably harmless): -99
Bus/dev search active, refer success check to wrapper. Bye!

ok:busdev
--------------------------------
(end of usb_modeswitch output)

Check success of mode switch for max. 20 seconds ...
Wait for device file system (1 sec.) ...
Wait for device file system (2 sec.) ...
pi@raspberrypi:/var/log$

pi@raspberrypi:/var/log$ lsusb
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 413c:2105 Dell Computer Corp. Model L100 Keyboard
Bus 001 Device 006: ID 19d2:1203 ZTE WCDMA Technologies MSM MF691 [ T-Mobile webConnect Rocket 2.0]
pi@raspberrypi:/var/log$


/*****************************************/
/* A UNSUCCESSFUL MODESWITCH DURING BOOT */
******************************************/

(Note: something went wrong with eth0 too this time: it did not have its static ip address assigned.
Seems to be related to usb_modeswitch; had to do "ifup eth0;ifdown eth0")


pi@raspberrypi:/var/log$ cat usb_modeswitch_1-1.5

USB_ModeSwitch log from Thu Jan 01 00:00:07 UTC 1970

Use global config file: /etc/usb_modeswitch.conf
Raw args from udev: /1-1.5

Use top device dir /sys/bus/usb/devices/1-1.5
Check class of first interface ...
Interface class is 08.

----------------
USB values from sysfs:
manufacturer T-Mobile
product WebConnect Rocket 2.0
serial 87EEEB78561015379D71144A9049CAD14FC53CA7
----------------
bNumConfigurations is 1 - don't check for active configuration
ConfigList: /usr/share/usb_modeswitch/19d2:1201
SCSI attributes not needed, move on
Check config: /usr/share/usb_modeswitch/19d2:1201
! matched. Read config data
config: TargetVendor set to 19d2
config: TargetProduct set to 1203
Driver module is "option", ID path is /sys/bus/usb-serial/drivers/option1

Command to be run:
usb_modeswitch -W -D -s 20 -u -1 -b 1 -g 5 -v 19d2 -p 1201 -f $configBuffer

Verbose debug output of usb_modeswitch and libusb follows
(Note that some USB errors are to be expected in the process)
--------------------------------

Read long config from command line

* usb_modeswitch: handle USB devices with multiple modes
* Version 2.2.0 (C) Josua Dietze 2014
* Based on libusb1/libusbx

! PLEASE REPORT NEW CONFIGURATIONS !

DefaultVendor= 0x19d2
DefaultProduct= 0x1201
TargetVendor= 0x19d2
TargetProduct= 0x1203

StandardEject=1
NeedResponse=0
Success check enabled, max. wait time 20 seconds
System integration mode enabled

Use given bus/device number: 001/005 ...
Look for default devices ...
bus/device number matched
found USB ID 19d2:1201
vendor ID matched
product ID matched
Found devices in default mode (1)
Use interface number 0
Use endpoints 0x01 (out) and 0x81 (in)

USB description data (for identification)
-------------------------
Manufacturer: T-Mobile
Product: WebConnect Rocket 2.0
Serial No.: 87EEEB78561015379D71144A9049CAD14FC53CA7
-------------------------
Sending standard EJECT sequence
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
Read the response to message 1 (CSW) ...
Response reading failed (error -7)
Device is gone, skip any further commands
Bus/dev search active, refer success check to wrapper. Bye!

ok:busdev
--------------------------------
(end of usb_modeswitch output)

Check success of mode switch for max. 20 seconds ...
Read attributes ...
Read attributes ...
Read attributes ...
Read attributes ...
Read attributes ...
Read attributes ...
Read attributes ...
Read attributes ...
Read attributes ...
Read attributes ...
Read attributes ...
Read attributes ...
Read attributes ...
Read attributes ...
Read attributes ...
Read attributes ...
Read attributes ...
Read attributes ...
Read attributes ...
Read attributes ...

Target config not matching - current values are
1-1.5:1.0/bInterfaceClass: 08
bConfigurationValue: 1
bNumConfigurations: 1
busnum: 1
devnum: 5
idProduct: 1201
idVendor: 19d2
manufacturer: T-Mobile
product: WebConnect Rocket 2.0
serial: 87EEEB78561015379D71144A9049CAD14FC53CA7

Mode switching may have failed. Exit

pi@raspberrypi:/var/log$
pi@raspberrypi:/var/log$ lsusb
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 413c:2105 Dell Computer Corp. Model L100 Keyboard
Bus 001 Device 005: ID 19d2:1201 ZTE WCDMA Technologies MSM
pi@raspberrypi:/var/log$


Offline Profile
PostPosted: Sun Oct 26, 2014 1:55 pm Reply with quote
Site AdminPosts: 6170Joined: Sat Nov 03, 2007 12:30 am
Hmm - usb_modeswitch does its job in both cases. The logical conclusion is that there are other factors involved, specifically the state of the system (kernel).

Instead of digging for the exact cause, you can try to tweak some parameters which influence usb_modeswitch's behaviour.
My first recommendation is to play around with the WaitBefore parameter. Copy the file
"/usr/share/usb_modeswitch/19d2:1201" to the folder "/etc/usb_modeswitch.d" and edit it; add the line
"WaitBefore=5" to make usb_modeswitch wait five seconds before even touching the modem.

My guess is that if you adapt that value (probably increasing it), you'll get the desired result.


Offline Profile
PostPosted: Tue Oct 28, 2014 4:33 am Reply with quote
Posts: 2Joined: Wed Oct 22, 2014 2:49 am
Works now, thanks.


Offline Profile

Display posts from previous:  Sort by:

All times are UTC + 1 hour [ DST ]
Page 1 of 1
3 posts
Users browsing this forum: Bing [Bot] and 5 guests
Search for:
Post new topic  Reply to topic
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum