Automatic Activation, Hotplug and UDEV, Configuration
Post Reply
unetin
Posts: 2
Joined: 22 Dec 2014, 13:12

Huawei E5832 can not switch mode

Post by unetin » 22 Dec 2014, 13:37

Hi All
I plugin Huawei E5832 dongle and then type the following commands,but all can not switch mode...
Any suggestions will be appreciated!

[root@192 usb_modeswitch.d]# /usr/sbin/usb_modeswitch --version

* usb_modeswitch: handle USB devices with multiple modes
* Version 1.2.4 (C) Josua Dietze 2012
* Based on libusb0 (0.1.12 and above)

lsusb:

Bus 003 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 010: ID 12d1:1446 Huawei Technologies Co., Ltd.
Bus 001 Device 001: ID 0000:0000
Bus 004 Device 001: ID 0000:0000

[root@192 usb_modeswitch.d]# cat 12d1\:1446
########################################################
# Huawei E270+ (HSPA+ modem)

DefaultVendor= 0x12d1
DefaultProduct=0x1446

TargetVendor= 0x12d1
TargetProductList="1001,1406,140c,14ac"

CheckSuccess=20

MessageContent="55534243123456780000000000000011060000000000000000000000000000"

type command:
usb_modeswitch -v 0x12d1 -p 0x1446 -V 0x12d1 -P 0x1401 -c /etc/usb_modeswitch.d/12d1\:1446
Warning: TargetProductList overrides TargetProduct!

Looking for target devices ...
No devices in target mode or class found
Looking for default devices ...
found matching product ID
adding device
Found device in default mode, class or configuration (1)
Accessing device 008 on bus 001 ...
Getting the current device configuration ...
OK, got current device configuration (1)
Using interface number 0
Using endpoints 0x01 (out) and 0x81 (in)
Inquiring device details; driver will be detached ...
Looking for active driver ...
OK, driver found ("usb-storage")
OK, driver "usb-storage" detached

SCSI inquiry data (for identification)
-------------------------
Vendor String: HUAWEI
Model String: Mass storage
Revision String: ffff
-------------------------

USB description data (for identification)
-------------------------
Manufacturer: Huawei Incorporated
Product: HUAWEI Mobile Connect
Serial No.: 1234567890ABCDEF
-------------------------
Setting up communication with interface 0
Using endpoint 0x01 for message sending ...
Trying to send message 1 to endpoint 0x01 ...
OK, message successfully sent
Resetting response endpoint 0x81
Resetting message endpoint 0x01

Checking for mode switch (max. 20 times, once per second) ...
Searching for target devices ...
Searching for target devices ...
....
Searching for target devices ...
Searching for target devices ...
No new devices in target mode or class found

Mode switch has failed. Bye.

After searched on the internet,I made a config file named E5832_01

DefaultVendor= 0x12d1
DefaultProduct= 0x1446

TargetVendor= 0x12d1
TargetProduct= 0x1401

HuaweiMode=1

got result:
Looking for target devices ...
No devices in target mode or class found
Looking for default devices ...
found matching product ID
adding device
Found device in default mode, class or configuration (1)
Accessing device 013 on bus 001 ...
Getting the current device configuration ...
OK, got current device configuration (1)
Using interface number 0
Using endpoints 0x01 (out) and 0x81 (in)
Inquiring device details; driver will be detached ...
Looking for active driver ...
OK, driver found ("usb-storage")
OK, driver "usb-storage" detached

SCSI inquiry data (for identification)
-------------------------
Vendor String: HUAWEI
Model String: Mass storage
Revision String: ffff
-------------------------

USB description data (for identification)
-------------------------
Manufacturer: Huawei Incorporated
Product: HUAWEI Mobile Connect
Serial No.: 1234567890ABCDEF
-------------------------
Sending Huawei control message ...
OK, Huawei control message sent
-> Run lsusb to note any changes. Bye.

[root@192 config]# lsusb
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000
Bus 004 Device 001: ID 0000:0000

30 seconds later...
[root@192 config]# lsusb
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 013: ID 12d1:1446 Huawei Technologies Co., Ltd.
Bus 001 Device 001: ID 0000:0000
Bus 004 Device 001: ID 0000:0000

