Author Message

<  Setup Discussion  ~  Huawei ME906s-158 cannot connect

PostPosted: Tue Jun 20, 2017 12:44 pm Reply with quote
Posts: 7 Joined: Tue Jun 20, 2017 10:55 am
OS - Debian, Hardware - CHIP-PRO

This is my first time installing the ME906s-158 on the computer. Previously, I have used the E3276 and it works well after running usb_modeswitch. It is using the huawei_cdc_ncm driver. The interface wwan0 was created.

The ME906s-158 is using the cdc_ether, but not the cdc_mbim driver. Is there is way to switch the mode so that it uses cdc_mbim?

For the ME906s-158, I have recompiled the kernel to include

Code:
CONFIG_USB_NET_CDC_MBIM=y


After system boot, running ip addr shows:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
.....
2: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1
.....
3: usb0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether ea:70:00:53:b9:54 brd ff:ff:ff:ff:ff:ff
inet 169.254.6.242/16 brd 169.254.255.255 scope link usb0
valid_lft forever preferred_lft forever
inet6 fe80::e870:ff:fe53:b954/64 scope link
valid_lft forever preferred_lft forever
4: usb1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
link/ether 02:1e:10:1f:00:00 brd ff:ff:ff:ff:ff:ff
5: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
.....
6: wlan1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
.....

Running dmesg shows:

[ 1.465000] usbcore: registered new interface driver cdc_ether
[ 1.495000] usbcore: registered new interface driver cdc_subset
[ 1.505000] usbcore: registered new interface driver cdc_ncm
[ 1.515000] usbcore: registered new interface driver huawei_cdc_ncm
[ 1.520000] usbcore: registered new interface driver cdc_mbim
[ 1.600000] usbcore: registered new interface driver cdc_wdm
[ 1.645000] udc-core: couldn't find an available UDC - added [g_cdc] to list of pending drivers
[ 2.070000] g_cdc gadget: CDC Composite Gadget, version: King Kamehameha Day 2008
[ 2.075000] g_cdc gadget: g_cdc ready
[ 2.520000] g_cdc gadget: high-speed config #1: CDC Composite (ECM + ACM)
[ 2.800000] cdc_ether 1-1:2.0 usb1: register 'cdc_ether' at usb-1c14000.usb-1, CDC Ethernet Device, 02:1e:10:1f:00:00
[ 18.405000] cdc_ether 1-1:2.0 usb1: kevent 12 may have been dropped
[ 1.440000] pegasus: v0.9.3 (2013/04/25), Pegasus/Pegasus II USB Ethernet driver
[ 1.525000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 1.570000] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 1.625000] usbserial: USB Serial support registered for generic
[ 1.635000] usbserial: USB Serial support registered for GSM modem (1-port)
[ 1.790000] usbhid: USB HID core driver
[ 1.890000] ehci-platform 1c14000.usb: new USB bus registered, assigned bus number 1
[ 1.915000] ehci-platform 1c14000.usb: USB 2.0 started, EHCI 1.00
[ 1.920000] hub 1-0:1.0: USB hub found
[ 1.935000] ohci-platform 1c14400.usb: new USB bus registered, assigned bus number 2
[ 2.005000] hub 2-0:1.0: USB hub found
[ 2.025000] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[ 2.030000] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 3
[ 2.040000] hub 3-0:1.0: USB hub found
[ 2.255000] usb 1-1: new high-speed USB device number 2 using ehci-platform
[ 2.855000] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0
[ 3.090000] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
[ 3.190000] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB2
[ 3.400000] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB3
[ 3.420000] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB4

Running usb-devices shows:

T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=480 MxCh= 0
D: Ver= 2.10 Cls=00(>ifc ) Sub=00 Prot=ff MxPS=64 #Cfgs= 3
P: Vendor=12d1 ProdID=15c1 Rev=01.02
S: Manufacturer=HUAWEI Mobile
S: Product=HUAWEI Mobile
S: SerialNumber=0123456789ABCDEF
C: #Ifs= 7 Cfg#= 2 Atr=a0 MxPwr=2mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=06 Prot=00 Driver=cdc_ether
I: If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=06 Prot=00 Driver=cdc_ether
I: If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=06 Prot=10 Driver=option
I: If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=06 Prot=13 Driver=option
I: If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=06 Prot=12 Driver=option
I: If#= 5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=06 Prot=14 Driver=option
I: If#= 6 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=06 Prot=1b Driver=option

