Activation Codes and Methods, Hardware Details, Sniffing
fmayaturk
Posts: 9
Joined: 29 Sep 2009, 15:10
Location: Turkey

i can't use Huawei E1690 as modem

Post by fmayaturk » 29 Sep 2009, 16:29

i have Huawei E1690 HSPDA USB Modem. i use Pardus-Linux. i have installed USB_ModeSwitch from its Pisi-package. after installing i have changed the section about Huawei E169 in /etc/usb_modeswitch.conf file like following:

########################################################
Huawei E1690

Contributor: Dale Lane

DefaultVendor= 0x12d1;
DefaultProduct= 0x1446

choose one of these:
DetachStorageOnly=1
HuaweiMode=1


########################################################
# Huawei E180

after that i run usb_modeswitch programm. this are the commands and the results:

Code: Select all

ferit-pardus etc # usb_modeswitch -v 0x12d1 -p 0x1446 -H

 * usb_modeswitch: tool for controlling "flip flop" mode USB devices
 * Version 1.0.2 (C) Josua Dietze 2009                              
 * Works with libusb 0.1.12 and probably other versions             

Looking for default devices ...
 Found default devices (1)     
Accessing device 002 on bus 001 ...
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                   
 Could not get INQUIRY response (error -16)          

Device description data (identification)
-------------------------               
Manufacturer: HUAWEI Technology         
     Product: HUAWEI Mobile             
  Serial No.: not provided              
-------------------------               
Sending Huawei control message ...      
 OK, Huawei control message sent        
-> Run lsusb to note any changes. Bye.

ferit-pardus ferit # usb_modeswitch -v 0x12d1 -p 0x1446 -d     

 * usb_modeswitch: tool for controlling "flip flop" mode USB devices
 * Version 1.0.2 (C) Josua Dietze 2009                              
 * Works with libusb 0.1.12 and probably other versions             

Looking for default devices ...
 Found default devices (1)
Accessing device 002 on bus 001 ...
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

Received inquiry data (detailed identification)
-------------------------
  Vendor String: HUAWEI
 Product String: Mass Storage
Revision String: 2.31
-------------------------

Device description data (identification)
-------------------------
Manufacturer: HUAWEI Technology
     Product: HUAWEI Mobile
  Serial No.: not provided
-------------------------
Only detaching storage driver for switching ...
 Any driver was already detached for inquiry
-> Run lsusb to note any changes. Bye.

and this are lsusb and dmesg (only the section about my device) results

Code: Select all

ferit-pardus ferit # lsusb
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 12d1:1446 Huawei Technologies Co., Ltd. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub 
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub 
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub 
ferit-pardus ferit # dmesg
[  371.372146] usb 1-3: new high speed USB device using ehci_hcd and address 2 
[  371.498347] usb 1-3: New USB device found, idVendor=12d1, idProduct=1446    
[  371.498360] usb 1-3: New USB device strings: Mfr=3, Product=2, SerialNumber=0
[  371.498372] usb 1-3: Product: HUAWEI Mobile
[  371.498379] usb 1-3: Manufacturer: HUAWEI Technology
[  371.498590] usb 1-3: configuration #1 chosen from 1 choice
[  372.826813] Initializing USB Mass Storage driver...
[  372.869248] scsi2 : SCSI emulation for USB Mass Storage devices
[  372.887403] usb-storage: device found at 2
[  372.887406] usb-storage: waiting for device to settle before scanning
[  372.887452] scsi3 : SCSI emulation for USB Mass Storage devices
[  372.887692] usbcore: registered new interface driver usb-storage
[  372.887696] USB Mass Storage support registered.
[  372.910499] usb-storage: device found at 2
[  372.910503] usb-storage: waiting for device to settle before scanning
[  373.888379] usb-storage: device scan complete
[  373.913119] usb-storage: device scan complete
[  373.915129] scsi 3:0:0:0: Direct-Access     HUAWEI   SD Storage       2.31 PQ: 0 ANSI: 2
[  380.102068] usb 1-3: reset high speed USB device using ehci_hcd and address 2
[  390.327143] usb 1-3: reset high speed USB device using ehci_hcd and address 2
[  390.550113] usb 1-3: reset high speed USB device using ehci_hcd and address 2
[  390.684624] scsi 2:0:0:0: CD-ROM            HUAWEI   Mass Storage     2.31 PQ: 0 ANSI: 2
[  390.698588] sr1: scsi-1 drive
[  390.698712] sr 2:0:0:0: Attached scsi CD-ROM sr1
[  390.698796] sr 2:0:0:0: Attached scsi generic sg2 type 5
[  390.698962] sd 3:0:0:0: Attached scsi generic sg3 type 0
[  390.712179] sd 3:0:0:0: [sdb] Attached SCSI removable disk
[  391.821230] usb 1-3: usbfs: process 985 (modem-modeswitc) did not claim interface 0 before use
it doesn't switch to modem. i do something wrong, but i don't know what that is.

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

