Automatic Activation, Hotplug and UDEV, Configuration
Post Reply
Poltergeist
Posts: 8
Joined: 05 Jul 2011, 14:47

usb_modswitch in Ubuntu 11.04 and Huawei 173

Post by Poltergeist » 05 Jul 2011, 16:33

It seems to work when the computer is Off and ON however when restarting out of windows to ubuntu it isnt recognized.

Is there a rescan or reload command?


Another story is my TP-link 1043ND DD-WRT router. No joy there with my USB stik. It does recognize it as storage and SDcard but not as a modem.

So I would like to know if its possible to take all the device info from Ubuntu and somehow trigger that on the Router by hand and by autorun script?

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

Post by Josh » 06 Jul 2011, 20:19

If you boot from Windows, the device was already switched to modem by the Windows driver. It stays in that mode as long as the power is up, even if you do a warm reboot.

If the serial driver ("option") will not bind automatically, then the fall-back of usb_modeswitch will kick in. Mind that you should have at least version 1.1.6 to make that work properly.


Poltergeist
Posts: 8
Joined: 05 Jul 2011, 14:47

Post by Poltergeist » 06 Jul 2011, 21:19

I have browsed around the forum for a while now and read the problems from others. What I found out so far is this.

lsusb shows me this:
Bus 003 Device 002: ID 045e:0047 Microsoft Corp. IntelliMouse Explorer 3.0
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 010: ID 12d1:1c07 Huawei Technologies Co., Ltd.
Bus 001 Device 002: ID 0781:5406 SanDisk Corp. Cruzer Micro U3
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

The command I came up with is this:
sudo usb_modeswitch -v 0x12d1 -p 0x1c07 -V 0x12d1 -P 0x140c -M "55534243123456780000000000000011060000000000000000000000000000"

which produces this:

Looking for target devices ...
No devices in target mode or class found
Looking for default devices ...
Found devices in default mode, class or configuration (1)
Accessing device 010 on bus 001 ...
Getting the current device configuration ...
OK, got current device configuration (1)
Using endpoints 0x0f (out) and 0x8e (in)
Using endpoints 0x0f (out) and 0x8e (in)
Not a storage device, skipping SCSI inquiry

USB description data (for identification)
-------------------------
Manufacturer: HUAWEI
Product: HUAWEI Mobile
Serial No.: not provided
-------------------------
Looking for active driver ...
No driver found. Either detached before or never attached
Setting up communication with interface 0 ...
Using endpoint 0x0f for message sending ...
Trying to send message 1 to endpoint 0x0f ...
OK, message successfully sent
Resetting response endpoint 0x8e
Resetting message endpoint 0x0f
-> Run lsusb to note any changes. Bye.



Thats all I can come up with. Of course the device doesn't work.
I have no idea if that part is correct. I just copied it from another post. V 0x12d1 -P 0x140c -M

So what do I need to do now? Im running Ubuntu 11.04 with

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

! PLEASE REPORT NEW CONFIGURATIONS !

Poltergeist
Posts: 8
Joined: 05 Jul 2011, 14:47

Post by Poltergeist » 06 Jul 2011, 21:32

