Activation Codes and Methods, Hardware Details, Sniffing
Post Reply
fedcer
Posts: 2
Joined: 28 Nov 2010, 20:02

Huawei E173s working config

Post by fedcer » 28 Nov 2010, 20:27

Hello, I have a Huawei E173s modem which isn't supported (not to be confused with model E173). Following the documentation's suggestions I finally got it working. I don't know if this is the correct place but since I found no other I'll post the working config here hoping you may add it to a future release of the device database.

Code: Select all

########################################################
# Huawei E173s

DefaultVendor=  0x12d1
DefaultProduct= 0x1c0b

TargetVendor=  0x12d1
TargetProduct= 0x1c05

CheckSuccess=20

MessageEndpoint= 0x0f
MessageContent= "55534243000000000000000000000011060000000100000000000000000000"

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

Post by Josh » 28 Nov 2010, 22:36

Thanks! This is indeed the right place for that report!

However, a Huawei engineer approached me and requested to change all Huawei devices to the following MessageContent:
"55534243123456780000000000000011062000000100000000000000000000"

Could you check if that will work too in your config?

And if you want, give me your real name (via PM or mail) and I'll include you in the device reference as contributor.


pmg43
Posts: 4
Joined: 29 Nov 2010, 22:37

Post by pmg43 » 29 Nov 2010, 23:15

How can you tell you have a Huawei E173s? I have one that on the rare side says "E173", but it's recognized as:

DefaultVendor= 0x12d1
DefaultProduct= 0x1c0b

And I do not know how, but playing with usb_modeswitch i saw it switch to these once:

TargetVendor= 0x12d1
TargetProduct= 0x1c05

So, maybe I have a E173s?

I think I got it to switch because after running the comand with your config:

Code: Select all

[pablo:usb_modeswitch.d]$ lsusb | grep Huawei
Bus 001 Device 003: ID 12d1:1c0b Huawei Technologies Co., Ltd. 

[pablo:usb_modeswitch.d]$ 
[pablo:usb_modeswitch.d]$ sudo usb_modeswitch -c 12d1:1c0b

Looking for target devices ...
 No devices in target mode or class found
Looking for default devices ...
 Found devices in default mode or class (1)
Accessing device 003 on bus 001 ...
Using endpoints 0x0f (out) and 0x8f (in)
Using endpoints 0x0f (out) and 0x8f (in)
Inquiring device details; driver will be detached ...
Looking for active driver ...
 No driver found. Either detached before or never attached

SCSI inquiry data (for identification)
-------------------------
  Vendor String: HUAWEI  
   Model String: Mass Storage    
Revision String: 2.31
-------------------------

USB description data (for identification)
-------------------------
Manufacturer: HUAWEI
     Product: HUAWEI Mobile
  Serial No.: not provided
-------------------------
Setting up communication with interface 0 ...
Using endpoint 0x0f for message sending ...
Trying to send message 1 to endpoint 0x0f ...
 OK, message successfully sent
Resetting response endpoint 0x8f
Resetting message endpoint 0x0f
 Error resetting endpoint: -71
 Device is gone, skipping any further commands

Checking for mode switch (max. 20 times, once per second) ...
 Original device is gone already, not checking
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Found correct target device

Mode switch succeeded. Bye.

[pablo:usb_modeswitch.d]$ lsusb | grep Huawei
Bus 001 Device 004: ID 12d1:1c05 Huawei Technologies Co., Ltd. 
But my Fedora 13 box still does not recognize the modem, I use NetworkManager to control WiFi and Mobile Broadband. Any clue what could be wrong?

If somebody could confirm that the usb modeswitch worked, then this might be a question for another forum. Can someone confirm?

Thanks.

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

Post by Josh » 29 Nov 2010, 23:52

You probably switched all right, but the modem driver does not know your device yet.

If you set up a file named "/etc/usb_modeswitch.d/12d1:1c0b" with similar content like in the first post here but with your values inserted, you can automatize your switching and get the driver bound to your device (also automatically).

