Author Message

<  Setup Discussion  ~  Automatic switching of Huawei dongle

PostPosted: Tue Jan 16, 2018 9:14 pm Reply with quote
Posts: 6 Joined: Wed Aug 13, 2014 5:50 pm
Hi,

most of the time the automatic switching after boot works like a charm, sometimes it doesn't. Then I issue

sudo usb_modeswitch -v 0x12d1 -p 0x1f01 -V 0x12d1 -P 0x14dc -M "55534243123456780000000000000a11062000000000000100000000000000"

(probably stolen from here, I can't remember) and everything works fine.

Anything that could be done to automatically switch at _every_ boot?

TIA,
Oliver


PS: For completeness:

After the switch lsusb gives:
Code:
ojo@apollo:~$ lsusb -v -d 12d1:

Bus 003 Device 006: ID 12d1:14dc Huawei Technologies Co., Ltd.
Couldn't open device, some information will be missing
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          0x14dc
  bcdDevice            1.02
  iManufacturer           1
  iProduct                2
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           94
    bNumInterfaces          3
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         2 Communications
      bInterfaceSubClass      6 Ethernet Networking
      bInterfaceProtocol      0
      iInterface              5
      CDC Header:
        bcdCDC               1.10
      CDC Union:
        bMasterInterface        0
        bSlaveInterface         1
      CDC Ethernet:
        iMacAddress                      7 (??)
        bmEthernetStatistics    0x00000000
        wMaxSegmentSize               1514
        wNumberMCFilters            0x0000
        bNumberPowerFilters              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0010  1x 16 bytes
        bInterval               9
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      6
      bInterfaceProtocol      0
      iInterface              6
      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        2
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     80 Bulk-Only
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x84  EP 4 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               1


Offline
PostPosted: Wed Jan 17, 2018 5:45 pm Reply with quote
Site Admin Posts: 6423 Joined: Sat Nov 03, 2007 12:30 am
You did not give your usb_modeswitch version.

If it's pre-2.5.x, I suggest using the latest version from here. If your problem persists with the current version, I suspect a timing issue.

In the latter case, copy the config file for your modem ("12d1:1f01") to /etc/usb_modeswitch.d.
Edit it and add a line with the parameter "WaitBefore=2". That gives a delay in seconds before usb_modeswitch starts to act. Play around with the value.


Offline
PostPosted: Wed Jan 17, 2018 10:14 pm Reply with quote
Posts: 6 Joined: Wed Aug 13, 2014 5:50 pm
Code:
ojo@apollo:~$ usb_modeswitch --version

 * usb_modeswitch: handle USB devices with multiple modes
 * Version 2.2.5 (C) Josua Dietze 2015
 * Based on libusb1/libusbx

 ! PLEASE REPORT NEW CONFIGURATIONS !


I'll try playing with the config.

Thanks!

Kind regards,
Oliver


Offline
PostPosted: Wed Apr 11, 2018 8:59 pm Reply with quote
Posts: 6 Joined: Wed Aug 13, 2014 5:50 pm
ojo wrote:
Code:
ojo@apollo:~$ usb_modeswitch --version

 * usb_modeswitch: handle USB devices with multiple modes
 * Version 2.2.5 (C) Josua Dietze 2015
 * Based on libusb1/libusbx

 ! PLEASE REPORT NEW CONFIGURATIONS !


I'll try playing with the config.

Thanks!

Kind regards,
Oliver


Duh!

I misread your reply to refer to version < 2.2.5.

OK, I'll try to install a newer one.

Regards,
Oliver


Offline

Display posts from previous:  Sort by:

All times are UTC+02:00
Page 1 of 1
4 posts
Users browsing this forum: No registered users and 0 guests
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