[ 174.592086] usb 1-5: new high speed USB device using ehci_hcd and address 5
[ 175.125299] scsi5 : usb-storage 1-5:1.0
[ 175.130494] scsi6 : usb-storage 1-5:1.1
[ 175.935202] usb 1-5: USB disconnect, address 5
[ 181.284056] usb 1-5: new high speed USB device using ehci_hcd and address 6
[ 181.821921] scsi7 : usb-storage 1-5:1.4
[ 181.826765] scsi8 : usb-storage 1-5:1.5
[ 182.821499] scsi 7:0:0:0: CD-ROM HUAWEI Mass Storage 2.31 PQ: 0 ANSI: 2
[ 182.831207] sr1: scsi-1 drive
[ 182.831667] sr 7:0:0:0: Attached scsi CD-ROM sr1
[ 182.832990] sr 7:0:0:0: Attached scsi generic sg3 type 5
[ 182.833590] scsi 8:0:0:0: Direct-Access HUAWEI SD Storage 2.31 PQ: 0 ANSI: 2
[ 182.839757] sd 8:0:0:0: Attached scsi generic sg4 type 0
[ 182.840883] sd 8:0:0:0: [sdc] Attached SCSI removable disk
[ 210.127799] usb 1-5: USB disconnect, address 6
[ 218.460061] usb 1-3: new high speed USB device using ehci_hcd and address 7
[ 218.990539] scsi9 : usb-storage 1-3:1.0
[ 219.000710] scsi10 : usb-storage 1-3:1.1
[ 219.707155] usb 1-3: USB disconnect, address 7
[ 225.056137] usb 1-3: new high speed USB device using ehci_hcd and address 8
[ 225.598635] scsi11 : usb-storage 1-3:1.4
[ 225.609644] scsi12 : usb-storage 1-3:1.5
[ 226.608965] scsi 11:0:0:0: CD-ROM HUAWEI Mass Storage 2.31 PQ: 0 ANSI: 2
[ 226.614690] sr1: scsi-1 drive
[ 226.615153] sr 11:0:0:0: Attached scsi CD-ROM sr1
[ 226.615899] sr 11:0:0:0: Attached scsi generic sg3 type 5
[ 226.627501] scsi 12:0:0:0: Direct-Access HUAWEI SD Storage 2.31 PQ: 0 ANSI: 2
[ 226.636364] sd 12:0:0:0: Attached scsi generic sg4 type 0
[ 226.637079] sd 12:0:0:0: [sdc] Attached SCSI removable disk
[ 1544.748114] usb 1-3: USB disconnect, address 8
[ 1551.960056] usb 1-3: new high speed USB device using ehci_hcd and address 9
[ 1552.495473] scsi13 : usb-storage 1-3:1.0
[ 1552.502608] scsi14 : usb-storage 1-3:1.1
[ 1553.211511] usb 1-3: USB disconnect, address 9
[ 1558.560087] usb 1-3: new high speed USB device using ehci_hcd and address 10
[ 1559.098490] scsi15 : usb-storage 1-3:1.4
[ 1559.103494] scsi16 : usb-storage 1-3:1.5
[ 1560.097309] scsi 15:0:0:0: CD-ROM HUAWEI Mass Storage 2.31 PQ: 0 ANSI: 2
[ 1560.108183] sr1: scsi-1 drive
[ 1560.108679] sr 15:0:0:0: Attached scsi CD-ROM sr1
[ 1560.109423] sr 15:0:0:0: Attached scsi generic sg3 type 5
[ 1560.110833] scsi 16:0:0:0: Direct-Access HUAWEI SD Storage 2.31 PQ: 0 ANSI: 2
[ 1560.116543] sd 16:0:0:0: Attached scsi generic sg4 type 0
[ 1560.120536] sd 16:0:0:0: [sdc] Attached SCSI removable disk
dmesg

Poltergeist
Posts: 8
Joined: 05 Jul 2011, 14:47

Post by Poltergeist » 06 Jul 2011, 21:55

I tried what you suggested. Booted into windows, connected to the internet with 3G and then booted into linux. Still nothing. It didnt switch.

After the day it worked I switched some AT commands for my stik like this AT^U2DIAG=0
This disabled the SD storage and CDROM. But still nothing was really working.

I restored it with
AT^U2DIAG=276
From my standpoint it looks like its back to factory settings but still.
Could I have messed something up?

Poltergeist
Posts: 8
Joined: 05 Jul 2011, 14:47

Post by Poltergeist » 07 Jul 2011, 00:06

I didnt know what else to do so I disabled the CD and SD again, rebooted and now I got this

Bus 002 Device 003: ID 045e:0047 Microsoft Corp. IntelliMouse Explorer 3.0
Bus 002 Device 002: ID 04fc:05d8 Sunplus Technology Co., Ltd Wireless keyboard/mouse
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 005: ID 12d1:1c05 Huawei Technologies Co., Ltd.
Bus 001 Device 004: ID 0781:5406 SanDisk Corp. Cruzer Micro U3
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub


So this actually means that the modem is 12d1:1c05 ?

Poltergeist
Posts: 8
Joined: 05 Jul 2011, 14:47

Post by Poltergeist » 07 Jul 2011, 01:11

This is when I restored the AT commands.

It comes back as 7 and I try to switch it to 5 and it actually works. But no drivers found. Thats where my linux knowledge also ends.

The only thing left to try now in hopes of auto changing and drivers loading is disabling SD card and CDrom once per try. Maybe it will come up with an ID thats already configured. Because for the love of God. It worked already with a freaking Ubuntu 11.04 Live CD boot.

Poltergeist
Posts: 8
Joined: 05 Jul 2011, 14:47

Post by Poltergeist » 07 Jul 2011, 01:30

We have a winner!!!