Post by Josh » 13 Oct 2009, 20:55

This is suspicious:
[ 391.821230] usb 1-3: usbfs: process 985 (modem-modeswitc) did not claim interface 0 before use
Can you try to replace your version with the latest one, 1.0.5?

You don't need a package, just rename your old "/usr/sbin/usb_modeswitch" to something like "usb_modeswitch.old", take the binary out of the TGZ file you loaded from here, and put it into "/usr/sbin".

aaa37
Posts: 23
Joined: 08 Oct 2009, 07:59

Post by aaa37 » 16 Oct 2009, 08:07

I also will have this problem by chance :shock:
the version is latest one, 1.0.5.

Code: Select all

Looking for default devices ...
 Found default devices (1)
Accessing device 002 on bus 002 ...
Using endpoints 0x04 (out) and 0x83 (in)
Inquiring device details; driver will be detached ...
Looking for active driver ...
 OK, driver found ("usb-storage")
 OK, driver "usb-storage" detached
and , the usb_modeswitch can't run , hangs on here, can't show any message after this.

I try many times to do, restart ... re-plug..., it still can't work,
finally I plug E169 to windows XP system, after a long initial,
it can works, then I re-plug E169 to my arm mechine,
it works again-.-

usually E169 works normally=.=
the problem maybe due to E169 self??

fmayaturk
Posts: 9
Joined: 29 Sep 2009, 15:10
Location: Turkey

Post by fmayaturk » 19 Oct 2009, 15:41

Josh wrote:This is suspicious:
[ 391.821230] usb 1-3: usbfs: process 985 (modem-modeswitc) did not claim interface 0 before use
Can you try to replace your version with the latest one, 1.0.5?

You don't need a package, just rename your old "/usr/sbin/usb_modeswitch" to something like "usb_modeswitch.old", take the binary out of the TGZ file you loaded from here, and put it into "/usr/sbin".
thanx for answer!
i've taken the binary "usb_modeswitch" from TGZ file and put it in "usr/bin/usb_modeswitch" (usb_modeswitch binary was here in Pardus-Linux), and changed "etc/usb_modeswitch.conf" with new usb_modeswitch.conf from TGZ file.
then i run usb_modeswitch v- 12d1 p- 1446 and here is the result

Code: Select all

ferit-pardus etc # usb_modeswitch -v 12d1 -p 1446 -H

Looking for default devices ...
 Found default devices (1)
Accessing device 002 on bus 001 ...
Using endpoints 0x01 (out) and 0x81 (in)
Inquiring device details; driver will be detached ...
Looking for active driver ...
 No driver found. Either detached before or never attached
after that i used sniffusb2.0 in windows. from his logfile i found this number "55534243000000000000000000000011060000000000000000000000000000" for MessageContent and changed the MessageContents in usb_modeswitch.conf under Huawei270+ and Huawei1550. than i run usb_modeswitch v- 12d1 p- 1446 again and here is the result