In addition to the config file, you need to add a line to "/lib/udev/rules.d/40-usb_modeswitch.rules" with the default ID of our device. It's really not hard, have look at the other lines and you'll get the idea.


pmg43
Posts: 4
Joined: 29 Nov 2010, 22:37

Post by pmg43 » 30 Nov 2010, 00:07

Thanks dude. That did it right away!!!! MAGIC!!!!

1) create file /etc/usb_modeswitch.d/12d1:1c0b:
########################################################
# Huawei E173s

DefaultVendor= 0x12d1
DefaultProduct= 0x1c0b

TargetVendor= 0x12d1
TargetProduct= 0x1c05

CheckSuccess=20

MessageEndpoint= 0x0f
MessageContent= "55534243123456780000000000000011062000000100000000000000000000"
--------------------------------------------------------
2) add corresponding lines to /lib/udev/rules.d/40-usb_modeswitch.rules
Huawei E173s
ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1c0b", RUN+="usb_modeswitch '%b/%k'"

fedcer
Posts: 2
Joined: 28 Nov 2010, 20:02

Post by fedcer » 30 Nov 2010, 01:07

Josh wrote: However, a Huawei engineer approached me and requested to change all Huawei devices to the following MessageContent:
"55534243123456780000000000000011062000000100000000000000000000"

Could you check if that will work too in your config?
Tested with that ContentMessage and works fine too.
pmg43 wrote: How can you tell you have a Huawei E173s? I have one that on the rare side says "E173", but it's recognized as:

DefaultVendor= 0x12d1
DefaultProduct= 0x1c0b
Well, actually mine also says E173 on the outside, even though its product id doesn't match other E173. However if you open the lid (where you insert the SIM card) there is some info printed such as serial number, etc, and there model reads E173s, so I guess that's its correct number.

pmg43
Posts: 4
Joined: 29 Nov 2010, 22:37

Post by pmg43 » 30 Nov 2010, 03:41

You are right, inside it says E173s-6.
Strange, I tested this 2 hours ago and NM detected the device. I had to run so closed the PC on a rush, now that I got back to double check on it, I can no longer see the modem on NM. The Huawei is switched to what I wanted it to be, but nothing:

Code: Select all

[pablo:~]$ lsusb | grep Huawei
Bus 001 Device 010: ID 12d1:1c05 Huawei Technologies Co., Ltd. 
If I unplug and plug back, the huawei device appears as 12d1:1c05, and listed as a CD Rom on nautilus.

Do you see the same behaviour? Do you need to umount the CD for it to work? I will continue to investigate this.... it was working a while ago!

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

Post by Josh » 30 Nov 2010, 09:47

Regarding model names: don't rely on them too much with Huawei devices. The USB ID is what really matters.

Some new models have two target modes actually. With the changed MessageContent, they get the modem interface as well but in addition there is a "cdc_ether" interface which they will probably support with their own Linux driver adapted from the one in the kernel.

I assume this is a preparation for coming 4G standards like LTE where the serial connection will reach its speed limit.

pmg43, you may be running into a problem with Network Manager. To check if usb_modeswitch did its job, run "dmesg" after replugging and waiting for a while (some Huawei devices need up to 15 seconds to come back as modem).
If you see some lines containing "ttyUSB" or "GSM" at the end of the output, your modem is ready to use.


pmg43
Posts: 4
Joined: 29 Nov 2010, 22:37

Post by pmg43 » 30 Nov 2010, 21:38

Yes, forget about my last post. I tested this again today and it worked right away. Thanks!

vobo
Posts: 1
Joined: 16 Feb 2011, 23:34
Location: Poland

Post by vobo » 16 Feb 2011, 23:41

I have a problem switching Huawei E173s-1 with usb_modeswitch 1.1.4 (on tomato router)
I'm using the following command:

Code: Select all

usb_modeswitch -v 0x12d1 -p 0x1c0b -V 0x12d1 -P 0x1c05 -s 20 -m
0x0f -M "55534243123456780000000000000011062000000100000000000000000000"
this is what I get:

Code: Select all

Looking for target devices ...
 No devices in target mode or class found
Looking for default devices ...
 Found devices in default mode or class (1)