[root@192 config]# dmesg -c
<6>usb 1-2: USB disconnect, address 13
<6>usb 1-2: new high speed USB device using ehci_hcd and address 14
<6>usb 1-2: configuration #1 chosen from 1 choice
<6>scsi10 : SCSI emulation for USB Mass Storage devices
<7>usb-storage: device found at 14
<7>usb-storage: waiting for device to settle before scanning
<6>usb 1-2: USB disconnect, address 14
<6>usb 1-2: new high speed USB device using ehci_hcd and address 16
<6>usb 1-2: configuration #1 chosen from 1 choice
<6>scsi11 : SCSI emulation for USB Mass Storage devices
<7>usb-storage: device found at 16
<7>usb-storage: waiting for device to settle before scanning
<5>scsi 11:0:0:0: CD-ROM HUAWEI Mass storage ffff PQ: 0 ANSI: 2
<7>usb-storage: device scan complete

Not work,so I made another config file named E5832_02
DefaultVendor= 0x12d1
DefaultProduct= 0x1446

TargetVendor= 0x12d1
TargetProduct= 0x1401

MessageContent="55534243123456780000000000000011060000000000000000000000000000"

got result:
Looking for target devices ...
No devices in target mode or class found
Looking for default devices ...
found matching product ID
adding device
Found device in default mode, class or configuration (1)
Accessing device 016 on bus 001 ...
Getting the current device configuration ...
OK, got current device configuration (1)
Using interface number 0
Using endpoints 0x01 (out) and 0x81 (in)
Inquiring device details; driver will be detached ...
Looking for active driver ...
OK, driver found ("usb-storage")
OK, driver "usb-storage" detached

SCSI inquiry data (for identification)
-------------------------
Vendor String: HUAWEI
Model String: Mass storage
Revision String: ffff
-------------------------

USB description data (for identification)
-------------------------
Manufacturer: Huawei Incorporated
Product: HUAWEI Mobile Connect
Serial No.: 1234567890ABCDEF
-------------------------
Setting up communication with interface 0
Using endpoint 0x01 for message sending ...
Trying to send message 1 to endpoint 0x01 ...
OK, message successfully sent
Resetting response endpoint 0x81
Resetting message endpoint 0x01
-> Run lsusb to note any changes. Bye.

[root@192 config]# lsusb
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000
Bus 004 Device 001: ID 0000:0000

30 seconds later...
[root@192 config]# lsusb
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 019: ID 12d1:1446 Huawei Technologies Co., Ltd.
Bus 001 Device 001: ID 0000:0000
Bus 004 Device 001: ID 0000:0000

[root@192 config]# dmesg -c
<4>usb 1-2: usbfs: process 12034 (usb_modeswitch) did not claim interface 0 before use
<6>usb 1-2: USB disconnect, address 16
<6>usb 1-2: new high speed USB device using ehci_hcd and address 17
<6>usb 1-2: configuration #1 chosen from 1 choice
<6>scsi12 : SCSI emulation for USB Mass Storage devices
<7>usb-storage: device found at 17
<7>usb-storage: waiting for device to settle before scanning
<6>usb 1-2: USB disconnect, address 17
<6>usb 1-2: new high speed USB device using ehci_hcd and address 19
<6>usb 1-2: configuration #1 chosen from 1 choice
<6>scsi13 : SCSI emulation for USB Mass Storage devices
<7>usb-storage: device found at 19
<7>usb-storage: waiting for device to settle before scanning
<5>scsi 13:0:0:0: CD-ROM HUAWEI Mass storage ffff PQ: 0 ANSI: 2
<7>usb-storage: device scan complete

Josh
Site Admin
Posts: 6570
Joined: 03 Nov 2007, 00:30

Re: Huawei E5832 can not switch mode

Post by Josh » 22 Dec 2014, 16:18

Load the current source packages for program and data from this site and use the configuration file included there.

Also, when called on the command line with a config file, you don't need to specify the target ID. It's in the config file.

unetin
Posts: 2
Joined: 22 Dec 2014, 13:12

Re: Huawei E5832 can not switch mode

Post by unetin » 23 Dec 2014, 04:52