Code: Select all

ferit-pardus etc # usb_modeswitch v- 12d1 p- 1446

Looking for target devices ...
 No devices in target mode or class found
Looking for default devices ...
 Found default devices (1)
Accessing device 002 on bus 001 ...
Using endpoints 0x01 (out) and 0x81 (in)
Inquiring device details; driver will be detached ...
Looking for active driver ...
 No driver found. Either detached before or never attached
it doesn't switch to modem and i can't use it in Linux. what should i do more?

fmayaturk
Posts: 9
Joined: 29 Sep 2009, 15:10
Location: Turkey

Post by fmayaturk » 19 Oct 2009, 15:55

aaa37 wrote: usually E169 works normally=.=
the problem maybe due to E169 self??
thanx for your help too!
but my device is E1690. it's a different model from E169 and it has different product ID (12d1:1446). your solution doesn't work by my problem.

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

Post by Josh » 19 Oct 2009, 19:08

Can you post what kernel version you are using? The quickest way to see that is probably "uname -r" at a terminal.

Also, I think your modem switched all right, but after some seconds it resets to CD-ROM mode.

There seems to be an issue with some Huawei devices which is adressed in the very latest kernels. The problem is the SCSI part of the storage driver system. There were reports from a E169 which reset if no SD card was inserted. You might try using one in the slot when switching.

Other than that, there is a little kernel patch to apply.

To check if the switching did work (even for some seconds) try this:

Code: Select all

# modprobe -v option
# echo "12d1 1446" >/sys/bus/usb-serial/drivers/option1/new_id
You can do that at any time before plugging/switching, and then checking the "dmesg" output again to see if the serial devices were created.

Oh, and if you do a command line call again, don't forget to mark the IDs as hexadecimal:

# usb_modeswitch -v 0x12d1 -p 0x1446 -H

fmayaturk
Posts: 9
Joined: 29 Sep 2009, 15:10
Location: Turkey

Post by fmayaturk » 20 Oct 2009, 10:21

Can you post what kernel version you are using? The quickest way to see that is probably "uname -r" at a terminal.
2.6.30.8-127
There seems to be an issue with some Huawei devices which is adressed in the very latest kernels. The problem is the SCSI part of the storage driver system. There were reports from a E169 which reset if no SD card was inserted. You might try using one in the slot when switching.
I'm not sure, that I understood this part. But I've inserted a microSD card in the modem and looked if it switches to modem automaticly. It didn't switch to modem. Only i saw microSD as a Volume. What is changed? I was seeing as storage TurkcellConnect. This is the driver section for windows. This part was disabled, microSD card was enabled. But it doesn't switch to modem.

After that i tried this code:

Code: Select all

# modprobe -v option
# echo "12d1 1446" >/sys/bus/usb-serial/drivers/option1/new_id
and i saw in dmesg report (finally) it switched to GSM modem

Code: Select all

[ 2928.579490] usbcore: registered new interface driver usbserial
[ 2928.580029] USB Serial support registered for generic
[ 2928.580393] usbcore: registered new interface driver usbserial_generic
[ 2928.580396] usbserial: USB Serial Driver core
[ 2928.589937] USB Serial support registered for GSM modem (1-port)
[ 2928.590244] usbcore: registered new interface driver option
[ 2928.590247] option: v0.7.2:USB Driver for GSM modems
[ 3011.791344] option 1-4:1.0: GSM modem (1-port) converter detected
[ 3011.791550] usb 1-4: GSM modem (1-port) converter now attached to ttyUSB0
This was happy for me. But unfortunately while using kppp and wvdial modem not responding.

Code: Select all

