Automatic Activation, Hotplug and UDEV, Configuration
duncanwebb
Posts: 1
Joined: 05 Nov 2013, 17:51

Huawei E303 modes

Post by duncanwebb » 05 Nov 2013, 18:34

Hi

After spending a while trying to get the Huawei E303 to send a SMS I finally got this to work.

Plugging in the device showed the USB device: ID 12d1:1f01 Huawei Technologies Co., Ltd.

Running the command:
usb_modeswitch -v 0x12d1 -p 0x1f01 -V 0x12d1 -P 0x14dc -M "55534243123456780000000000000a11062000000000000100000000000000"
Created this device
ID 12d1:14dc Huawei Technologies Co., Ltd.
and dmesg shows:
eth1: register 'cdc_ether' at usb-0000:00:1a.0-1.3, CDC Ethernet Device, 58:2c:80:13:92:63
scsi13 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 12
so this created eth1 and /dev/sdc (the micro SD card)

Running the command:
usb_modeswitch -v 0x12d1 -p 0x1f01 -V 0x12d1 -P 0x14dc -M "55534243000000000000000000000011060000000000000000000000000000"
Created this device
ID 12d1:1001 Huawei Technologies Co., Ltd. E169/E620/E800 HSDPA Modem
and dmesg shows:
usb 1-1.3: Product: HUAWEI HiLink
usb 1-1.3: Manufacturer: HUAWEI
usb 1-1.3: configuration #1 chosen from 1 choice
option 1-1.3:1.0: GSM modem (1-port) converter detected
usb 1-1.3: GSM modem (1-port) converter now attached to ttyUSB0
option 1-1.3:1.1: GSM modem (1-port) converter detected
usb 1-1.3: GSM modem (1-port) converter now attached to ttyUSB1
option 1-1.3:1.2: GSM modem (1-port) converter detected
usb 1-1.3: GSM modem (1-port) converter now attached to ttyUSB2

Don't know if this is useful to anyone but SMStools3 now works for sending message.

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

Re: Huawei E303 modes

Post by Josh » 13 Nov 2013, 00:00

This is the 'fall-back' mode of several (but not all) more recent Huawei modems. It gives you the standard PPP interfaces as opposed to the faster - but proprietary - HiLink mode. So if you choose compatibility over speed, you are better off with your solution.

monkinsane
Posts: 1
Joined: 20 May 2014, 12:04

Re: Huawei E303 modes

Post by monkinsane » 20 May 2014, 12:12

Thanx for this!

Just FYI - if you install usb-modeswitch with it's data packages - the rules auto-switch the device into the "wrong" mode if you are looking to use fallback-mode.

