Automatic Activation, Hotplug and UDEV, Configuration
Post Reply
dipr
Posts: 14
Joined: 19 Feb 2016, 17:40

E3131 modeswitching options for multiple device modes

Post by dipr » 23 Apr 2017, 11:05

As I might have bricked my old E3131, I've got me a new one yesterday. New stick, new behaviour!
Apparently this is the HiLink version, although on the PCB it, too, reads 3131h-2.
I sampled all modswitch lines I could find on the net and tried them out.

tested:

Code: Select all

VedorId is of course 12d1 Huawei, Device Id unswitched is 0x1f01.
This is what one get, depending on modswitch message contents:

1f01 -> 1442   2 tty                   55534243000000000000000000000611060000000000000000000000000000
1f01 -> 1442   2 tty                   55534243123456780000000000000011060000000100000000000000000000
 
1f01 -> 14dc   rndis cdc_ether         55534243123456780000000000000011060000000000000100000000000000 
1f01 -> 14dc   rndis cdc_ether         55534243123456780000000000000011061000000000000100000000000000 
1f01 -> 14dc   rndis cdc_ether         55534243123456780000000000000011062000000000000100000000000000  my pick for rndis
1f01 -> 14dc   rndis cdc_ether         55534243123456780000000000000a11062000000000000100000000000000
1f01 -> 14dc   rndis cdc_ether         55534243123456780000000000000611062000000000000100000000000000
1f01 -> 14dc   rndis cdc_ether         55534243123456780000000000000011062000000100000100000000000000  
1f01 -> 14dc   rndis cdc_ether         55534243123456780000000000000011062000000101000100000000000000 "huawei new"


1f01 -> 1001   modem  3 tty            55534243123456780000000000000011062000000100000000000000000000 my pick for modem
1f01 -> 1001   modem  3 tty            55534243000000000000000000000611062000000000000000000000000000
1f01 -> 1001   modem  3 ttx            55534243123456780000000000000011062000000000000200000000000000

1f01 -> 1f01   1 tty! whatsthat?       55534243123456780000000000000011060000000000000200000000000000
1f01 -> 1f01   1 tty! whatsthat?       55534243123456780000000000000011062000000000000300000000000000
1f01 -> 1f01   1 tty! whatsthat?       55534243123456780000000000000601000000000000000000000000000000 "option1"
My conclusions:
The initial 55534243 is the mandatory prefix for modeswitch messages
the stuff from after 55534243 to before 1106 is irrelevant. (leading 12345678 or all zeroes, trailing "a" or "6" has no effect)

The fun starts at 1106, apparently the header of true switch message.
14dc rndis behaviour is activated by the 1 in the middle of the message (a.k.a. rndis-1)
1001 modem tty behaviour is activated by absence of rndis-1 and header reading 11062
1442 diag mode(?) is activated by absence of rndis-1 and header reading 11060
1f01 weird mode (single tty) is activated by the last two examples

Is there somewhere other than inside a Huaweis's engineers secret drawer a documentation of the effect of the mesage bits?

Apparently Huawei card can be switched to a multitude of "switched personalities", am I correct?

Testing the switched device:
lsusb; ls -l /dev/ttyUSB*; ifconfig -a (-a shows new, not yet actived rndis interfaces)

mind you, there are cases where one has to coerce the option1 kernel module to create the tty devices,
by writing the usb ids into /sys/bus/usb-serial/drivers/option1/new_id (thx usrus)
example: echo “12d1 1f01″ > /sys/bus/usb-serial/drivers/option1/new_id


Did I miss anything? What mode are the last two lines activating?
Which are the official messages? (and where is that fact documented)

bmork
Posts: 167
Joined: 15 Mar 2012, 22:47
Location: Oslo, Norway

Re: E3131 modeswitching options for multiple device modes

Post by bmork » 24 Apr 2017, 20:07

dipr wrote: My conclusions:
The initial 55534243 is the mandatory prefix for modeswitch messages
the stuff from after 55534243 to before 1106 is irrelevant. (leading 12345678 or all zeroes, trailing "a" or "6" has no effect)
See http://www.usb.org/developers/docs/devc ... ulk_10.pdf

Is there somewhere other than inside a Huaweis's engineers secret drawer a documentation of the effect of the mesage bits?
No. The requests are valid USB mass storage commands, but their meaning in a mode switching context is entirely up to the firmware designer.

dipr
Posts: 14
Joined: 19 Feb 2016, 17:40

Re: E3131 modeswitching options for multiple device modes

Post by dipr » 25 Apr 2017, 22:42

Actually I expected to learn that there is a "preferred", "more modern" modeswitch target (rndis "HiLink")
that usb_modeswitch opts for when called with -J

and at least the old modeswitch target of "ppp modem" .

For instance is it common consent that
55534243123456780000000000000011062000000100000000000000000000
is the typical switch to "ppp modem" message ?

rbuelund
Posts: 7
Joined: 29 Jun 2015, 15:31

Re: E3131 modeswitching options for multiple device modes

Post by rbuelund » 17 Oct 2020, 19:44

I tried to use the at "my pick for modem" - I can then get the stick to send SMS messages, but I cannot get it to recieve, when using gammu - any ideas ??

Post Reply