Running lsusb -v shows:

    Bus 001 Device 002: ID 12d1:15c1 Huawei Technologies Co., Ltd.
    Device Descriptor:
      bLength 18
      bDescriptorType 1
      bcdUSB 2.10
      bDeviceClass 0 (Defined at Interface level)
      bDeviceSubClass 0
      bDeviceProtocol 255
      bMaxPacketSize0 64
      idVendor 0x12d1 Huawei Technologies Co., Ltd.
      idProduct 0x15c1
      bcdDevice 1.02
      iManufacturer 1 HUAWEI Mobile
      iProduct 2 HUAWEI Mobile
      iSerial 3 0123456789ABCDEF
      bNumConfigurations 3
      ....
      ....
    Configuration Descriptor:
      bLength 9
      bDescriptorType 2
      wTotalLength 137
      bNumInterfaces 3
      bConfigurationValue 3
      iConfiguration 0
      bmAttributes 0xa0
      (Bus Powered)
      Remote Wakeup
      MaxPower 2mA
      Interface Association:
        bLength 8
        bDescriptorType 11
        bFirstInterface 0
        bInterfaceCount 2
        bFunctionClass 2 Communications
        bFunctionSubClass 14
        bFunctionProtocol 0
        iFunction 13 HUAWEI Mobile Broadband Module
      Interface Descriptor:
        bLength 9
        bDescriptorType 4
        bInterfaceNumber 0
        bAlternateSetting 0
        bNumEndpoints 1
        bInterfaceClass 2 Communications
        bInterfaceSubClass 14
        bInterfaceProtocol 0
        iInterface 10 HUAWEI Mobile Connect - Network Card
        CDC Header:
          bcdCDC 1.10
        CDC MBIM:
          bcdMBIMVersion 1.00
          wMaxControlMessage 1024
          bNumberFilters 32
          bMaxFilterSize 128
          wMaxSegmentSize 1500
          bmNetworkCapabilities 0x20
          8-byte ntb input size
        UNRECOGNIZED CDC: 08 24 1c 00 01 10 b4 05
        CDC Union:
          bMasterInterface 0
          bSlaveInterface 1
        Endpoint Descriptor:
          bLength 7
          bDescriptorType 5
          bEndpointAddress 0x82 EP 2 IN
          bmAttributes 3
          Transfer Type Interrupt
          Synch Type None
          Usage Type Data
          wMaxPacketSize 0x0010 1x 16 bytes
          bInterval 5
    .....
    .....


Offline
PostPosted: Tue Jun 20, 2017 12:58 pm Reply with quote
Site Admin Posts: 6436 Joined: Sat Nov 03, 2007 12:30 am
What does the unswitched modem look like with "lsusb -v" ?


Offline
PostPosted: Tue Jun 20, 2017 1:06 pm Reply with quote
Posts: 1175 Joined: Wed Jul 11, 2012 3:14 pm Location: Koh Samui, TH
usb_modeswitch will handle 12d1:15c1 and select its mbim configuration if the cdc_mbim driver is in the system.
You must have a too old version of usb_modeswitch and its data package.
update!


edit: @Josh, this is a mpcie card so doesn't have a cd-rom mode.


Offline
PostPosted: Tue Jun 20, 2017 1:35 pm Reply with quote
Posts: 7 Joined: Tue Jun 20, 2017 10:55 am
My current version is 2.2.0-repack for controlli and 20150115-1 for usb-modes under jessie (oldstable).

I ran

Code:
apt-get install usb-modeswitch


and the above versions are installed.

Is the latest version 2.5.0-repack in jessie-backports required?


Offline
PostPosted: Tue Jun 20, 2017 2:47 pm Reply with quote
Posts: 1175 Joined: Wed Jul 11, 2012 3:14 pm Location: Koh Samui, TH
aobs wrote:
Is the latest version 2.5.0-repack in jessie-backports required?



You need usb_modeswitch >= 2.4.0 , there is no reason for not installing 2.5.0
The data package must be from 2016-06-12 or later.


Offline
PostPosted: Tue Jun 20, 2017 5:05 pm Reply with quote
Posts: 7 Joined: Tue Jun 20, 2017 10:55 am
I have updated usb-modeswitch to 2.5.0.

Running

Code:
usb_modeswitch -v 0x12d1 -p 0x15c1