AT^U2DIAG=1
made it work. http://3g-modem.wetpaint.com/page/Huawei+AT-commands

Now One step done. Lets see what the DD/wrt rotuer says.

Bus 002 Device 003: ID 045e:0047 Microsoft Corp. IntelliMouse Explorer 3.0
Bus 002 Device 002: ID 04fc:05d8 Sunplus Technology Co., Ltd Wireless keyboard/mouse
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 008: ID 12d1:1c08 Huawei Technologies Co., Ltd.
Bus 001 Device 004: ID 0781:5406 SanDisk Corp. Cruzer Micro U3
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

So 1c08 is the modem and not 1c05! 05 must be the SD storage slot.

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

Post by Josh » 07 Jul 2011, 20:44

Poltergeist wrote:So 1c08 is the modem and not 1c05! 05 must be the SD storage slot.
No.

There are two possible target modes for the newer Huawei modems. As I said, if you come from Windows, the device is already switched, to modem target 1 (0x1c08).

Huawei engineers have urged me to use a slightly different switching command with usb_modeswitch which will bring the device into modem target 2 (0x1c05).

Both modes have ttyUSB0 as the port for connection. Both provide access to the SD card slot.

If the "option" driver does not know about the modem ID yet, it must be told about the device. After booting from Windows, you could do this:

Code: Select all

# modprobe -v option
# echo "12d1 1c08" > /sys/bus/usb-serial/drivers/option1/new_id
Or, with the current version of usb_modeswitch, you add a line "12d1:1c08" to the file "/var/lib/usb_modeswitch/bind_list".


Poltergeist
Posts: 8
Joined: 05 Jul 2011, 14:47

Post by Poltergeist » 08 Jul 2011, 17:26

Wait a minute.

This steps now are never done as a windows restart. I turn off the computer and Turn it on again after about 10 seconds so the USB stick is reset each time.

I used the command ATxxxx=0 (this is supposed to turn off everything apart for the modem and UI)
In each linux distro I came acros the lsusb reads now 1c05. If thats the modem ok. Please tell me how to load the drivers by hand.

When I use the command ATxxxx=1 (modem and CD only) I get the Id of 1c0b.
At this point Ubuntu 11.04 switches it to 1c08 and I can connect correctly!
So your modeswitcher works in 11.04 when It sees my ID 1c0b and switches it to 1c08.

With the first command I used of AT=0. This one leaves the UI on. What if 1c05 is actually the UIs ID?

Aynway for this to test I will edit the files you recommended and exchange the 1c08 with 1c05. That way we will know for sure if thats actually the second command for the modem or just the UIs one right?

I would still love to know how to load the drivers per hand for other older linux distros if its not to complicated.

Why Im even remotly recommending that 1c05 isnth the modem is because In DD-WRT one user had the same problem with 1c0b changing to 1c05 what was supposedly the modem and he never could establish the connection, not even when the developer BranSlayer intervented. Thats why I somehow dont think that 1c05 is the modem on this stick.

I will report back what I get.

This is my thread on DD-WRT http://www.dd-wrt.com/phpBB2/viewtopic. ... sc&start=0

This is the other reference thread when the user could not make a connection with a modifeid DD-WRT firmware. http://www.dd-wrt.com/phpBB2/viewtopic. ... 043nd+e173

The whole point was just to telling you that my stick can produce both IDs. 1c05 and 1c08 and that it 100% works in ubuntu 11.04 when it switches from 1c0b to 1c08 automatically.

So I'm actually not troubleshooting Ubuntu or your program but rather DD-WRT because the stik works in Ubuntu 11.04. Just wanted to point out that there could be a mistake but as it seems there isnt really one other then an outdated DD-WRT firmware and probably something on my side becauset the stick most likely works as a modem with both IDs.

tomorrow I will try best to make this work on a DDwet based router.

piro
Posts: 2
Joined: 03 Jan 2012, 15:25

Post by piro » 03 Jan 2012, 20:53

The thread is old, but google returns it when looking for product id 0x1c07, so it deserves a correction.

I have a Huawei E173 EVO reported as 12d1:1c07. 0x1c07 is actually a target product id: the device product id is actually 0x1c0b. The message is sent but 1c07 is missing from the target product list in the data file "12d1:1c0b" so the switch fails (the id is changed to what reported by lsusb, but no device is added). Adding 1c07 to the TargetProductList fixes the problem.

Cheers.

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

Post by Josh » 03 Jan 2012, 23:58

Thanks for the correction and addition!

I will change this for the next data package release.

Post Reply