K4505 dongle

For discussing Linux compatible (or not) devices

Moderators: ChrisThornett, LXF moderators

K4505 dongle

Postby johnbywr » Tue Mar 08, 2011 3:54 pm

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?
johnbywr
 
Posts: 12
Joined: Wed Feb 02, 2011 2:21 pm

Postby PCNetSpec » Tue Mar 08, 2011 4:58 pm

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: Select all
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: Select all
usb_modeswitch -v 0x12d1 -p 0x1521 -M 55534243123456780000000000000011060000000000000000000000000000

(that command is all one line, with a space after -M)
Last edited by PCNetSpec on Tue Mar 08, 2011 7:59 pm, edited 1 time in total.
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
User avatar
PCNetSpec
LXF regular
 
Posts: 631
Joined: Sun Feb 21, 2010 3:50 pm
Location: Cornwall UK

Postby johnbywr » Tue Mar 08, 2011 6:09 pm

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.
johnbywr
 
Posts: 12
Joined: Wed Feb 02, 2011 2:21 pm

Postby johnbywr » Tue Mar 08, 2011 7:21 pm

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: Select all
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: Select all
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
johnbywr
 
Posts: 12
Joined: Wed Feb 02, 2011 2:21 pm

Postby PCNetSpec » Tue Mar 08, 2011 7:57 pm

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: Select all
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: Select all
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
User avatar
PCNetSpec
LXF regular
 
Posts: 631
Joined: Sun Feb 21, 2010 3:50 pm
Location: Cornwall UK

K4505 dongle

Postby johnbywr » Wed Mar 09, 2011 9:36 am

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?
johnbywr
 
Posts: 12
Joined: Wed Feb 02, 2011 2:21 pm

Postby PCNetSpec » Wed Mar 09, 2011 3:00 pm

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
User avatar
PCNetSpec
LXF regular
 
Posts: 631
Joined: Sun Feb 21, 2010 3:50 pm
Location: Cornwall UK

K4505 dongle

Postby johnbywr » Wed Mar 09, 2011 6:59 pm

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
johnbywr
 
Posts: 12
Joined: Wed Feb 02, 2011 2:21 pm

Postby PCNetSpec » Wed Mar 09, 2011 8:27 pm

[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/all ... buntu.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_modeswit ... ?p=695#695
and
http://www.draisberghof.de/usb_modeswit ... 748975e204

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_modeswit ... 27.tar.bz2

4) Open a terminal and enter the following 3 commands:
Code: Select all
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: Select all
usb_modeswitch -v 0x12d1 -p 0x1521 -M 55534243123456780000000000000011062000000100000000000000000000

every time you want to switch your dongle from ZerCD to Modem.
Last edited by PCNetSpec on Wed Mar 09, 2011 9:10 pm, edited 1 time in total.
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
User avatar
PCNetSpec
LXF regular
 
Posts: 631
Joined: Sun Feb 21, 2010 3:50 pm
Location: Cornwall UK

Postby PCNetSpec » Wed Mar 09, 2011 9:08 pm

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: Select all
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: Select all
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
User avatar
PCNetSpec
LXF regular
 
Posts: 631
Joined: Sun Feb 21, 2010 3:50 pm
Location: Cornwall UK

K4505 dongle

Postby johnbywr » Sun Mar 13, 2011 1:10 pm

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
johnbywr
 
Posts: 12
Joined: Wed Feb 02, 2011 2:21 pm

Postby PCNetSpec » Sun Mar 13, 2011 5:34 pm

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

then
Code: Select all
ls /dev/ttyUSB*

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


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

Code: Select all
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
User avatar
PCNetSpec
LXF regular
 
Posts: 631
Joined: Sun Feb 21, 2010 3:50 pm
Location: Cornwall UK

K4505 dongle

Postby johnbywr » Sun Mar 13, 2011 6:46 pm

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
johnbywr
 
Posts: 12
Joined: Wed Feb 02, 2011 2:21 pm


Return to Hardware

Who is online

Users browsing this forum: Exabot [Bot] and 0 guests