shows

    Look for default devices ...
    product ID matched
    Found devices in default mode (1)
    Access device 002 on bus 001
    Get the current device configuration ...
    Use interface number 0
    with class 2

    USB description data (for identification)
    ......
    ......
    Warning: no switching method given. See documentation
    -> Run lsusb to note any changes. Bye!

made no difference. Still cannot get the cdc_mbim to work. The /dev/cdc-wdmX port does not exist as well.


Offline
PostPosted: Tue Jun 20, 2017 6:15 pm Reply with quote
Posts: 1175 Joined: Wed Jul 11, 2012 3:14 pm Location: Koh Samui, TH
aobs wrote:

Code:
usb_modeswitch -v 0x12d1 -p 0x15c1



That's not the way to run usb_modeswitch manually from a cmdline.

aobs wrote:
Warning: no switching method given. See documentation


The hint is there ^ (and the solution also)

add -u2 to the cmdline for selecting configuration 2 which is the mbim configuration.

but

if you have done a full install then udev will call usb_modeswitch when the device is detected on the usb bus, you should not have to run it manually.


Offline
PostPosted: Wed Jun 21, 2017 5:06 am Reply with quote
Posts: 7 Joined: Tue Jun 20, 2017 10:55 am
I believe it is fully installed

Code:
apt-get -t jessie-backports install usb-modeswitch


Running apt list -a usb-modeswitch

    usb-modeswitch/jessie-backports,now 2.5.0+repack0-1~bpo8+1 armhf [installed]
    usb-modeswitch/oldstable 2.2.0+repack0-2 armhf

Also, configuration 2 is already selected when the system is booted. Running usb-devices shows

    T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 3 Spd=480 MxCh= 0
    D: Ver= 2.10 Cls=00(>ifc ) Sub=00 Prot=ff MxPS=64 #Cfgs= 3
    P: Vendor=12d1 ProdID=15c1 Rev=01.02
    S: Manufacturer=HUAWEI Mobile
    S: Product=HUAWEI Mobile
    S: SerialNumber=0123456789ABCDEF
    C: #Ifs= 7 Cfg#= 2 Atr=a0 MxPwr=2mA
    I: If#= 0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=06 Prot=00 Driver=cdc_ether
    I: If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=06 Prot=00 Driver=cdc_ether
    I: If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=06 Prot=10 Driver=option
    I: If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=06 Prot=13 Driver=option
    I: If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=06 Prot=12 Driver=option
    I: If#= 5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=06 Prot=14 Driver=option
    I: If#= 6 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=06 Prot=1b Driver=option

Running usb_modeswitch -u 2 -v 0x12d1 -p -0x15c1 shows

    Look for default devices ...
    product ID matched
    Get the current device configuration ...
    No devices in default mode found. Nothing to do. Bye!

I also added

Code:
options cdc_ncm prefer_mbim=Y


to /lib/modprobe.d/aliases.conf

I am out of luck and running out of ideas. I will try to reinstall the OS from scratch.


Offline
PostPosted: Wed Jun 21, 2017 7:03 am Reply with quote
Posts: 1175 Joined: Wed Jul 11, 2012 3:14 pm Location: Koh Samui, TH
ok, you have a later firmware which has 3 configurations so make that -u 3 instead.

For automatic switching into the mbim configuration make sure that there is 12d1:15c1 file in the folder
/usr/share/usb_modeswitch and that /lib/udev/rules.d/40-usb_modeswitch.rules contains a rule for 12d1:15c1.
I'm not sure if your download of usb_modeswitch 2.5 also contained the latest data package or if you have to download that separately..

The cdc_mbim driver must be present in the system, either built into the kernel or as a loadable module in which case it must reside in the default module directory.


Offline
PostPosted: Wed Jun 21, 2017 1:02 pm Reply with quote
Posts: 7 Joined: Tue Jun 20, 2017 10:55 am
The cdc_mbim driver is definitely built-in. In the kernel config file:

Code:
CONFIG_USB_NET_CDC_MBIM=y


and running dmesg shows

Code:
usbcore: registered new interface driver cdc_mbim


There is no 12d1:15c1 file under the /usr/share/usb_modeswitch directory nor an entry in the 40-usb_modeswitch.rules file.

I created the 12d1:15c1 file

Code:
# Huawei ME906s
TargetVendor=0x12d1
TargetProduct=0x15c1
HuaweiNewMode=1


