Author Message

<  Setup Discussion  ~  Huawei E303 modes

PostPosted: Tue Nov 05, 2013 6:34 pm Reply with quote
Posts: 1Joined: Tue Nov 05, 2013 5:51 pm
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.


Offline Profile
PostPosted: Wed Nov 13, 2013 12:00 am Reply with quote
Site AdminPosts: 5787Joined: Sat Nov 03, 2007 12:30 am
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.


Offline Profile
PostPosted: Tue May 20, 2014 12:12 pm Reply with quote
Posts: 1Joined: Tue May 20, 2014 12:04 pm
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:
# Huawei E303 Fallback-Mode Modeswitch
ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1f01", RUN+="/bin/E303Modeswitch.sh"


/bin/E303Modeswitch.sh:

Code:
#! /bin/sh

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


Offline Profile
PostPosted: Tue May 20, 2014 12:38 pm Reply with quote
Posts: 899Location: Koh Samui, THJoined: Wed Jul 11, 2012 3:14 pm
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.


Offline Profile
PostPosted: Sun Jun 01, 2014 7:30 pm Reply with quote
Posts: 3Joined: Sat May 31, 2014 8:27 pm
On my E303 to go to fallback mode I had to use the following as the above didn't work for me

Code:
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.


Offline Profile
PostPosted: Sun Sep 07, 2014 12:38 pm Reply with quote
Posts: 3Joined: Sun Sep 07, 2014 12:34 pm
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)


Offline Profile
PostPosted: Sat Oct 18, 2014 3:52 pm Reply with quote
Posts: 2Joined: Sat Oct 18, 2014 11:00 am
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:
$ 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:
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:
$ 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:
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:
$ 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:
Bus 003 Device 096: ID 12d1:14dc Huawei Technologies Co., Ltd.


So, same thing as for the OP (duncannweb).

Switch to Fallback mode:
Code:
$ 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:
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:
$ 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?


Offline Profile
PostPosted: Sat Oct 18, 2014 4:43 pm Reply with quote
Posts: 899Location: Koh Samui, THJoined: Wed Jul 11, 2012 3:14 pm
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.


Offline Profile
PostPosted: Sun Oct 19, 2014 4:56 am Reply with quote
Posts: 2Joined: Sat Oct 18, 2014 11:00 am
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:
$ 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:
$ 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:
$ 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:
$ 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


Offline Profile
PostPosted: Sun Oct 19, 2014 5:37 am Reply with quote
Posts: 899Location: Koh Samui, THJoined: Wed Jul 11, 2012 3:14 pm
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.


Offline Profile
PostPosted: Thu Nov 13, 2014 1:00 am Reply with quote
Posts: 3Joined: Sun Sep 07, 2014 12:34 pm
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:
#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:
#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:
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 !


Offline Profile
PostPosted: Fri Nov 14, 2014 4:09 pm Reply with quote
Posts: 3Joined: Sun Sep 07, 2014 12:34 pm
I got the new E303s-2 working with the following modeswitch.

Code:
#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 .


Offline Profile
PostPosted: Thu Dec 11, 2014 12:17 am Reply with quote
Posts: 3Joined: Thu Dec 11, 2014 12:13 am
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"


Offline Profile
PostPosted: Thu Dec 11, 2014 5:59 pm Reply with quote
Posts: 4Joined: Wed Dec 10, 2014 1:52 pm
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?


Offline Profile
PostPosted: Thu Dec 11, 2014 6:18 pm Reply with quote
Posts: 3Joined: Thu Dec 11, 2014 12:13 am
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
viewtopic.php?f=4&t=1734&p=14104#p14104

Matej


Offline Profile

Display posts from previous:  Sort by:

All times are UTC + 1 hour [ DST ]
Page 1 of 2
26 posts
Go to page 1, 2  Next
Users browsing this forum: No registered users and 1 guest
Search for:
Post new topic  Reply to topic
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
cron