Accessing device 010 on bus 001 ...
Using endpoints 0x0f (out) and 0x8f (in)
Using endpoints 0x0f (out) and 0x8f (in)
Inquiring device details; driver will be detached ...
Looking for active driver ...
 OK, driver found ("dummy")
 OK, driver "dummy" detached
endpoint f size 31 timeout 0endpoint 8f size 36 timeout 0endpoint 8f size 13 timeout 0
SCSI inquiry data (for identification)
-------------------------
  Vendor String: HUAWEI
   Model String: Mass Storage
Revision String: 2.31
-------------------------

USB description data (for identification)
-------------------------
Manufacturer: HUAWEI
     Product: HUAWEI Mobile
  Serial No.: not provided
-------------------------
Setting up communication with interface 0 ...
Using endpoint 0x0f for message sending ...
Trying to send message 1 to endpoint 0x0f ...
endpoint f size 31 timeout 100 OK, message successfully sent
Resetting response endpoint 0x8f
 Error resetting endpoint: -4
Resetting message endpoint 0x0f
 Error resetting endpoint: -4
 Device is gone, skipping any further commands

Checking for mode switch (max. 20 times, once per second) ...
 Original device is gone already, not checking
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 Searching for target devices ...
 No new devices in target mode or class found

Mode switch has failed. Bye.
Vendor should switch from 1c0b to 1c05 - but what I get is 1c08 ???
On ubuntu 10.10 it's the same problem - even when I compiled usb_modeswitch version 1.1.6.
Did anyone had some kind of problem? Any suggestions?

regards,

Maciek

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

Post by Josh » 17 Feb 2011, 22:09

I think the only quirk is that your hardware/firmware version shows a different target product ID. Switching obviously works fine.

How do you know that it should be "1c05" after switching? Did you try "-P 0x1c08" in your command line?

dap
Posts: 1
Joined: 24 Jul 2011, 19:44

Post by dap » 24 Jul 2011, 22:42

I spent this day to get this working under Fedora 15. I got model E173s-1 from T-Mobile Hungary.

The usb_modeswitch config above working well, but not from udev. WaitBefore=3 needed from udev, otherwise usb_modeswitch always fails with error -110 (syslog):

Code: Select all

Jul 24 22:04:00 daptop udevd-work[4009]: '/lib/udev/usb_modeswitch' (stderr) 'Error: getting the current configuration failed (error -110). Aborting.'
Jul 24 22:04:00 daptop udevd-work[4009]: 'usb_modeswitch '/1-4:1.0'' returned with exitcode 1
If '/lib/udev/usb_modeswitch' fails due to error -110, the 'option' driver won't be loaded. If the driver not loaded, the udev can't do '--driver-bind' on plug-in, so a manual usb_modeswitch later isn't enough to get this stick working, cause the 'option' driver doesn't know this productID by default.

WaitBefore=2 isn't enough, only causes different error:

Code: Select all

USB_ModeSwitch log from Sun Jul 24 21:58:19 CEST 2011
[...]
----------------
USB values from sysfs:
  manufacturer  HUAWEI
  product       HUAWEI Mobile
  serial        
----------------
SCSI attributes not needed, moving on
checking config: /etc/usb_modeswitch.d/12d1:1c0b
config: WaitBefore set to 2
! matched, waiting time set to 2 seconds
 waiting is over, switching starts now
 (running command: /usr/sbin/usb_modeswitch -I -W -c /etc/usb_modeswitch.d/12d1:1c0b)

Verbose debug output of usb_modeswitch and libusb follows
(Note that some USB errors are expected in the process)
--------------------------------
[...]
Looking for active driver ...
 OK, driver found ("dummy")
 OK, driver "dummy" detached
Setting up communication with interface 0 ...
Using endpoint 0x0f for message sending ...
Trying to send message 1 to endpoint 0x0f ...
 OK, message successfully sent
Resetting response endpoint 0x8f
Resetting message endpoint 0x0f

Checking for mode switch (max. 20 times, once per second) ...
 Waiting for original device to vanish ...
[...]

 Original device still present after the timeout <<<---- ERROR

