Activation Codes and Methods, Hardware Details, Sniffing
big_bum
Posts: 3
Joined: 24 Aug 2012, 14:05

[Solved]Vodafone K3772

Post by big_bum » 24 Aug 2012, 14:29

I've got yesterday an Vodafone K3772 USB 3G modem and i'm having trouble using it.

lsusb gives me 12d1:1526 Huawei Technologies Co., Ltd.

I used the information from here and managed to turn my USB modem into something like this: 12d1:14cf Huawei Technologies Co., Ltd. Nothing happened.

Then i tryed

Code: Select all


TargetVendor=   0x12d1
TargetProduct=  0x14ac

MessageContent="55534243123456780000000000000011060000000000000000000000000000"

From some forums and i got a 12d1:1c05 Huawei Technologies Co., Ltd. E173s 3G broadband stick (modem on). I tought that it's solved but not really. /dev/ shows nothing, gnome-ppp shows nothing, I see nothing. It doesn't work.

Has anybody tested Vodafone K3772 12d1:1526 and got it working?
Last edited by big_bum on 25 Aug 2012, 21:25, edited 1 time in total.

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

Post by Josh » 25 Aug 2012, 09:22

If you say "nothing happened", I assume you don't get any serial ports after the mode switch.

Can you revert back to your first setup and then enable usb_modeswitch's logging as described on the main doc page, paragraph "Troubleshooting"?


big_bum
Posts: 3
Joined: 24 Aug 2012, 14:05

Post by big_bum » 25 Aug 2012, 13:05

Yes, I'm saying I didn't get any serial ports in /dev by any of the switches.

Logging is enabled but for some reason I can't see the file in /var/log/.

I've switched the modem again, using the K3773 message string, adding the -W switch to the command. The result is:

Code: Select all

sudo usb_modeswitch -W -v 12d1 -p 1526 -n -M 555342437f0000000002000080000a11062000000000000100000000000000
Taking all parameters from the command line


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

 ! PLEASE REPORT NEW CONFIGURATIONS !

DefaultVendor=  0x12d1
DefaultProduct= 0x1526
TargetVendor=   not set
TargetProduct=  not set
TargetClass=    not set
TargetProductList=""

DetachStorageOnly=0
HuaweiMode=0
SierraMode=0
SonyMode=0
QisdaMode=0
GCTMode=0
KobilMode=0
SequansMode=0
MobileActionMode=0
CiscoMode=0
MessageEndpoint=  not set
MessageContent="555342437f0000000002000080000a11062000000000000100000000000000"
NeedResponse=1
ResponseEndpoint= not set

InquireDevice enabled (default)
Success check disabled
System integration mode disabled


Looking for default devices ...
  searching devices, found USB ID 04f2:b070
  searching devices, found USB ID 1d6b:0002
  searching devices, found USB ID 046d:c03e
  searching devices, found USB ID 1d6b:0001
  searching devices, found USB ID 12d1:1526
   found matching vendor ID
   found matching product ID
   adding device
  searching devices, found USB ID 0bda:8198
  searching devices, found USB ID 1d6b:0002
  searching devices, found USB ID 1d6b:0001
  searching devices, found USB ID 1d6b:0001
  searching devices, found USB ID 1d6b:0001
  searching devices, found USB ID 1d6b:0001
  searching devices, found USB ID 1d6b:0001
 Found device in default mode, class or configuration (1)
Accessing device 050 on bus 005 ...
Getting the current device configuration ...
 OK, got current device configuration (1)
Using first interface: 0x00
Using endpoints 0x01 (out) and 0x81 (in)
Inquiring device details; driver will be detached ...
Looking for active driver ...
 OK, driver found; name unknown, limitation of libusb1
 OK, driver "unkown" detached

SCSI inquiry data (for identification)
-------------------------
  Vendor String: Vodafone
   Model String: CD ROM (Huawei) 
Revision String: 2.31
-------------------------

USB description data (for identification)
-------------------------
Manufacturer: Vodafone (Huawei)
     Product: Vodafone Mobile Broadband (Huawei)
  Serial No.: not provided
-------------------------
Setting up communication with interface 0
Using endpoint 0x01 for message sending ...
Trying to send message 1 to endpoint 0x01 ...
 OK, message successfully sent
Reading the response to message 1 (CSW) ...
 Response reading got error -6
 Device is gone, skipping any further commands
-> Run lsusb to note any changes. Bye.
I don't know how to help anymore. Maybe a USBSnoop log from an XP box?
I've tried different strings from there but still no serial modem appears in /dev or gnome-ppp. The modem in XP is seen as in linux 12d1:14cf, so I think the switch in Linux is somehow made correctly?