ferit@ferit-pardus ~ $ kppp -c Turkcell -m huawei
kppp(7645) main: helperPid:  7646                
kppp(7645) KPPPWidget::KPPPWidget: cmdl_account:  true
kppp(7645) KPPPWidget::KPPPWidget: cmdl_modem:  true  
kppp(7645) Requester::sendRequest: sendRequest: trying to send msg type  6
Opener: received SetSecret                                                
kppp(7645) Requester::sendRequest: sendRequest: sent message              
kppp(7645) Requester::recvResponse: recvResponse(): waiting for message   
kppp(7645) Requester::recvResponse: recvResponse(): received message      
kppp(7645) Requester::recvResponse: response.status:  0                   
kppp(7645) Requester::sendRequest: sendRequest: trying to send msg type  6
Opener: received SetSecret                                                
kppp(7645) Requester::sendRequest: sendRequest: sent message              
kppp(7645) Requester::recvResponse: recvResponse(): waiting for message   
kppp(7645) Requester::recvResponse: recvResponse(): received message      
kppp(7645) Requester::recvResponse: response.status:  0                   
kppp(7645) Requester::sendRequest: sendRequest: trying to send msg type  2
kppp(7645) Requester::sendRequest: sendRequest: sent message              
Opener: received OpenLock                                                 

kppp(7645) Requester::recvFD: response.status:  0
kppp(7645) Modem::lockdevice: Locking Device:  0000007645
kppp(7645) Modem::opentty: Opening Device:  "/dev/ttyUSB0"
kppp(7645) Requester::sendRequest: sendRequest: trying to send msg type  1
kppp(7645) Requester::sendRequest: sendRequest: sent message              
Opener: received OpenDevice                                               
kppp(7645) Requester::recvFD: response.status:  0                         
kppp(7645) Modem::unlockdevice: UnLocking Modem Device                    
kppp(7645) Requester::sendRequest: sendRequest: trying to send msg type  3
kppp(7645) Requester::sendRequest: sendRequest: sent message              
kppp(7645) Requester::recvResponse: recvResponse(): waiting for message   
Opener: received RemoveLock                                               
kppp(7645) Requester::recvResponse: recvResponse(): received message      
kppp(7645) Requester::recvResponse: response.status:  0                   
kppp(7645) Requester::sendRequest: sendRequest: trying to send msg type  7
kppp(7645) Requester::sendRequest: sendRequest: sent message              
kppp(7645) Requester::recvResponse: recvResponse(): waiting for message   
Opener: received RemoveSecret                                             
kppp(7645) Requester::recvResponse: recvResponse(): received message      
kppp(7645) Requester::recvResponse: response.status:  0                   
kppp(7645) Requester::sendRequest: sendRequest: trying to send msg type  7
kppp(7645) Requester::sendRequest: sendRequest: sent message              
kppp(7645) Requester::recvResponse: recvResponse(): waiting for message   
Opener: received RemoveSecret                                             
kppp(7645) Requester::recvResponse: recvResponse(): received message      
kppp(7645) Requester::recvResponse: response.status:  0                   
kppp(7645) Requester::sendRequest: sendRequest: trying to send msg type  4
kppp(7645) Requester::sendRequest: sendRequest: sent message
Opener: received OpenResolv
kppp(7645) Requester::recvFD: response.status:  0
kppp(7645) Requester::sendRequest: sendRequest: trying to send msg type  4
kppp(7645) Requester::sendRequest: sendRequest: sent message
Opener: received OpenResolv
kppp(7645) Requester::recvFD: response.status:  0
kppp(7645) Requester::sendRequest: sendRequest: trying to send msg type  10
kppp(7645) Requester::sendRequest: sendRequest: sent message
kppp(7645) Requester::recvResponse: recvResponse(): waiting for message
Opener: received KillPPPDaemon
kppp(7645) Requester::recvResponse: recvResponse(): received message
kppp(7645) Requester::recvResponse: response.status:  1

Code: Select all

ferit-pardus ferit # wvdial 3g
--> WvDial: Internet dialer version 1.60
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: ATZ
--> Sending: ATQ0
--> Re-Sending: ATZ
--> Modem not responding.
I will ask this problem to Pardus-users mailing list. thanx a lot for help.

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