Mode switch most likely failed. Bye.

fail:
--------------------------------
(end of usb_modeswitch output)
But WaitBefore=3 is always perfect:

Code: Select all

[...]
config: WaitBefore set to 3
! matched, waiting time set to 3 seconds
 waiting is over, switching starts now
 (running command: /usr/sbin/usb_modeswitch -I -W -c /etc/usb_modeswitch.d/12d1:1c0b)
[...]

Looking for active driver ...
 OK, driver found ("dummy")
 OK, driver "dummy" detached
Setting up communication with interface 0 ...
Using endpoint 0x0f for message sending ...
Trying to send message 1 to endpoint 0x0f ...
 OK, message successfully sent
Resetting response endpoint 0x8f
Resetting message endpoint 0x0f
 Error resetting endpoint: -6
 Device is gone, skipping any further commands

Checking for mode switch (max. 20 times, once per second) ...
 Searching for target devices ...
  searching devices, found USB ID 1d6b:0002
[...]

Found target device, now opening

Found target device 110 on bus 001

Target device description data
-------------------------
Manufacturer: HUAWEI
     Product: HUAWEI Mobile
  Serial No.: not provided
-------------------------
 Found correct target device

Mode switch succeeded. Bye.

ok:12d1:1c05
--------------------------------
(end of usb_modeswitch output)
So if E173s-1 doesn't work out-of-box, try:

Code: Select all

echo WaitBefore=3 >>/etc/usb_modeswitch.d/12d1:1c0b
I have full logs too if someone interested in (udev debug output from syslog, usb_modeswitch logs with EnableLogging=1).

Modem response to ATI command:
Manufacturer: huawei
Model: E173
Revision: 21.017.07.00.78
IMEI: xxxxx
+GCAP: +CGSM,+DS,+ES

lsusb -v after successful modeswitch:

Code: Select all

Bus 001 Device 112: ID 12d1:1c05 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          0x1c05 
  bcdDevice            1.02
  iManufacturer           2 HUAWEI
  iProduct                1 HUAWEI Mobile
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength          131
    bNumInterfaces          5
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x8f  EP 15 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               5
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x8e  EP 14 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval              32
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x0f  EP 15 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval              32
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x8d  EP 13 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval              32
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x0e  EP 14 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval              32
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x8c  EP 12 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval              32
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x0d  EP 13 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval              32
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        3
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     80 Bulk (Zip)
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x0c  EP 12 OUT
        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     0x8b  EP 11 IN
        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        4
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     80 Bulk (Zip)
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x0b  EP 11 OUT
        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     0x8a  EP 10 IN
        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:     0x0000
  (Bus Powered)

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

Post by Josh » 25 Jul 2011, 18:46

Good find.

The check for the current device configuration is causing problems in few cases, probably due to hardware peculiarities.

The latest version of usb_modeswitch (1.1.8) will work around this problem and fall back to assume configuration 1 in case of trouble. If you want, you can test it by compiling from source and swapping the resulting binary with "/usr/sbin/usb_modeswitch" (after renaming the original file to something else).


Azhagan
Posts: 1
Joined: 04 May 2017, 09:00

Re: Huawei E173s working config

Post by Azhagan » 04 May 2017, 09:08

Hi guys

Im using a Huawei Modem to be connected to my raspberry pi. I have many modems.

When my modem has a device Id of 12d1:1001 the devices connect to the Internet using Sakis 3G.

But when a modem with a device id 12d1:1c05 ( Before switching 12d1:1446) it replies saying "Device did not report GSM capabilities. You can skip this by adding --noprobe command line switch" when I try connecting using sakis3G

Thanks in advance!!

Kindly Help!!!

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

Re: Huawei E173s working config

Post by LOM » 04 May 2017, 10:38

The only valid switch to 12d1:1c05 comes from 12d1:1c0b.
If you are manipulating the device with non-official port config cmds or experimenting with non-official mode switch messages then you can reach a 12d1:1c05 which is non-functional.
The correct verbose lsusb output from a working 12d1:1c05 is shown a couple of posts up.

Post Reply