Linux Format forums Forum Index Linux Format forums
Help, discussion, magazine feedback and more
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

K4505 dongle

 
Post new topic   Reply to topic    Linux Format forums Forum Index -> Hardware
View previous topic :: View next topic  
Author Message
johnbywr



Joined: Wed Feb 02, 2011 2:21 pm
Posts: 12

PostPosted: Tue Mar 08, 2011 3:54 pm    Post subject: K4505 dongle Reply with quote

I have been trying to get a usb dongle (K4505) working in Suse 11.2, without any success.
I can use a E220 dongle with the sim out of the K4505, but it will not get the speed of the K4505.
Everything I do, to try and get the cd part of the K4505 dongle to switch to the modem ends in failure.
I know the product id's of the two parts, but I cannot get it to switch.
Has anybody got some suggestions?
Back to top
View user's profile Send private message
PCNetSpec
LXF regular


Joined: Sun Feb 21, 2010 3:50 pm
Posts: 631
Location: Cornwall UK

PostPosted: Tue Mar 08, 2011 4:58 pm    Post subject: Reply with quote

Try these...

Install usb-modeswitch then add this to the end of your /etc/usb-modeswitch.conf file.

DefaultVendor = 0x12d1
;DefaultProduct = 0x101
DefaultProduct = 0x1521
MessageEndpoint = 0x01
MessageContent = "5553424312345678000000000000001106000000000000000 0000000000000"
HuaweiMode=1
CheckSuccess=5


then run:
Code:
usb_modeswitch

(you might need to run it as root)

If all goes well, you will see the messages:
Found a new device in target mode or class
Mode switch succeeded. Bye.


Try it both with and without that gap in the MessageContent line.
(ie. 13 zeros from the end)

You can leave out the CheckSuccess=5 line if you want

or

just plug it in and in a terminal enter (as root):
Code:
usb_modeswitch -v 0x12d1 -p 0x1521 -M 55534243123456780000000000000011060000000000000000000000000000

(that command is all one line, with a space after -M)
_________________
WARNING: You are logged into reality as 'root'... logging in as 'insane' is the only safe option.
Linux in the UK
The Linux Community Forum


Last edited by PCNetSpec on Tue Mar 08, 2011 7:59 pm; edited 1 time in total
Back to top
View user's profile Send private message
johnbywr



Joined: Wed Feb 02, 2011 2:21 pm
Posts: 12

PostPosted: Tue Mar 08, 2011 6:09 pm    Post subject: Reply with quote

Thanks for that PCNetSpec, I will try that ASAP.
I found that in my ramblings, but did not attach any significance to the long number string.
Back to top
View user's profile Send private message
johnbywr



Joined: Wed Feb 02, 2011 2:21 pm
Posts: 12

PostPosted: Tue Mar 08, 2011 7:21 pm    Post subject: Reply with quote

PCNetSpec wrote:
Try these...

Install usb-modeswitch then add this to the end of your /etc/usb-modeswitch.conf file.

DefaultVendor = 0x12d1
;DefaultProduct = 0x101
DefaultProduct = 0x1521
MessageEndpoint = 0x01
MessageContent = "5553424312345678000000000000001106000000000000000 0000000000000"
HuaweiMode=1
CheckSuccess=5


then run:
Code:
usb-modeswitch

(you might need to run it as root)

If all goes well, you will see the messages:
Found a new device in target mode or class
Mode switch succeeded. Bye.


Try it both with and without that gap in the MessageContent line.
(ie. 13 zeros from the end)

You can leave out the CheckSuccess=5 line if you want

or

just plug it in and in a terminal enter (as root):
Code:
usb_modeswitch -v 0x12d1 -p 0x1521 -M 55534243123456780000000000000011060000000000000000000000000000

(that command is all one line, with a space after -M)


THIS IS THE RESULT, HAVE I COPIED CORRECT?
usb_modeswitch -v 0x12d1 -p 0x1521 -m 55534243123456780000000000000011060000000000000000000000000000

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

Looking for default devices
Found default devices (1)
Prepare switching, accessing latest device
Looking for active default driver to detach it
No driver found. Device probably not initialized. Trying to continue ...
Setting up communication with device
No MessageContent given. Sending nothing
Back to top
View user's profile Send private message
PCNetSpec
LXF regular


Joined: Sun Feb 21, 2010 3:50 pm
Posts: 631
Location: Cornwall UK

PostPosted: Tue Mar 08, 2011 7:57 pm    Post subject: Reply with quote

Did you use a lower case "m" in -M ?
-M sends "A bulk message to send as a switching command. Provided as a hexadecimal string"
See:
Code:
man usb_modeswitch


It MUST be an upper case -M, -m is a completely different option.

remember, Linux IS case sensitive.

Or try this as the /etc/usb-modeswitch.conf entry:

DefaultVendor= 0x12d1
DefaultProduct=0x1521