and added the following lines in /lib/udev/rules.d/40-usb_modeswitch_rules

Code:
# Huawei ME906
ATTR{idVendor}=="12d1", ATTR{idProduct}=="15c1", RUN+="usb_modeswitch '%b/%k'"


and also tried changing to

Code:
# Huawei ME906
ATTR{idVendor}=="12d1", ATTR{idProduct}=="15c1", RUN+="usb_modeswitch'"


Not sure whether the above lines are correct.

But now running dmesg | egrep USB shows

    [ 1.440000] pegasus: v0.9.3 (2013/04/25), Pegasus/Pegasus II USB Ethernet driver
    [ 1.525000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
    [ 1.570000] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
    [ 1.625000] usbserial: USB Serial support registered for generic
    [ 1.635000] usbserial: USB Serial support registered for GSM modem (1-port)
    [ 1.790000] usbhid: USB HID core driver
    [ 1.890000] ehci-platform 1c14000.usb: new USB bus registered, assigned bus number 1
    [ 1.915000] ehci-platform 1c14000.usb: USB 2.0 started, EHCI 1.00
    [ 1.920000] hub 1-0:1.0: USB hub found
    [ 1.935000] ohci-platform 1c14400.usb: new USB bus registered, assigned bus number 2
    [ 2.005000] hub 2-0:1.0: USB hub found
    [ 2.025000] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
    [ 2.030000] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 3
    [ 2.040000] hub 3-0:1.0: USB hub found

Running usb_modeswitch -v 0x12d1 -p 0x15c1 -u 3 or usb_modeswitch -v 0x12d1 -p 0x15c1 -u 2 show

    Look for default devices ...
    No devices in default mode found. Nothing to do. Bye!

These lines in dmesg | egrep USB are gone:

    [ 2.255000] usb 1-1: new high-speed USB device number 2 using ehci-platform
    [ 2.855000] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0
    [ 3.090000] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
    [ 3.190000] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB2
    [ 3.400000] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB3
    [ 3.420000] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB4


Offline
PostPosted: Wed Jun 21, 2017 1:23 pm Reply with quote
Posts: 1175 Joined: Wed Jul 11, 2012 3:14 pm Location: Koh Samui, TH
aobs wrote:
There is no 12d1:15c1 file under the /usr/share/usb_modeswitch directory nor an entry in the 40-usb_modeswitch.rules file.

I created the 12d1:15c1 file

Code:
# Huawei ME906s
TargetVendor=0x12d1
TargetProduct=0x15c1
HuaweiNewMode=1

]


Missing because you are still using an old data package and your created 12d1:15c1 file has the wrong switch method.
Download the latest data package here:
http://www.draisberghof.de/usb_modeswitch/

and install it without tampering with the files, they are correct.


Offline
PostPosted: Wed Jun 21, 2017 5:01 pm Reply with quote
Posts: 7 Joined: Tue Jun 20, 2017 10:55 am
Thanks for the url. I did the installation.