Post by Josh » 24 Oct 2009, 09:25

The thing is that your device was switched but there was no driver bound to it until you made the connection between the ID and the "option" driver.

rashidkpc
Posts: 2
Joined: 26 Oct 2009, 17:15

Post by rashidkpc » 26 Oct 2009, 17:21

Ok, just spend awhile tackling this and have it nailed. The e1690 uses the same usb_modeswitch config as the e1692. Stick this in your /etc/usb_modeswitch.conf:

Code: Select all

# Huawei E1690
DefaultVendor=  0x12d1
DefaultProduct= 0x1446

TargetVendor=   0x12d1
TargetProduct=  0x140c

MessageContent="55534243000000000000000000000011060000000000000000000000000000"

CheckSuccess=5
Then run usb_modeswitch. It will say it has failed. It has not, check dmesg, you'll see that /dev/ttyUSB0 through /dev/ttyUSB2 have been created and WORK.

You're good to go, though you can remove the need for usb_modeswitch now if you'd like by opening up minicom and connecting to /dev/ttyUSB0 and typing:

Code: Select all

AT^U2DIAG=0
Hit Enter, exit minicom. That disabled the CDROM/storage functionaity. It will automatically be in modem mode from now on.

Cheers!

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

Post by Josh » 27 Oct 2009, 09:28

Interesting!

Can you switch the CD-ROM part back on again? Probably using the same command with different parameters?

It might just be you need the MS Windows drivers again at some point.

aaa37
Posts: 23
Joined: 08 Oct 2009, 07:59

Post by aaa37 » 30 Oct 2009, 05:55

Hi, I got E1692 yesterday, and I can run usb_modeswitch success,
here is configure.

Code: Select all

DefaultVendor=  0x12d1
DefaultProduct= 0x1446

TargetVendor= 0x12d1
TargetProduct= 0x140c

MessageEndpoint=0x01
MessageContent="55534243000000000000000000000011060000000000000000000000000000"

CheckSuccess=5
here is log

Code: Select all

Received inquiry data (detailed identification)
-------------------------
  Vendor String: HUAWEI  
   Model String: Mass Storage    
Revision String: 2.31
-------------------------

Device description data (identification)
-------------------------
Manufacturer: HUAWEI Technology
     Product: HUAWEI Mobile
  Serial No.: not provided
-------------------------
Setting up communication with interface 0 ...
Trying to send the message to endpoint 0x01 ...
 OK, message successfully sent
USB error: could not clear/halt ep 1: Protocol error
 Device is gone, skipping any further commands

Checking for mode switch (max. 5 times, once per second) ...
 Original device is gone already, not checking
 Searching for target devices ...
usb_os_find_devices: Found 001 on 002
usb_os_find_devices: Found 001 on 001
 Searching for target devices ...
usb_os_find_devices: Found 001 on 002
usb_os_find_devices: Found 001 on 001
 Searching for target devices ...
usb_os_find_devices: Found 001 on 002
usb_os_find_devices: Found 001 on 001
 Searching for target devices ...
usb_os_find_devices: Found 001 on 002
usb_os_find_devices: Found 001 on 001
usb 1-2: new high speed USB device using ehci_hcd and address 3
scsi2 : SCSI emulation for USB Mass Storage devices            
scsi3 : SCSI emulation for USB Mass Storage devices
 Searching for target devices ...                  
usb_os_find_devices: Found 001 on 002
usb_os_find_devices: Found 003 on 001
usb_os_find_devices: Found 001 on 001
error obtaining child information: Inappropriate ioctl for device
 Found correct target device

Mode switch succeeded. Bye.
and to do
"modprobe usbserial vendor=0x12d1 product=0x140c"

the ttyUSB0 is be attached, so that can use pppd to dial up success.

rashidkpc
Posts: 2
Joined: 26 Oct 2009, 17:15