TargetVendor= 0x12d1
TargetProduct= 0x1464

CheckSuccess=20

MessageContent="55534243123456780000000000000011060000000000000000000000000000"


Then run:
Code:
usb_modeswitch

(you may need to run this as root)
_________________
WARNING: You are logged into reality as 'root'... logging in as 'insane' is the only safe option.
Linux in the UK
The Linux Community Forum
Back to top
View user's profile Send private message
johnbywr



Joined: Wed Feb 02, 2011 2:21 pm
Posts: 12

PostPosted: Wed Mar 09, 2011 9:36 am    Post subject: K4505 dongle Reply with quote

Hi I did use lower case, but have now altered the config file as follows:
DefaultVendor= 0x12d1
DefaultProduct= 0x1521

TargetVendor= 0x12d1
TargetProduct= 0x1464

Messagecontent="555342431234567800000000000000110600000000000000000000000000000"

Huaweimode= 1
Checksuccess= 20
and this is the result:


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

Looking for target devices
No target device found
Looking for default devices
Found default devices (1)
Prepare switching, accessing latest device
Looking for active default driver to detach it
OK, driver found ("dummy")
OK, Driver "dummy" successfully detached
Setting up communication with device
No MessageContent given. Sending nothing

Also the dongle would not work with VMC in Windows, and I had to get help to set it up as a network connection. I don't know if that will have a bearing on the situation? Although I now think that it might?
Back to top
View user's profile Send private message
PCNetSpec
LXF regular


Joined: Sun Feb 21, 2010 3:50 pm
Posts: 631
Location: Cornwall UK

PostPosted: Wed Mar 09, 2011 3:00 pm    Post subject: Reply with quote

You've got one too many zeros at the end of you MessageContent line.

and a lower case C.

It should be:
MessageContent="55534243123456780000000000000011060000000000000000000000000000"
NOT
Messagecontent="555342431234567800000000000000110600000000000000000000000000000"
_________________
WARNING: You are logged into reality as 'root'... logging in as 'insane' is the only safe option.
Linux in the UK
The Linux Community Forum
Back to top
View user's profile Send private message
johnbywr



Joined: Wed Feb 02, 2011 2:21 pm
Posts: 12

PostPosted: Wed Mar 09, 2011 6:59 pm    Post subject: K4505 dongle Reply with quote

Hi
I am on my laptop at present, which has Sabayon on, the K4505 dongle works without any problems on that setup.

So I must learn to count again, if I have added an extra nought.
I will probably have a go, over the weekend, to sort my desktop computer out?
Thanks for all your help PcNetSpec, it has been most appreciated.
As a matter of interest, is the number a generated one?
johnbywr
Back to top
View user's profile Send private message
PCNetSpec
LXF regular


Joined: Sun Feb 21, 2010 3:50 pm
Posts: 631
Location: Cornwall UK

PostPosted: Wed Mar 09, 2011 8:27 pm    Post subject: Reply with quote

[EDIT]
See my next posting first.
[END EDIT]

Apparently the MessageContent line I gave you was probably wrong... so much for Google eh!... see below.

This site explains where the MessageContent line comes from:
http://blogger.ziesemer.com/2008/10/alltel-um175al-usb-evdo-ubuntu.html
and how to use usbsnoop 2.0 in WinXP to "sniff" out the correct line.

More info about sniffing (and other stuff related to usb_modeswitch can be found here:
http://www.draisberghof.de/usb_modeswitch/bb/viewtopic.php?p=695#695
and
http://www.draisberghof.de/usb_modeswitch/bb/viewtopic.php?p=1148&sid=47685368bf9018d8c73c2e748975e204

But really you need to read the usb_modeswitch homwpage:
http://www.draisberghof.de/usb_modeswitch/
The K4505 is listed as "working" with usb_modeswitch

As long as you have usb_modeswitch 1.1.4 or later, follow these instructions:

1) Remove the edits you made to /etc/usb_modeswitch.conf

2) Make sure you have libusb installed on your system. In most distributions there is most likely a package named "libusb-dev" or "libusb-devel". Choose the legacy version (0.1.12) or the "compatible" package from libusb-1.0; last time I checked it had the version number 0.1.14.

3) Download this file, and place it in your Home folder:
http://www.draisberghof.de/usb_modeswitch/usb-modeswitch-data-20110227.tar.bz2

4) Open a terminal and enter the following 3 commands:
Code:
tar -xjvf usb-modeswitch-data-20110227.tar.bz2
cd usb-modeswitch-data-20110227
make install

(the last command will need to be run as root)

Your K4505 *should* now "just work", without the need for any commands.

Just in case you are interested, now that you've installed the data files... if you look in /usr/share/usb_modeswitch/12d1:1521 you will find it reads:

########################################################
# Huawei K4505

DefaultVendor= 0x12d1
DefaultProduct=0x1521

TargetVendor= 0x12d1
TargetProduct= 0x1464