Now running dmesg shows:

    [ 1.465000] usbcore: registered new interface driver cdc_ether
    [ 1.495000] usbcore: registered new interface driver cdc_subset
    [ 1.505000] usbcore: registered new interface driver cdc_ncm
    [ 1.510000] usbcore: registered new interface driver huawei_cdc_ncm
    [ 1.520000] usbcore: registered new interface driver cdc_mbim
    [ 1.600000] usbcore: registered new interface driver cdc_wdm
    [ 1.645000] udc-core: couldn't find an available UDC - added [g_cdc] to list of pending drivers
    [ 2.070000] g_cdc gadget: CDC Composite Gadget, version: King Kamehameha Day 2008
    [ 2.075000] g_cdc gadget: g_cdc ready
    [ 2.385000] g_cdc gadget: high-speed config #1: CDC Composite (ECM + ACM)
    [ 10.160000] cdc_ether 1-1:2.0 usb1: register 'cdc_ether' at usb-1c14000.usb-1, CDC Ethernet Device, 02:1e:10:1f:00:00
    [ 20.775000] usb 1-1: usbfs: interface 0 claimed by cdc_ether while 'usb_modeswitch' sets config #3
    [ 20.795000] cdc_ether 1-1:2.0 usb1: unregister 'cdc_ether' usb-1c14000.usb-1, CDC Ethernet Device


    [ 1.440000] pegasus: v0.9.3 (2013/04/25), Pegasus/Pegasus II USB Ethernet driver
    [ 1.525000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
    [ 1.570000] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
    [ 1.625000] usbserial: USB Serial support registered for generic
    [ 1.635000] usbserial: USB Serial support registered for GSM modem (1-port)
    [ 1.790000] usbhid: USB HID core driver
    [ 1.890000] ehci-platform 1c14000.usb: new USB bus registered, assigned bus number 1
    [ 1.915000] ehci-platform 1c14000.usb: USB 2.0 started, EHCI 1.00
    [ 1.920000] hub 1-0:1.0: USB hub found
    [ 1.935000] ohci-platform 1c14400.usb: new USB bus registered, assigned bus number 2
    [ 2.005000] hub 2-0:1.0: USB hub found
    [ 2.025000] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
    [ 2.030000] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 3
    [ 2.040000] hub 3-0:1.0: USB hub found
    [ 9.920000] usb 1-1: new high-speed USB device number 3 using ehci-platform
    [ 10.265000] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0
    [ 10.410000] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
    [ 10.560000] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB2
    [ 10.625000] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB3
    [ 11.000000] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB4

Running usb-devices shows:

    T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 3 Spd=480 MxCh= 0
    D: Ver= 2.10 Cls=00(>ifc ) Sub=00 Prot=ff MxPS=64 #Cfgs= 3
    P: Vendor=12d1 ProdID=15c1 Rev=01.02
    S: Manufacturer=HUAWEI Mobile
    S: Product=HUAWEI Mobile
    S: SerialNumber=0123456789ABCDEF
    C: #Ifs= 7 Cfg#= 2 Atr=a0 MxPwr=2mA
    I: If#= 0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=06 Prot=00 Driver=(none)
    I: If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=06 Prot=00 Driver=(none)
    I: If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=06 Prot=10 Driver=option
    I: If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=06 Prot=13 Driver=option
    I: If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=06 Prot=12 Driver=option
    I: If#= 5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=06 Prot=14 Driver=option
    I: If#= 6 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=06 Prot=1b Driver=option

Running usb_modeswitch -u 3 -v 0x12d1 -p 0x15c1 shows:

    Look for default devices ...
    product ID matched
    Get the current device configuration ...
    Found devices in default mode (1)
    Access device 003 on bus 001
    Get the current device configuration ...
    Current configuration number is 2
    Use interface number 0
    with class 2

    USB description data (for identification)
    -------------------------
    Manufacturer: HUAWEI Mobile
    Product: HUAWEI Mobile
    Serial No.: 0123456789ABCDEF
    -------------------------
    Change configuration to 3 ...
    Device is busy, try to detach kernel driver
    Looking for active driver ...
    No active driver found. Detached before or never attached
    Device is busy, try to detach kernel driver
    Looking for active driver ...
    No active driver found. Detached before or never attached
    Device is busy, try to detach kernel driver
    Looking for active driver ...
    No active driver found. Detached before or never attached
    Device is busy, try to detach kernel driver
    Looking for active driver ...
    No active driver found. Detached before or never attached
    Changing the configuration failed (error -6). Try to continue
    -> Run lsusb to note any changes. Bye!

Running usb-devices again shows no changes.

It looks like the cdc_mbim driver is not assigned to the modem somehow.

This modem supports NDIS as well.


Offline
PostPosted: Fri Jun 23, 2017 9:26 am Reply with quote
Posts: 1175 Joined: Wed Jul 11, 2012 3:14 pm Location: Koh Samui, TH
aobs wrote:
It looks like the cdc_mbim driver is not assigned to the modem somehow.



That's because selecting configuration 3 failed (Changing the configuration failed (error -6)) which means Device is busy.
usb_modeswitch was not made for detaching multiple drivers like you have (cdc_ether and option) it was made for detaching the single storage driver that modems normally have in their default mode (install mode).
Josh?

It could be that an automatic invocation of usb_modeswitch via udev can work if it happens before any drivers has attached.
Enable logging in /etc/usb_modeswitch.conf, remove and then replug the modem.
Include the logfile in your next post.


Offline
PostPosted: Sat Jun 24, 2017 12:06 am Reply with quote
Site Admin Posts: 6436 Joined: Sat Nov 03, 2007 12:30 am
Hmm, that's a new aspect there ...

I wonder what the response is and what "dmesg" says after the configuration change attempt is executed manually with
Code:
# echo 3 > /sys/bus/usb/devices/<your_modem>/bConfigurationValue


Offline
PostPosted: Sun Jun 25, 2017 5:24 am Reply with quote
Posts: 7 Joined: Tue Jun 20, 2017 10:55 am
Thanks LOM and Josh for your help.

I comment the following line on /lib/udev/rules.d/40-usb_modeswitch.rules

Code:
#ATTR{idVendor}=="12d1", ATTR{idProduct}=="15c1", RUN+="usb_modeswitch '/%k'"


so that the cdc_ether driver is assigned to the modem device.

If I do not comment the above line, no driver is assigned to the device.

Then changing configuration value:

Code:
echo 3 >/sys/bus/usb/devices/1-1/bConfigurationValue


Then the wwan0 interface is created.

    ........
    3: usb0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    ........
    7: wwan0: <BROADCAST,MULTICAST,NOARP> mtu 1460 qdisc noop state DOWN group default qlen 1000
    link/ether 8a:62:f8:88:3a:27 brd ff:ff:ff:ff:ff:ff

[Before echo 3] Running dmesg shows:

    [ 1.465000] usbcore: registered new interface driver cdc_ether
    [ 6.220000] cdc_ether 1-1:2.0 usb1: register 'cdc_ether' at usb-1c14000.usb-1, CDC Ethernet Device, 02:1e:10:1f:00:00
    [ 19.530000] cdc_ether 1-1:2.0 usb1: kevent 12 may have been dropped
    [ 6.240000] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0
    [ 6.270000] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
    [ 6.290000] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB2
    [ 6.305000] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB3
    [ 6.330000] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB4

[After echo 3] Running dmesg shows:

    [ 199.495000] cdc_mbim 1-1:3.0: setting rx_max = 16384
    [ 199.495000] cdc_mbim 1-1:3.0: NDP will be placed at end of frame for this device.
    [ 199.495000] cdc_mbim 1-1:3.0: cdc-wdm0: USB WDM device
    [ 199.495000] cdc_mbim 1-1:3.0 wwan0: register 'cdc_mbim' at usb-1c14000.usb-1, CDC MBIM, 8a:62:f8:88:3a:27
    [ 198.890000] option1 ttyUSB0: GSM modem (1-port) converter now disconnected from ttyUSB0
    [ 198.890000] option1 ttyUSB1: GSM modem (1-port) converter now disconnected from ttyUSB1
    [ 198.910000] option1 ttyUSB2: GSM modem (1-port) converter now disconnected from ttyUSB2
    [ 198.915000] option1 ttyUSB3: GSM modem (1-port) converter now disconnected from ttyUSB3
    [ 198.920000] option1 ttyUSB4: GSM modem (1-port) converter now disconnected from ttyUSB4
    [ 199.515000] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0

Running usb-devices shows:

    T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=480 MxCh= 0
    D: Ver= 2.10 Cls=00(>ifc ) Sub=00 Prot=ff MxPS=64 #Cfgs= 3
    P: Vendor=12d1 ProdID=15c1 Rev=01.02
    S: Manufacturer=HUAWEI Mobile
    S: Product=HUAWEI Mobile
    S: SerialNumber=0123456789ABCDEF
    C: #Ifs= 3 Cfg#= 3 Atr=a0 MxPwr=2mA
    I: If#= 0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=0e Prot=00 Driver=cdc_mbim
    I: If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim
    I: If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=06 Prot=14 Driver=option

Only /dev/ttyUSB0 is created.

Not sure whether /dev/ttyUSB1, /dev/ttyUSB2, /dev/ttyUSB3 & /dev/ttyUSB4 are needed.

Somehow the wwan0 is not getting the IP address after entering the following AT commands using minicom -D /dev/ttyUSB0

Code:
AT+CGDCONT=1,"IP","apn"
AT+CGACT=1,1


and

Code:
dhclient -v wwan0


This is not a problem with the usb_modeswitch. I will try to find answers in other forums.

It would be great if usb_modeswitch can handle switching for modems with multiple drivers.

Thanks again for your help.

Edited: Corrected entries in [Before echo 3]


Last edited by aobs on Wed Jun 28, 2017 2:41 am, edited 5 times in total.

Offline

Display posts from previous:  Sort by:

All times are UTC+02:00
Page 1 of 3
32 posts
Go to page 1 2 3 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