Activation Codes and Methods, Hardware Details, Sniffing
Post Reply
nexy_sm
Posts: 3
Joined: 25 Jul 2016, 10:50

unable switch mode for Huawei E3131s-2

Post by nexy_sm » 25 Jul 2016, 11:00

Hi all guys,

I am trying to switch mode to modem for my Huawei E3131s-2. In the file device_reference.txt I was not able to find anything concerning that one.

My rules for this one look loke this:

Code: Select all

SUBSYSTEMS=="usb", ATTRS{modalias}=="usb:v12D1p1506*", KERNEL=="ttyUSB*", ATTRS{bInterfaceNumber}=="00", SYMLINK+="ttyUSB_utps_modem"
SUBSYSTEMS=="usb", ATTRS{modalias}=="usb:v12D1p1506*", KERNEL=="ttyUSB*", ATTRS{bInterfaceNumber}=="01", SYMLINK+="ttyUSB_utps_diag"
SUBSYSTEMS=="usb", ATTRS{modalias}=="usb:v12D1p1506*", KERNEL=="ttyUSB*", ATTRS{bInterfaceNumber}=="02", SYMLINK+="ttyUSB_utps_pcui"
The first problem I am experiencing in the rules is that the last symlink is not created, i.e. ttyUSB_utps_pcui.

My mode_switch.conf file, after many tries looks like this:

Code: Select all

EnableLogging = 1
DefaultVendor=0x12d1
DefaultProduct=0x1506

TargetVendor=0x12d1
TargetProduct=0x14fe

MessageContent="55534243123456780000000000000011060000000000000000000000000000"
I would like if somebody could explain me, so that I can learn something.

Thanx,
nexy_sm

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

Re: unable switch mode for Huawei E3131s-2

Post by LOM » 25 Jul 2016, 11:20

nexy_sm wrote:Hi all guys,

I am trying to switch mode to modem for my Huawei E3131s-2. In the file device_reference.txt I was not able to find anything concerning that one.

My rules for this one look loke this:

Code: Select all

SUBSYSTEMS=="usb", ATTRS{modalias}=="usb:v12D1p1506*", KERNEL=="ttyUSB*", ATTRS{bInterfaceNumber}=="00", SYMLINK+="ttyUSB_utps_modem"
SUBSYSTEMS=="usb", ATTRS{modalias}=="usb:v12D1p1506*", KERNEL=="ttyUSB*", ATTRS{bInterfaceNumber}=="01", SYMLINK+="ttyUSB_utps_diag"
SUBSYSTEMS=="usb", ATTRS{modalias}=="usb:v12D1p1506*", KERNEL=="ttyUSB*", ATTRS{bInterfaceNumber}=="02", SYMLINK+="ttyUSB_utps_pcui"
The first problem I am experiencing in the rules is that the last symlink is not created, i.e. ttyUSB_utps_pcui.

My mode_switch.conf file, after many tries looks like this:

Code: Select all

EnableLogging = 1
DefaultVendor=0x12d1
DefaultProduct=0x1506

TargetVendor=0x12d1
TargetProduct=0x14fe

MessageContent="55534243123456780000000000000011060000000000000000000000000000"
I would like if somebody could explain me, so that I can learn something.

Thanx,
nexy_sm

You have swapped default and target id in your configuration, default is before switching and target is what we expect to switch it into.

The switch message you have used is also wrong, the correct one is:
55534243123456780000000000000011062000000101000100000000000000

If your pcui symlink isn't created then it is very likely that interface #02 is not a serial interface so the kernel device is not of ttyUSB type.

nexy_sm
Posts: 3
Joined: 25 Jul 2016, 10:50

Re: unable switch mode for Huawei E3131s-2

Post by nexy_sm » 25 Jul 2016, 12:23

LOM wrote: You have swapped default and target id in your configuration, default is before switching and target is what we expect to switch it into.

The switch message you have used is also wrong, the correct one is:
55534243123456780000000000000011062000000101000100000000000000

If your pcui symlink isn't created then it is very likely that interface #02 is not a serial interface so the kernel device is not of ttyUSB type.
I have swapped as you suggested but this is what I get:

Code: Select all

Looking for target devices ...
 Found devices in target mode or class (1)
Looking for default devices ...
 No devices in default mode found. Nothing to do. Bye.
P.S. The problem with rules is solved, it was wrong bInterfaceProtocol value ....

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

Re: unable switch mode for Huawei E3131s-2

Post by LOM » 25 Jul 2016, 13:39

nexy_sm wrote:
I have swapped as you suggested but this is what I get:

Looking for target devices ...
Found devices in target mode or class (1)
Looking for default devices ...
No devices in default mode found. Nothing to do. Bye.

so the dongle was already switched before you ran that cmd.
Pull it out and re-insert it, then check with lsusb if it is 12d1:14fe or 12d1:1506, if it is 1506 then you likely have usb_modeswitch configured by your linux distro to automatically switch as soon as the dongle is detected on the usb bus.
You can't switch it further when its usb id is 12d1:1506, it is ready for use then.

nexy_sm
Posts: 3
Joined: 25 Jul 2016, 10:50

Re: unable switch mode for Huawei E3131s-2

Post by nexy_sm » 25 Jul 2016, 13:54

LOM wrote: so the dongle was already switched before you ran that cmd.
Pull it out and re-insert it, then check with lsusb if it is 12d1:14fe or 12d1:1506, if it is 1506 then you likely have usb_modeswitch configured by your linux distro to automatically switch as soon as the dongle is detected on the usb bus.
You can't switch it further when its usb id is 12d1:1506, it is ready for use then.
I am not really able to reproduce what is going on, but sometimes, after soft reboot, or on power on, the device is not recognized with udev rules. That's why i want, in order to be sure, to call usb_modeswitch. usb_modeswitch is not configured for automatical mode changes, because I didn't install usb_modeswitch in a normal way, I have binary cros compiled for ARM architecture ...
Since I couldn't find any data, could this device use both 1506 and 14fe? Cause, when I run the usb_modeswitch with suggested parameters, the device ttyUSB0 dissapears.

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

Re: unable switch mode for Huawei E3131s-2

Post by LOM » 25 Jul 2016, 14:07

12d1:14fe is install mode aka default mode aka storage mode, there are no usable modem interfaces in that mode.
12d1:1506 is the modem mode for your device and the serial driver named option will bind to
a few of its interfaces and create the ttyUSB device nodes.
It can't fail if the dongle has been switched into 12d1:1506, check with lsusb which id you have when the ttyUSB device nodes fail to appear.

Post Reply