Could it be a kernel related problem? Altough on a Linuxmint forum some guy managed to make it work. I've tried to contact him but no luck.

big_bum
Posts: 3
Joined: 24 Aug 2012, 14:05

Post by big_bum » 25 Aug 2012, 13:53

I managed to make it working.

Modem doesn't work with usbserial module but it does with option module.

As root, run these commands to make it working:

Code: Select all

usb_modeswitch -WD -v 12d1 -p 1526 -n -M 555342437f0000000002000080000a11062000000000000100000000000000 -I -w 500
modprobe option
echo "12d1 14cf" > /sys/bus/usb-serial/drivers/option1/new_id
After 2 seconds it will prompt for a PIN. Enter the PIN. (1234 by default)
Then create a new connection in Gnome/KDE/Xfce, etc,etc,etc.

I'll write an udev rule later, for automatically do the commands when the modem is plugged in the PC.

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

Post by Josh » 26 Aug 2012, 20:28

This should all happen automatically once you add your config file to /etc/usb_modeswitch.d and add a line in /lib/udev/rules.d/40-usb_modeswitch.rules for your ID.

I will add the device to the data package in the next release.


pvdg
Posts: 1
Joined: 07 Sep 2012, 16:55

Re: [Solved]Vodafone K3772

Post by pvdg » 07 Sep 2012, 17:52

Thank you both for this thread. I've also just bought a Vodafone K3772 and managed to make it work under Debian Squeeze (with the backported version of usb_modeswitch) using the code you provided. If it's not asking too much, could you post exactly what should go into /etc/usb_modeswitch.d and /lib/udev/rules.d/40-usb_modeswitch.rules to automate the process? If not, I'll RTFM and find out for myself.

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

Re: [Solved]Vodafone K3772

Post by Josh » 08 Sep 2012, 09:13

No problem, it's not very hard.

Create a file named "12d1:1526" in the folder "/etc/usb_modeswitch.d".

Edit it and fill it with this text:

Code: Select all

TargetVendor=  0x12d1
TargetProduct= 0x14bc

MessageContent="55534243123456780002000080000a11062000000000000100000000000000"
Now edit "/lib/udev/rules.d/40-usb_modeswitch.rules". Copy the line that contains "12d1" and "1520" (or any other line), paste/insert it somewhere else and change the second value from "1520" to "1526".

That's it.

gab
Posts: 3
Joined: 15 Sep 2012, 20:53

Re: [Solved]Vodafone K3772

Post by gab » 15 Sep 2012, 21:08

Hello everyone and thanks for all your great work!

I also just got a Vodafone K3772.

big_bum's solution from his last post, with the 3 root commands work very well for me.

But I can't seem to automate the process. Josh, the solution from your last post does not work at all for me. I've tried it on Ubuntu 10.04 and on 12.04 as well.

Some things that I've noticed:

* with the 3 root commands, the MessageContent is different from what you suggest for the file in /etc/usb_modeswitch.d:

Code: Select all

555342437f0000000002000080000a11062000000000000100000000000000
55534243123456780002000080000a11062000000000000100000000000000
* also the TargetProduct seems to be 14cf in big_bum's solution but it is 14bc in yours, Josh.

Anyhow, I've tried replacing one parameter by one and both at the same time with no success at all.

Do you have any idea why it's not working?

Was anyone able to get this to work?

gab
Posts: 3
Joined: 15 Sep 2012, 20:53

Re: [Solved]Vodafone K3772

Post by gab » 24 Sep 2012, 10:28

Anyone?

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

Re: [Solved]Vodafone K3772

Post by LOM » 24 Sep 2012, 11:21

Using the special modeswitch message for a Huawei Hi-Link K3773 on a K3772 may not be the right thing to do unless the K3772 also is a Hi-Link (direct ethernet interface) type of stick which I don't think it is.

Try the universal Huawei message instead:

usb_modeswitch -W -v 0x12d1 -p 0x1526 -M 55534243123456780000000000000011062000000100000000000000000000

then do a cat /proc/bus/usb/devices (or a lsusb -v) to see what switched id you got and what interfaces the stick has in switched mode.

Paste the output here from the cmd, both before and after switching

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

Re: [Solved]Vodafone K3772

Post by Josh » 24 Sep 2012, 11:50

gab wrote:* with the 3 root commands, the MessageContent is different from what you suggest for the file in /etc/usb_modeswitch.d:

Code: Select all

