Author Message

<  Everything Coding  ~  Added new device Huawei K4305

PostPosted: Mon Jul 29, 2013 12:01 pm Reply with quote
Posts: 7 Joined: Mon Jul 29, 2013 11:47 am
I had sent an e-mail to the administrator and I have received no feedback so far, so I'm posting it here. I have implemented support for the Huawei K4305. The Internet key works straight upon plugging it in:

Code:
########################################################
# Huawei K4305
#
# Contributor: Dario

DefaultVendor=  0x12d1
DefaultProduct= 0x1f15

TargetVendor=  0x12d1
TargetProduct= 0x1400

MessageContent="55534243123456780000000000000011062000000000000100000000000000"


I have also added the following udev rule in /lib/udev/rules.d/40-usb_modeswitch.rules:
Code:
# Vodafone Mobile Broadband (Huawei) K4305
ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1f15", RUN+="usb_modeswitch '%b/%k'"


I don't know if there is a general switching method to try out besides the one I have found. Any suggestion?


Offline
PostPosted: Mon Jul 29, 2013 5:38 pm Reply with quote
Posts: 1175 Joined: Wed Jul 11, 2012 3:14 pm Location: Koh Samui, TH
Thanks for the report, K4305 with usb id 12d1:1f15 is known to be an MBIM device and they don't use a traditional modeswitch message.

Can you please paste the output of lsusb -v -d 12d1:1f15 before switching it and also of 12d1:1400 after switching?


Offline
PostPosted: Mon Jul 29, 2013 6:50 pm Reply with quote
Site Admin Posts: 6441 Joined: Sat Nov 03, 2007 12:30 am
Hmm, I have not received anything via mail.
Posting new configurations here is preferred anyway.

Thanks again for this report. As LOM said, we would appreciate the "lsusb -v" output.


Offline
PostPosted: Tue Jul 30, 2013 6:52 pm Reply with quote
Posts: 7 Joined: Mon Jul 29, 2013 11:47 am
sudo lsusb -v -d 12d1:1f15 before switching:
Code:
Bus 001 Device 002: ID 12d1:1f15 Huawei Technologies Co., Ltd.
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol       255
  bMaxPacketSize0        64
  idVendor           0x12d1 Huawei Technologies Co., Ltd.
  idProduct          0x1f15
  bcdDevice            1.02
  iManufacturer           5 Vodafone (Huawei)
  iProduct                4 K4305
  iSerial                 6 FFFFFFFFFFFFFFFF
  bNumConfigurations      2
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           32
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          1 configuration 0
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     80 Bulk-Only
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 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     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           87
    bNumInterfaces          2
    bConfigurationValue     2
    iConfiguration          3 configuration 1
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              500mA
    Interface Association:
      bLength                 8
      bDescriptorType        11
      bFirstInterface         0
      bInterfaceCount         2
      bFunctionClass          2 Communications
      bFunctionSubClass      14
      bFunctionProtocol       0
      iFunction               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         2 Communications
      bInterfaceSubClass     14
      bInterfaceProtocol      0
      iInterface              0
      CDC Header:
        bcdCDC               1.10
      CDC MBIM:
        bcdMBIMVersion       1.00
        wMaxControlMessage   1024
        bNumberFilters       16
        bMaxFilterSize       15
        wMaxSegmentSize      1500
        bmNetworkCapabilities 0x20
          8-byte ntb input size
      CDC Union:
        bMasterInterface        0
        bSlaveInterface         1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               5
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      2
      iInterface              0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       1
      bNumEndpoints           2
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      2
      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              32
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval              32
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass          239 Miscellaneous Device
  bDeviceSubClass         2 ?
  bDeviceProtocol         1 Interface Association
  bMaxPacketSize0        64
  bNumConfigurations      1
Device Status:     0x0000
  (Bus Powered)

sudo lsusb -v -d 12d1:1400 after switching:
Code:
Bus 001 Device 004: ID 12d1:1400 Huawei Technologies Co., Ltd.
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            2 Communications
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x12d1 Huawei Technologies Co., Ltd.
  idProduct          0x1400
  bcdDevice            1.02
  iManufacturer           5 Vodafone (Huawei)
  iProduct                4 K4305
  iSerial                 6 FFFFFFFFFFFFFFFF
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           71
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          2 configuration 0
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         2 Communications
      bInterfaceSubClass      6 Ethernet Networking
      bInterfaceProtocol      0
      iInterface              0
      CDC Header:
        bcdCDC               1.10
      CDC Ethernet:
        iMacAddress                      1 582C80139263
        bmEthernetStatistics    0x0000000f
        wMaxSegmentSize               2048
        wNumberMCFilters            0x0003
        bNumberPowerFilters              1
      CDC Union:
        bMasterInterface        0
        bSlaveInterface         1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               5
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      6
      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              32
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval              32
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)