Hi Josh
Thanks for the reply~
I've compiled the newest version and downloaded usb-modeswitch-data-20140529.tar.bz2 ...
[root@192 config]# /usr/sbin/usb_modeswitch --version

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

! PLEASE REPORT NEW CONFIGURATIONS !
[root@192 config]# ldd /usr/sbin/usb_modeswitch
linux-gate.so.1 => (0xb7f5d000)
libusb-1.0.so.0 => /usr/lib/libusb-1.0.so.0 (0xb7f4f000) ==>The newest libusb
libc.so.6 => /lib/libc.so.6 (0x006d7000)
librt.so.1 => /lib/librt.so.1 (0x0097c000)
libpthread.so.0 => /lib/libpthread.so.0 (0x00864000)
/lib/ld-linux.so.2 (0x006b8000)

[root@192 config]# lsusb
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 021: ID 12d1:1446 Huawei Technologies Co., Ltd. ==>Original vendor/product ID
Bus 001 Device 001: ID 0000:0000
Bus 004 Device 001: ID 0000:0000

[root@192 config]# /usr/sbin/usb_modeswitch -c /tmp/usb-modeswitch-data-20140529/usb_modeswitch.d/12d1\:1446
No default vendor/product ID given. Abort
=>I copied the file and named E5832 and added default vendor/product ID:
[root@192 config]# cat E5832
# Huawei, newer modems
DefaultVendor= 0x12d1
DefaultProduct= 0x1446

TargetVendor=0x12d1
TargetProductList="1001,1406,140b,140c,1412,141b,1432,1433,1436,14ac,1506,150c,1511"
HuaweiNewMode=1

[root@192 config]# /usr/sbin/usb_modeswitch -c ./E5832
Look for target devices ...
No devices in target mode or class found
Look for default devices ...
product ID matched
Found devices in default mode (1)
Access device 021 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 Incorporated
Product: HUAWEI Mobile Connect
Serial No.: 1234567890ABCDEF
-------------------------
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!
[root@192 config]# lsusb
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 024: ID 12d1:1446 Huawei Technologies Co., Ltd. ==>No change
Bus 001 Device 001: ID 0000:0000
Bus 004 Device 001: ID 0000:0000
[root@192 config]# dmesg
<6>usb 1-2: USB disconnect, address 21
<6>usb 1-2: new high speed USB device using ehci_hcd and address 22
<6>usb 1-2: configuration #1 chosen from 1 choice
<6>scsi15 : SCSI emulation for USB Mass Storage devices
<7>usb-storage: device found at 22
<7>usb-storage: waiting for device to settle before scanning
<6>usb 1-2: USB disconnect, address 22
<6>usb 1-2: new high speed USB device using ehci_hcd and address 24
<6>usb 1-2: configuration #1 chosen from 1 choice
<6>scsi16 : SCSI emulation for USB Mass Storage devices
<7>usb-storage: device found at 24
<7>usb-storage: waiting for device to settle before scanning
<5>scsi 16:0:0:0: CD-ROM HUAWEI Mass storage ffff PQ: 0 ANSI: 2
<7>usb-storage: device scan complete
==>Still can't change mode..

Josh
Site Admin
Posts: 6570
Joined: 03 Nov 2007, 00:30

Re: Huawei E5832 can not switch mode

Post by Josh » 14 Jan 2015, 09:13

Use this command (assuming you put the "12d1:1446" file in /etc/usb_modeswitch.d):

usb_modeswitch -W -s 20 -v 0x12d1 -p 0x1446 -c /etc/usb_modeswitch.d/12d1\:1446

Post the entire output. Also, what kind of system do you have? Is this embedded?

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

Re: Huawei E5832 can not switch mode

Post by LOM » 15 Jan 2015, 12:38

Which hardware are you running the dongle on, Raspberry Pi?
You have way too many disconnects/reappearance of the dongle in your log which I guess is either caused by not enogh power on the usb port to drive the dongle or a combination of crappy usb host hardware/software.

A usb device will get an address on the usb bus assigned when you plug it in (new highspeed blablabla) and there should only be one disappearance+reappearance of the device when it gets mode switched. The address will be incremented by 1 when it reappears with its new usb id.

Post Reply