Post by rashidkpc » 24 Nov 2009, 08:47

Yes, as I'm sure you could guess, the CD-ROM can be turned back on with:

Code: Select all

AT^U2DIAG=1

fmayaturk
Posts: 9
Joined: 29 Sep 2009, 15:10
Location: Turkey

Post by fmayaturk » 29 Dec 2009, 17:13

hi again!
i don't have still a solution for my problem. i'm confused. i used the latest usb_modeswitch.conf (1.0.6) file. but no solution. best point what i've done is to switch my device to a GSM-Modem. This code has switched my device to modem:

Code: Select all

# modprobe -v option
# echo "12d1 1446" >/sys/bus/usb-serial/drivers/option1/new_id
this code creats /dev/ttyUSB0 port
but modem is not responding by kppp and wvdial.
i tried to use minicom. i changed default port from ttyS1 to ttyUSB0. but minicom can't initialize modem too.
why does my modem have initializing problem with all this programs?

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

Post by Josh » 29 Dec 2009, 22:17

The commands you posted do not do any switching.

Your device is one of the newer Huawei modems; they change their IDs after switching, unlike the older ones.

So the old entry in the config file was wrong. You need to switch the modem to ID "12d1:140c" or very similar (run "lsusb" to check). If you still see "12d1:1446" the switching did not work.

Use the entry that aaa37 posted.

After switching, do what you described, but insert your new ID in the "echo" command. It should start like this:

# echo "12d1 140c" ...

As I said, check and possibly adapt that ID.


fmayaturk
Posts: 9
Joined: 29 Sep 2009, 15:10
Location: Turkey

Post by fmayaturk » 15 Jan 2010, 13:43

finally i CAN use my Huawei E1690 :)
thanx for your helps and this great programm. i have one more question. but it is at end.
i used the advices of sarkis in this topic
http://www.draisberghof.de/usb_modeswit ... .php?t=284
i repeat it here for Huawei E1690 users, what i did.
first i have solved it in ubuntu:
i installed first libusb-dev package for ubuntu. (it is necessary for integrated install.) i unplugged my modem.
then installed usb_modeswitch-1.0.7.tar.bz2 file and followed the steps of sarkis

Code: Select all

tar -xjvf usb_modeswitch-1.0.6.tar.bz2
cd usb_modeswitch-1.0.6
sudo modprobe -r -v usbserial
sudo make integrated_install 
i plugged modem. nothing was changed
then followed steps more.
unplugged modem. given the commands

Code: Select all

sudo modprobe -r -v option
sudo modprobe -r -v usbserial
lsusb
lsmod | grep usb
tail -f /var/log/dmesg ; echo
leaved the terminal open. i plugged modem again. i saw no changes in terminal (perhaps i was doing something wrong in this step. my log messages were not changing simultaneously. i don't know and it is not important.) i pressed Ctrl+C. given the commands lsusb and ls /dev/ttyUSB*. the results made me cry :wink:

Code: Select all

$ lsusb
Bus 001 Device 004: ID 12d1:1001 Huawei Technologies Co., Ltd. E620 USB Modem

$ ls /dev/ttyUSB* 
/dev/ttyUSB0  /dev/ttyUSB1  /dev/ttyUSB2 
after that ubuntu's network manager made everything with wizard (i helped to it). it was the simplest step :wink: i was in internet after months with my modem by linux.
then i made the similair steps in Pardus
i had pisi-package (version 1.0.5) for Pardus in my pc installed. i have uninstalled it first. then made integrated install (version 1.0.7) just like in ubuntu.
i used KPPP to make the internet connection. finally i did it in Pardus too. :wink:
and the problem:
it switches not automatically. if i open pc as modem plugged, i have to unplug and replug modem manually. if i open pc as modem unplugged and plug it after opening, i have to unplug and replug modem manually too. how can i solve this (last, small) problem?
thanx again for all your helps!

Post Reply