If you want to use the ttyUSB* devices, DO NOT install the data package just the app. then use the info here to switch to the fallback mode. (I've spent hours today trying to figure out why the hell I could switch to fallback mode yesterday, and then not after a reboot. Turns out that - with the data package installed (which gets installed by default if you install via emerge on gentoo) udev auto-switches the device out of default mode to hilink mode the moment the device is picked up)

You can automate the switch in a similar manner via udev by creating a file under /etc/udev/rules.d/

Example:

/etc/udev/rules.d/ 40-E303Switch.rules

Code: Select all

# Huawei E303 Fallback-Mode Modeswitch
ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1f01", RUN+="/bin/E303Modeswitch.sh"
/bin/E303Modeswitch.sh:

Code: Select all

#! /bin/sh

usb_modeswitch -v 0x12d1 -p 0x1f01 -V 0x12d1 -P 0x14dc -M "55534243000000000000000000000011060000000000000000000000000000"

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

Re: Huawei E303 modes

Post by LOM » 20 May 2014, 12:38

monkinsane wrote: If you want to use the ttyUSB* devices, DO NOT install the data package just the app.
Why? There is nothing prohibiting you from editing the 12d1:1f01 file in the data package and change the switch message instead of making a whole new file and a new the udev rule.

piashaw
Posts: 3
Joined: 31 May 2014, 20:27

Re: Huawei E303 modes

Post by piashaw » 01 Jun 2014, 19:30

On my E303 to go to fallback mode I had to use the following as the above didn't work for me

Code: Select all

sudo usb_modeswitch -v 0x12d1 -p 0x1f01 -n -I -M 55534243123456780000000000000011060000000000000000000000000000
without the -n -I, mine wouldn't switch form 1f01. I needed it to become 12d1:1001 to work as a serial PPP rather than ethernet.

bartdereu
Posts: 3
Joined: 07 Sep 2014, 12:34

Re: Huawei E303 modes

Post by bartdereu » 07 Sep 2014, 12:38

I've been trying for days to get this dongle going on the arduino Yun

i've reset the Yun more then once , and once i got the 12d1:1f01 address but now it's always 12d1:14db

does that make a diffference to use the modeswitch ? (set to 14dc)

einheitlix
Posts: 2
Joined: 18 Oct 2014, 11:00

Re: Huawei E303 modes

Post by einheitlix » 18 Oct 2014, 15:52

I don't think it makes a difference. Different versions of the Huawei E303 seem to use different product IDs for the ethernet and fallback modes.

Specifically, I had a E303s-2 (HW version CH2E303SM) and now I have a E303h-1 (HW version CH1E3531SM). (You can see your exact model id inside the stick at the spot usually covered by the SIM card, and the HW version can be found out from the web interface)

The needed modeswitch commands differ slightly and so do the target product IDs.

For my old E303s-2:

Switch to Ethernet mode:

Code: Select all

$ sudo usb_modeswitch -v 0x12d1 -p 0x1f01 -V 0x12d1 -P 0x14dc -M "55534243123456780000000000000a11062000000000000100000000000000"
or
$ sudo usb_modeswitch -v 0x12d1 -p 0x1f01 -V 0x12d1 -P 0x14db -M "55534243123456780000000000000a11062000000000000100000000000000"
or
$ sudo usb_modeswitch -v 0x12d1 -p 0x1f01 -M "55534243123456780000000000000a11062000000000000100000000000000"
all worked equally, and in all cases lsusb would show

Code: Select all

Bus 003 Device 042: ID 12d1:14db Huawei Technologies Co., Ltd. 
(except for that device number 042 which is dynamic, of course)

Switch to Fallback mode:

Code: Select all

$ sudo usb_modeswitch -v 0x12d1 -p 0x1f01 -V 0x12d1 -P 0x14dc -M "55534243000000000000000000000011060000000000000000000000000000"
or
$ sudo usb_modeswitch -v 0x12d1 -p 0x1f01 -V 0x12d1 -P 0x14db -M "55534243000000000000000000000011060000000000000000000000000000"
or
$ sudo usb_modeswitch -v 0x12d1 -p 0x1f01 -V 0x12d1 -P 0x1001 -M "55534243000000000000000000000011060000000000000000000000000000"
or
$ sudo usb_modeswitch -v 0x12d1 -p 0x1f01 -M "55534243000000000000000000000011060000000000000000000000000000"
all worked equally, and in all cases lsusb would show

Code: Select all

Bus 003 Device 052: ID 12d1:1001 Huawei Technologies Co., Ltd. E169/E620/E800 HSDPA Modem
This looks like what you described, you may have that or a similar version.

For my new E303h-1:

Switch to Ethernet mode:

Code: Select all

$ sudo usb_modeswitch -v 0x12d1 -p 0x1f01 -V 0x12d1 -P 0x14dc -M "55534243123456780000000000000a11062000000000000100000000000000"
or
$ sudo usb_modeswitch -v 0x12d1 -p 0x1f01 -M "55534243123456780000000000000a11062000000000000100000000000000"
both work, and in both cases lsusb shows

Code: Select all

Bus 003 Device 096: ID 12d1:14dc Huawei Technologies Co., Ltd. 
So, same thing as for the OP (duncannweb).

Switch to Fallback mode:

Code: Select all

$ sudo usb_modeswitch -v 0x12d1 -p 0x1f01 -M "55534243000000000000000000000011060000000000000000000000000000"
or
$ sudo usb_modeswitch -v 0x12d1 -p 0x1f01 -V 0x12d1 -P 0x1442 -M "55534243000000000000000000000011060000000000000000000000000000"
work equally, and in both cases lsusb shows

Code: Select all

Bus 003 Device 100: ID 12d1:1442 Huawei Technologies Co., Ltd.
So, here the target product ID of the fallback mode differs fom the post of the OP and any other posts in this thread. If I give the wrong ID to usb_modeswitch (e.g., -P 0x1001), no mode switch occus.

But most importantly, with the new stick when trying to switch to fallback mode, dmesg's output looks completely different, and no /dev/ttyUSB* devices are created. So I cannot use the new stick as a broadband modem!

Code: Select all

$ dmesg
...
[46809.983849] usb 3-1: USB disconnect, device number 99
[46811.217156] usb 3-1: new high-speed USB device number 100 using xhci_hcd
[46811.234031] usb 3-1: New USB device found, idVendor=12d1, idProduct=1442
[46811.234038] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[46811.234042] usb 3-1: Product: HUAWEI Mobile
[46811.234045] usb 3-1: Manufacturer: HUAWEI
Can anyone explain this? How could I use my new stick as a broadband modem?

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

Re: Huawei E303 modes

Post by LOM » 18 Oct 2014, 16:43

What has been labelled "fall back" message in this thread is not a Huawei official switch message, it just happens to work in some firmwares.

55534243123456780000000000000011062000000101000100000000000000

is the standard switch message

while

55534243123456780000000000000011063000000100010000000000000000

is a Huawei official fall back switch msg switching any modern Huawei dongle into 12d1:1001.

einheitlix
Posts: 2
Joined: 18 Oct 2014, 11:00

Re: Huawei E303 modes

Post by einheitlix » 19 Oct 2014, 04:56

Thanks for your answer. I tried those switch messages and I can confirm they work. Using your help I can now switch to broadband modem mode! :)