555342437f0000000002000080000a11062000000000000100000000000000
55534243123456780002000080000a11062000000000000100000000000000
Both are essentially the same. Byte 5-8 is a random tag as specified in the USB UFI documentation. To make that clear, I always insert 12345678.
If there is more than one MessageContents, this has to be altered though in order to provide a unique tag for every message.
gab wrote:* also the TargetProduct seems to be 14cf in big_bum's solution but it is 14bc in yours, Josh.
As LOM has said before, modem model names are not very telling. There may be provider-specific firmware on it, resulting in a different configuration.
gab wrote:Do you have any idea why it's not working? Was anyone able to get this to work?
Did you try to create a usb_modeswitch log?

gab
Posts: 3
Joined: 15 Sep 2012, 20:53

Re: [Solved]Vodafone K3772

Post by gab » 24 Sep 2012, 13:16

Thank you LOM and Josh for your replies!

Unfortunately I no longer have easy access to the device, so I don't know when I will be able to do any more testing.

Anyway, the the device is used on a computer that's always on, so automating the process is not really a priority in this case.

I will get back to you when I can get some more testing done.

Regards,
Gab

limbo
Posts: 2
Joined: 13 Dec 2012, 09:14

Re: [Solved]Vodafone K3772

Post by limbo » 19 Dec 2012, 21:31

Josh wrote:No problem, it's not very hard.

Create a file named "12d1:1526" in the folder "/etc/usb_modeswitch.d".

Edit it and fill it with this text:

Code: Select all

TargetVendor=  0x12d1
TargetProduct= 0x14bc

MessageContent="55534243123456780002000080000a11062000000000000100000000000000"
Now edit "/lib/udev/rules.d/40-usb_modeswitch.rules". Copy the line that contains "12d1" and "1520" (or any other line), paste/insert it somewhere else and change the second value from "1520" to "1526".

That's it.
Hi!

I'm having troubles to make K3772 work in fedora 17 (kernel 3.6.10, KDE 4.9.4)

I followed Josh "automatic" option, but does not seem to work in my case.
I see, after a while, the icon of the modem in NetworkManager, but it does fail connecting after I click on it.

If I run

Code: Select all

lsusb -v -d 12d1:14cf
I get the following:
lsusb_output.txt
(10.6 KiB) Downloaded 820 times

I also see errors when I run the following before modeswitch

Code: Select all

usb_modeswitch -W -v 0x12d1 -p 0x1526 -M 55534243123456780000000000000011062000000100000000000000000000
In that case I get:
usb_modeswitch_output.txt
(2.58 KiB) Downloaded 806 times
Any suggestion?

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

Re: [Solved]Vodafone K3772

Post by LOM » 20 Dec 2012, 05:33

limbo wrote:

Any suggestion?
usb_modeswitch has done its job and switched the device from 12d1:1526 to 12d1:14cf, the errors are not of importance.

The K3772 presents two different kind of interfaces when in modem mode, an interface for a traditional ppp serial connection on interface #0 and a composite device type (cdc_ncm) on interface #1.
The option.ko driver will attach to and make a ttyUSB0 device from interface #0 and that is what you have to use since
support for cdc_ncm on K3772 came after kernel 3.6.10

Make sure that the option driver and its companion usb_wwan has been loaded (lsmod) otherwise load them (insmod usb_wwan insmod option) and check that you get a /dev/ttyUSB0 device.
K3772 is recently supported in the option driver so make sure you have the latest version, the source should contain this line:

Code: Select all

	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x31) }, 

limbo
Posts: 2
Joined: 13 Dec 2012, 09:14

Re: [Solved]Vodafone K3772

Post by limbo » 03 Jan 2013, 18:54

LOM wrote:
limbo wrote:

Any suggestion?
usb_modeswitch has done its job and switched the device from 12d1:1526 to 12d1:14cf, the errors are not of importance.

The K3772 presents two different kind of interfaces when in modem mode, an interface for a traditional ppp serial connection on interface #0 and a composite device type (cdc_ncm) on interface #1.
The option.ko driver will attach to and make a ttyUSB0 device from interface #0 and that is what you have to use since
support for cdc_ncm on K3772 came after kernel 3.6.10

Make sure that the option driver and its companion usb_wwan has been loaded (lsmod) otherwise load them (insmod usb_wwan insmod option) and check that you get a /dev/ttyUSB0 device.
K3772 is recently supported in the option driver so make sure you have the latest version, the source should contain this line:

Code: Select all

	{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x31) }, 
Thank you LOM, and sorry for taking so long to react. I was away for a few days.

Actually, everything was working perfectly! both with the performance of usb_modeswitch and with fedora-17 kernel (modules and drivers). The problem was something quite simple, related to Vodafone-Spain. Apparently they MUST "activate" the SIM card before you can use it, and that must be done in a Vodafone shop, even if you buy the thing through the internet (as I did). I know this may sound stupid, but I post it to avoid other people wasting time with a similar thing.

Post Reply