Network Manager creates a dummy ethernet connection for the device upon insertion. If you need further information feel free to ask.


Offline
PostPosted: Tue Jul 30, 2013 7:33 pm Reply with quote
Site Admin Posts: 6441 Joined: Sat Nov 03, 2007 12:30 am
If you want you can do some reading about the MBIM handling here:
viewtopic.php?p=6673#p6673

The bottom line is if you add "CheckMBIM=1" to your config file, usb_modeswitch is looking for the correct MBIM driver on your system.

If it is not found, then the 'fallback' mode is set by switching as usual.

Otherwise, annother configuration is set to bring the device in MBIM mode. This is not the same thing as a mode switch.


Offline
PostPosted: Wed Jul 31, 2013 2:41 pm Reply with quote
Posts: 7 Joined: Mon Jul 29, 2013 11:47 am
So what do you suggest to make it work out-of-the-box for everybody?


Offline
PostPosted: Wed Jul 31, 2013 10:07 pm Reply with quote
Site Admin Posts: 6441 Joined: Sat Nov 03, 2007 12:30 am
It's safe to add "CheckMBIM".

Versions of usb_modeswitch that do not know this option will ignore it. The newer versions will do the right thing.


Offline
PostPosted: Wed Jul 31, 2013 10:34 pm Reply with quote
Posts: 7 Joined: Mon Jul 29, 2013 11:47 am
Are you adding my contribution upstream with your amendment?


Offline
PostPosted: Thu Aug 01, 2013 5:59 pm Reply with quote
Site Admin Posts: 6441 Joined: Sat Nov 03, 2007 12:30 am
Yes, will do.

Thanks again!


Offline
PostPosted: Fri Aug 02, 2013 7:59 am Reply with quote
Posts: 7 Joined: Mon Jul 29, 2013 11:47 am
You're welcome.


Offline
PostPosted: Wed Aug 14, 2013 8:40 pm Reply with quote
Posts: 7 Joined: Mon Jul 29, 2013 11:47 am
I have found out the udev rule interferes with other USB storage devices connected to the same system. Probably it is better to remove it altogether. I am investigating the issue.


Offline
PostPosted: Sun Aug 18, 2013 12:00 pm Reply with quote
Posts: 7 Joined: Mon Jul 29, 2013 11:47 am
Never mind. I had conflicting rules due to my tests. It works just fine.


Offline
PostPosted: Fri Aug 23, 2013 3:07 pm Reply with quote
Posts: 2 Joined: Fri Aug 23, 2013 3:04 pm
Do you know any way to get ttyUSB0 to appear?

I would like to be able to use AT commands to check signal strength etc.


Offline
PostPosted: Fri Aug 23, 2013 5:04 pm Reply with quote
Posts: 1175 Joined: Wed Jul 11, 2012 3:14 pm Location: Koh Samui, TH
There are no serial interfaces on K4305, only a direct ethernet interface.

There is a webserver behind the ethernet interface where you may find signal and other connection info.


<WebUi>
<Home>http://{0}/</Home>
<Sms>http://{0}/html/home.htm?startPage=sms-inbox</Sms>
<Account>http://{0}/html/home.htm?startPage=account</Account>
<Settings>http://{0}/html/home.htm?startPage=network-settings</Settings>
<Help>http://{0}/html/home.htm?startPage=help</Help>
</WebUi>

You'll have to find out which ip adress the web server resides on and substitute that address for {0} in the list above.


Offline
PostPosted: Fri Aug 23, 2013 8:04 pm Reply with quote
Posts: 166 Joined: Thu Mar 15, 2012 10:47 pm Location: Oslo, Norway
LOM wrote:
There are no serial interfaces on K4305, only a direct ethernet interface.

There is a webserver behind the ethernet interface where you may find signal and other connection info.


<WebUi>
<Home>http://{0}/</Home>
<Sms>http://{0}/html/home.htm?startPage=sms-inbox</Sms>
<Account>http://{0}/html/home.htm?startPage=account</Account>
<Settings>http://{0}/html/home.htm?startPage=network-settings</Settings>
<Help>http://{0}/html/home.htm?startPage=help</Help>
</WebUi>

You'll have to find out which ip adress the web server resides on and substitute that address for {0} in the list above.


Yes, but as you noted earlier: It's better to use MBIM if you want features like that. Check out the new ModemManager with libmbim support.


Offline

Display posts from previous:  Sort by:

All times are UTC+02:00
Page 1 of 2
22 posts
Go to page 1 2 Next
Users browsing this forum: No registered users and 1 guest
Search for:
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