So, on my E303h-1,
- 12d1:1f01 is the default (mass storage device) mode
- I can switch to 12d1:14dc ("ethernet" mode) using either 55534243123456780000000000000011062000000101000100000000000000 (standard) or 55534243123456780000000000000a11062000000000000100000000000000
- I can switch to 12d1:1001 (broadband modem mode) using 55534243123456780000000000000011063000000100010000000000000000
- I can switch to 12d1:1442 (???) using 55534243000000000000000000000011060000000000000000000000000000

What is this 12d1:1442? Is this just some kind of bug? I mean, apparently a modeswitch occurs with that message (product id changes), but I can't tell what it might be good for.

Code: Select all

$ sudo usb_modeswitch -v 0x12d1 -p 0x1f01 -M "55534243000000000000000000000011060000000000000000000000000000"
Look for default devices ...
   product ID matched
 Found devices in default mode (1)
Access device 029 on bus 003
Current configuration number is 1
Use interface number 0
Use endpoints 0x01 (out) and 0x81 (in)

USB description data (for identification)
-------------------------
Manufacturer: HUAWEI
     Product: HUAWEI Mobile
  Serial No.: FFFFFFFFFFFFFFFF
-------------------------
Looking for active driver ...
 OK, driver detached
Set up interface 0
Use endpoint 0x01 for message sending ...
Trying to send message 1 to endpoint 0x01 ...
 OK, message successfully sent
Reset response endpoint 0x81
Reset message endpoint 0x01
-> Run lsusb to note any changes. Bye!

Code: Select all

$ dmesg
...
[ 2761.031455] usb 3-1: USB disconnect, device number 29
[ 2762.363871] usb 3-1: new high-speed USB device number 30 using xhci_hcd
[ 2762.380710] usb 3-1: New USB device found, idVendor=12d1, idProduct=1442
[ 2762.380717] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 2762.380720] usb 3-1: Product: HUAWEI Mobile
[ 2762.380723] usb 3-1: Manufacturer: HUAWEI

Code: Select all

$ usb-devices
...
T:  Bus=03 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 30 Spd=480 MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=12d1 ProdID=1442 Rev=01.02
S:  Manufacturer=HUAWEI
S:  Product=HUAWEI Mobile
C:  #Ifs= 2 Cfg#= 1 Atr=80 MxPwr=500mA
I:  If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=03 Prot=00 Driver=(none)
I:  If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=03 Prot=00 Driver=(none)
...

Code: Select all

$ sudo lsusb -v -d 12d1:1442

Bus 003 Device 030: ID 12d1:1442 Huawei Technologies Co., Ltd. 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x12d1 Huawei Technologies Co., Ltd.
  idProduct          0x1442 
  bcdDevice            1.02
  iManufacturer           1 HUAWEI
  iProduct                2 HUAWEI Mobile
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           55
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      3 
      bInterfaceProtocol      0 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      3 
      bInterfaceProtocol      0 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  bNumConfigurations      1
Device Status:     0x0001
  Self Powered

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

Re: Huawei E303 modes

Post by LOM » 19 Oct 2014, 05:37

einheitlix wrote: - I can switch to 12d1:1442 (???) using 55534243000000000000000000000011060000000000000000000000000000

What is this 12d1:1442? Is this just some kind of bug? I mean, apparently a modeswitch occurs with that message (product id changes), but I can't tell what it might be good for.
You can probably find other msg's by inserting 1's in other positions but that is of no value and neither is the msg above. The reason why it is of no value is:

Doesn't behave same on different firmware version.
Is not acknowledge by Huawei and they are the only ones who knows its purpose.