CheckSuccess=20

MessageContent="55534243123456780000000000000011062000000100000000000000000000"


OR you could just run the command:
Code:
usb_modeswitch -v 0x12d1 -p 0x1521 -M 55534243123456780000000000000011062000000100000000000000000000

every time you want to switch your dongle from ZerCD to Modem.
_________________
WARNING: You are logged into reality as 'root'... logging in as 'insane' is the only safe option.
Linux in the UK
The Linux Community Forum


Last edited by PCNetSpec on Wed Mar 09, 2011 9:10 pm; edited 1 time in total
Back to top
View user's profile Send private message
PCNetSpec
LXF regular


Joined: Sun Feb 21, 2010 3:50 pm
Posts: 631
Location: Cornwall UK

PostPosted: Wed Mar 09, 2011 9:08 pm    Post subject: Reply with quote

New (slightly) confusing info...

The 12d1:1521 file as installed by Ubuntu's package manager.

is installed to /etc/usb_modeswitch.d/12d1:1521
and NOT
/usr/share/usb_modeswitch/12d1:1521
and reads slightly differently:

########################################################
# Huawei K4505

DefaultVendor= 0x12d1
DefaultProduct=0x1521

TargetVendor= 0x12d1
TargetProduct= 0x1464

CheckSuccess=20

# Standard profile
MessageContent="55534243123456780000000000000011060000000000000000000000000000"

# CDC ether profile
;MessageContent="55534243450100000002000080000611062000000100000000000000000000"
;NoDriverLoading=1


though the second profile is commented out.

I'd think it would be a good idea to see which of these configurations works before continuing with the above posting:

edit /etc/usb_modeswitch.conf to read:

DefaultVendor= 0x12d1
DefaultProduct=0x1521

TargetVendor= 0x12d1
TargetProduct= 0x1464

CheckSuccess=20

MessageContent="55534243123456780000000000000011060000000000000000000000000000"


then run:
Code:
usb_modeswitch

(as root)

and if that doesn't work, try editing it again to read:

DefaultVendor= 0x12d1
DefaultProduct=0x1521

TargetVendor= 0x12d1
TargetProduct= 0x1464

CheckSuccess=20

MessageContent="55534243450100000002000080000611062000000100000000000000000000"
NoDriverLoading=1


and again try running:
Code:
usb_modeswitch

(as root)

to try find out which are the correct settings for your dongle.
_________________
WARNING: You are logged into reality as 'root'... logging in as 'insane' is the only safe option.
Linux in the UK
The Linux Community Forum
Back to top
View user's profile Send private message
johnbywr



Joined: Wed Feb 02, 2011 2:21 pm
Posts: 12

PostPosted: Sun Mar 13, 2011 1:10 pm    Post subject: K4505 dongle Reply with quote

Hi PCNetSpec

I have got the usb_modswitch working, by putting in end message. However, although the lsusb shows the change. There is no /dev/ttyUSB* at all. So when I try wvdial, the error is no such file? I have to use wvdial as root, because if I try as me, I get the same error.

The message says to look in /proc/bus/usb/devices, but there is no devices. Also not in /dev/tty*. Have you any suggestions that may help?

Johnbywr
Back to top
View user's profile Send private message
PCNetSpec
LXF regular


Joined: Sun Feb 21, 2010 3:50 pm
Posts: 631
Location: Cornwall UK

PostPosted: Sun Mar 13, 2011 5:34 pm    Post subject: Reply with quote

Try...
Code:
modprobe usbserial vendor=0x12d1 product=0x1464

then
Code:
ls /dev/ttyUSB*

and see if there is any output, similar to
Quote:
/dev/ttyUSB0 /dev/ttyUSB1 /dev/ttyUSB2 /dev/ttyUSB3


If there is anything returned, try using the "option" driver rather than generic serial driver...

Code:
sudo su
modprobe -v option
echo "12d1 1464" > /sys/bus/usb-serial/drivers/option1/new_id


Is this a Vodafone K4505 ?
_________________
WARNING: You are logged into reality as 'root'... logging in as 'insane' is the only safe option.
Linux in the UK
The Linux Community Forum
Back to top
View user's profile Send private message
johnbywr



Joined: Wed Feb 02, 2011 2:21 pm
Posts: 12

PostPosted: Sun Mar 13, 2011 6:46 pm    Post subject: K4505 dongle Reply with quote

Hi PCNetSpec

I decided to give 11.2 best, and have installed suse 11.3. Which reconized the dongle and at least I am on the net. Although i do not like 11.3 as much as 11.2. I will live with it for now.
Thanks for all your help. At least I have something more.

johnbywr
Back to top
View user's profile Send private message
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    Linux Format forums Forum Index -> Hardware All times are GMT
Page 1 of 1

 
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 vote in polls in this forum
Linux Format forums topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group


Copyright 2011 Future Publishing, all rights reserved.


Web hosting by UKFast