Huawei has given us two different kind of messages which has been tested by them on all of their products and these two messages covers normal use scenarios. Any other switch msg which their firmware acts on are Huawei propritary msgs and there is no explanation about them.

bartdereu
Posts: 3
Joined: 07 Sep 2014, 12:34

Re: Huawei E303 modes

Post by bartdereu » 13 Nov 2014, 01:00

Thanx for all your answers;

I had been succesfull to do a modeswitch on a arduino Yun with a E303 Huawei dongle.

in the file /etc/usb_modeswitch.d/12d1:1f01 :

Code: Select all

#Huawei E303
DefaultVendor= 0x12d1
DefaultProduct= 0x1f01
TargetVendor= 0x12d1
RargetProduct= 0x1f01
MessageEndPoint = "0x01"
MessageContent="55534243000000000000000000000011060000000000000000000000000000"
NoDriverLoading=1
added a file /etc/usb_modeswitch.conf and edit with :

Code: Select all

#Huawei E303
DefaultVendor = 0x12d1
DefaultProduct = 0x1f01
I was glad that i finally got it working. But now i have 13 dongles E303 to be installed on Yun boards , and i can't get
them to work; They are the same , Huawei E303 but they dont work. The original switched to 12d1:1001 with the messagecontent
shown above. I tried the different messagecontents that are shown here in this topic but none of them work.. UUUHH!

Code: Select all

New USB device found, idVendor=12d1, idProduct=1442
Nov 12 22:37:19 Arduino kern.info kernel: [ 2874.560000] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Nov 12 22:37:19 Arduino kern.info kernel: [ 2874.560000] usb 1-1.1: Product: HUAWEI Mobile
Nov 12 22:37:19 Arduino kern.info kernel: [ 2874.560000] usb 1-1.1: Manufacturer: HUAWEI
Anyone can point me in the good direction ? thanx in advance !

bartdereu
Posts: 3
Joined: 07 Sep 2014, 12:34

Re: Huawei E303 modes

Post by bartdereu » 14 Nov 2014, 16:09

I got the new E303s-2 working with the following modeswitch.

Code: Select all

#Huawei E303s-2

DefaultVendor= 0x12d1
DefaultProduct= 0x1f01
TargetVendor= 0x12d1
TargetProduct= 0x1001
MessageEndPoint = "0x01"
MessageContent="55534243123456780000000000000011060000000000000000000000000000"
Finally !

Strangely enough i have E303h-2 dongle too and they don't work with these settings. :( i'll keep searching till i find a messagecontent that works
and i'll post it here so others can use it .

mkurent
Posts: 3
Joined: 11 Dec 2014, 00:13

Re: Huawei E303 modes

Post by mkurent » 11 Dec 2014, 00:17

I have a Huawei E303 and I am quite desperate to make it work in modem mode.

lsusb reports device as: ID 12d1:14db Huawei Technologies Co., Ltd.

But when I try to

sudo usb_modeswitch -v 12d1 -p 14db -M "55534243000000000000000000000011060000000000000000000000000000"

I got the following reply:

Looking for default devices ...
found matching product ID
adding device
Found device in default mode, class or configuration (1)
Accessing device 005 on bus 001 ...
Getting the current device configuration ...
OK, got current device configuration (1)
Using first interface: 0x00
Error: message endpoint not given or found. Aborting.

How should I proceed? I did not find an resolution when you get "message endpoint not given"

melanoma69
Posts: 4
Joined: 10 Dec 2014, 13:52

Re: Huawei E303 modes

Post by melanoma69 » 11 Dec 2014, 17:59

I´m desesperate too. I tried all usb_modeswith -v -p ......... I found and no one helps me. I´m not sure which is the modem mode 1001? 1442?

mkurent
Posts: 3
Joined: 11 Dec 2014, 00:13

Re: Huawei E303 modes

Post by mkurent » 11 Dec 2014, 18:18

I have managed to make it run. What I did is the following:

In folder /usr/share/usb_modeswitch you should have the vendor:product pairs for many devices.

I have copied file 12d1:1f01 to /etc/usb_modeswitch.d

and edited file as follows:

# Huawei E353 (3.se)

TargetVendor= 0x12d1
TargetProduct= 0x1001

MessageContent="55534243123456780000000000000011063000000100010000000000000000"
NoDriverLoading=0

Rebooted Raspberry PI and now modem shows correctly as ttyUSB0/1/2.

Hope this helps.

I have followed the setup logic found here:
http://www.draisberghof.de/usb_modeswitch/#trouble
and here
http://www.draisberghof.de/usb_modeswit ... 104#p14104

Matej

Post Reply