Automatic Activation, Hotplug and UDEV, Configuration
Post Reply
vzotov
Posts: 6
Joined: Thu Jan 15, 2015 4:02 pm

Huawei e1750 vs usb_modeswitch 2.2.0

Post by vzotov » Thu Jan 15, 2015 4:12 pm

Hello!

usb_modeswitch 2.2.0 doesn't work with my Huawei e1750 3g modem. Connection log is:

USB_ModeSwitch log from Thu Jan 15 16:57:49 MSK 2015

Use global config file: /etc/usb_modeswitch.conf

Started via upstart
Raw args from udev: 3-1/3-1:1.0

Use top device dir /sys/bus/usb/devices/3-1

----------------
USB values from sysfs:
manufacturer HUAWEI Technology
product HUAWEI Mobile
serial
----------------
bNumConfigurations is 1 - don't check for active configuration
ConfigList: /usr/share/usb_modeswitch/12d1:1446 /usr/share/usb_modeswitch/12d1:#linux
SCSI attributes not needed, move on
Check config: /usr/share/usb_modeswitch/12d1:1446
! matched. Read config data
config: TargetVendor set to 12d1
config: TargetProductList set to 1001,1406,140b,140c,1412,141b,1432,1433,1436,14ac,1506,150c,1511
Driver module is "option", ID path is /sys/bus/usb-serial/drivers/option1

Command to be run:
usb_modeswitch -W -D -s 20 -u -1 -b 3 -g 2 -v 12d1 -p 1446 -f $configBuffer

Verbose debug output of usb_modeswitch and libusb follows
(Note that some USB errors are to be expected in the process)
--------------------------------

Read long config from command line

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

! PLEASE REPORT NEW CONFIGURATIONS !

DefaultVendor= 0x12d1
DefaultProduct= 0x1446
TargetVendor= 0x12d1
TargetProductList="1001,1406,140b,140c,1412,141b,1432,1433,1436,14ac,1506,150c,1511"
HuaweiNewMode=1
NeedResponse=0
Success check enabled, max. wait time 20 seconds
System integration mode enabled

Use given bus/device number: 003/002 ...
Look for default devices ...
bus/device number matched
found USB ID 12d1:1446
vendor ID matched
product ID matched
Found devices in default mode (1)
Use interface number 0
Use endpoints 0x01 (out) and 0x81 (in)

USB description data (for identification)
-------------------------
Manufacturer: HUAWEI Technology
Product: HUAWEI Mobile
Serial No.: not provided
-------------------------
Using standard Huawei switching message
Looking for active driver ...
Driver detach failed (error -5). Try to continue
Set up interface 0
Could not claim interface (error -6). Skip message sending
Bus/dev search active, refer success check to wrapper. Bye!

ok:busdev
--------------------------------
(end of usb_modeswitch output)

Check success of mode switch for max. 20 seconds ...
Read attributes ...
Read attributes ...
Read attributes ...
Read attributes ...
Read attributes ...
Read attributes ...
Read attributes ...
Read attributes ...
Read attributes ...
Read attributes ...
Read attributes ...
Read attributes ...
Read attributes ...
Read attributes ...
Read attributes ...
Read attributes ...
Read attributes ...
Read attributes ...
Read attributes ...
Read attributes ...

Target config not matching - current values are
3-1:1.0/bInterfaceClass: 08
bConfigurationValue: 1
bNumConfigurations: 1
busnum: 3
devnum: 2
idProduct: 1446
idVendor: 12d1
manufacturer: HUAWEI Technology
product: HUAWEI Mobile
serial:

Mode switching may have failed. Exit


How to fix it?

Josh
Site Admin
Posts: 6534
Joined: Sat Nov 03, 2007 12:30 am

Re: Huawei e1750 vs usb_modeswitch 2.2.0

Post by Josh » Thu Jan 15, 2015 7:46 pm

Your problem is here:

Code: Select all

Driver detach failed (error -5).
It's an I/O error (whatever that means ...). Maybe there is a problem with the usb-storage driver.

One thing you can do is to play around with the "use delay" of the storage driver. There is a convenience facility in /etc/usb_modeswitch.conf to change the value.
Note that any changed setting will only be active for the second plug-in of the modem after the change.

vzotov
Posts: 6
Joined: Thu Jan 15, 2015 4:02 pm

Re: Huawei e1750 vs usb_modeswitch 2.2.0

Post by vzotov » Fri Jan 16, 2015 2:38 pm

Some driver problems. Changed OS from FreePBX to Ubuntu Server and it worked! Thank you!

vzotov
Posts: 6
Joined: Thu Jan 15, 2015 4:02 pm

Re: Huawei e1750 vs usb_modeswitch 2.2.0

Post by vzotov » Tue Jan 20, 2015 4:05 pm

Unfortunately there is another problem. I have now ubuntu server 14.04 i386 (usb-modeswitch v2.1.1) and my e1750 doesn't work properly:(
Log:

Code: Select all

Use global config file: /etc/usb_modeswitch.conf


Started via upstart
Raw args from udev: 2-1.2/2-1.2

Use top device dir /sys/bus/usb/devices/2-1.2

USB dir exists: /sys/bus/usb/devices/2-1.2
Warning: USB attribute "serial" not readable.

SCSI dir exists: /sys/bus/usb/devices/2-1.2
Warning: SCSI attribute "vendor" not readable.
Warning: SCSI attribute "model" not readable.
Warning: SCSI attribute "rev" not readable.
Use interface /sys/bus/usb/devices/2-1.2/2-1.2:1.0
----------------
USB values from sysfs:
  idVendor      12d1
  idProduct     1001
  manufacturer  HUAWEI Technology
  product       HUAWEI Mobile
  serial        (null)
  bNumConfigurations    1
----------------
bNumConfigurations is 1 - don't check for active configuration
Found packed config collection /usr/share/usb_modeswitch/configPack.tar.gz
Searching entries named: /usr/share/usb_modeswitch/12d1:1001*
Searching overriding entries named: /etc/usb_modeswitch.d/12d1:1001*
SCSI attributes not needed, move on.

Extract config 12d1:1001 from collection /usr/share/usb_modeswitch/configPack.tar.gz
config: TargetClass set to ff
Driver module is "option", ID path is /sys/bus/usb-serial/drivers/option1
! matched, now switching
Command to be run:
/usr/sbin/usb_modeswitch -W -D -s 20 -c /run/usb_modeswitch/current_cfg -u -1   -v 12d1 -p 1001 2>&1

Verbose debug output of usb_modeswitch and libusb follows
(Note that some USB errors are expected in the process)
--------------------------------

Read config file: /run/usb_modeswitch/current_cfg

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

 ! PLEASE REPORT NEW CONFIGURATIONS !

DefaultVendor=  0x12d1
DefaultProduct= 0x1001
TargetClass=    0xff
HuaweiMode=1
NeedResponse=0
Success check enabled, max. wait time 20 seconds
System integration mode enabled

Look for target devices ...
  found USB ID 12d1:1001
   vendor ID matched
  found USB ID 8087:0024
  found USB ID 1d6b:0002
  found USB ID 1d6b:0003
  found USB ID 1d6b:0002
  found USB ID 13d3:5710
  found USB ID 8087:0024
  found USB ID 1d6b:0002
 No devices in target mode or class found
Look for default devices ...
  found USB ID 12d1:1001
   vendor ID matched
   product ID matched
   target class ff matches
   device not counted, target class reached
  found USB ID 8087:0024
  found USB ID 1d6b:0002
  found USB ID 1d6b:0003
  found USB ID 1d6b:0002
  found USB ID 13d3:5710
  found USB ID 8087:0024
  found USB ID 1d6b:0002
 No devices in default mode found. Nothing to do. Bye!

--------------------------------
(end of usb_modeswitch output)

USB dir exists: /sys/bus/usb/devices/2-1.2
Warning: USB attribute "serial" not readable.

All done, exit
lsusb

Code: Select all

lsusb
Bus 002 Device 004: ID 12d1:1001 Huawei Technologies Co., Ltd. E169/E620/E800 HSDPA Modem
dmesg | grep usb

Code: Select all

[    3.108255] usb 2-1.2: new full-speed USB device number 3 using ehci-pci
[    3.204223] usb 2-1.2: New USB device found, idVendor=12d1, idProduct=1001
[    3.204225] usb 2-1.2: New USB device strings: Mfr=3, Product=2, SerialNumber=0
[    3.204226] usb 2-1.2: Product: HUAWEI Mobile
[    3.204228] usb 2-1.2: Manufacturer: HUAWEI Technology
[    5.290802] usb-storage 2-1.2:1.0: USB Mass Storage device detected
[    5.334704] usb-storage 2-1.2:1.1: USB Mass Storage device detected
[    5.373599] usb-storage 2-1.2:1.2: USB Mass Storage device detected
[    5.381941] usbcore: registered new interface driver usb-storage
[   15.229940] usbcore: registered new interface driver usbserial
[   15.229961] usbcore: registered new interface driver usbserial_generic
[   15.229975] usbserial: USB Serial support registered for generic
[   15.789993] usbcore: registered new interface driver option
[   15.790352] usbserial: USB Serial support registered for GSM modem (1-port)
[   15.791505] usb 2-1.2: GSM modem (1-port) converter now attached to ttyUSB0
[   15.792227] usb 2-1.2: GSM modem (1-port) converter now attached to ttyUSB1
[   15.792969] usb 2-1.2: GSM modem (1-port) converter now attached to ttyUSB2
[  216.779477] usb 2-1.2: USB disconnect, device number 3
[  225.380957] usb 2-1.2: new full-speed USB device number 4 using ehci-pci
[  225.477675] usb 2-1.2: New USB device found, idVendor=12d1, idProduct=1001
[  225.477683] usb 2-1.2: New USB device strings: Mfr=3, Product=2, SerialNumber=0
[  225.477689] usb 2-1.2: Product: HUAWEI Mobile
[  225.477695] usb 2-1.2: Manufacturer: HUAWEI Technology
[  225.479391] usb-storage 2-1.2:1.0: USB Mass Storage device detected
[  225.479772] usb 2-1.2: GSM modem (1-port) converter now attached to ttyUSB0
[  225.479966] usb-storage 2-1.2:1.1: USB Mass Storage device detected
[  225.480261] usb 2-1.2: GSM modem (1-port) converter now attached to ttyUSB1
[  225.480396] usb-storage 2-1.2:1.2: USB Mass Storage device detected
[  225.480618] usb 2-1.2: GSM modem (1-port) converter now attached to ttyUSB2
So, when I try to call from asterisk I have error:

Code: Select all

option1 ttyUSB0: option_instat_callback: error -71

Josh
Site Admin
Posts: 6534
Joined: Sat Nov 03, 2007 12:30 am

Re: Huawei e1750 vs usb_modeswitch 2.2.0

Post by Josh » Tue Jan 20, 2015 7:14 pm

Looks like the modem has resetted to an undefined state.

Are you on an embedded platform?
Make sure the modem gets enough power. Wireless modems need juice!

I have an Intel NUC system which has problems delivering a stable current to my Huawei E398. Using an independently powered USB hub helps.

vzotov
Posts: 6
Joined: Thu Jan 15, 2015 4:02 pm

Re: Huawei e1750 vs usb_modeswitch 2.2.0

Post by vzotov » Wed Jan 21, 2015 8:32 am

Thank you for reply!

I try to connect my 3g modem via powered usb-hub and now usb_modeswitch doesn't see e1750 at all (log when I connect E1750):

Code: Select all

USB_ModeSwitch log from Wed Jan 21 10:28:20 2015

Use global config file: /etc/usb_modeswitch.conf


Started via upstart
Raw args from udev: 2-1.2/2-1.2.2

Use top device dir /sys/bus/usb/devices/2-1.2

USB dir exists: /sys/bus/usb/devices/2-1.2
Warning: USB attribute "manufacturer" not readable.
Warning: USB attribute "serial" not readable.

SCSI dir exists: /sys/bus/usb/devices/2-1.2
Warning: SCSI attribute "vendor" not readable.
Warning: SCSI attribute "model" not readable.
Warning: SCSI attribute "rev" not readable.
Use interface /sys/bus/usb/devices/2-1.2/2-1.2:1.0
----------------
USB values from sysfs:
  idVendor      1a40
  idProduct     0201
  manufacturer  (null)
  product       USB 2.0 Hub [MTT]
  serial        (null)
  bNumConfigurations    1
----------------
bNumConfigurations is 1 - don't check for active configuration
Found packed config collection /usr/share/usb_modeswitch/configPack.tar.gz
Searching entries named: /usr/share/usb_modeswitch/1a40:0201*
Searching overriding entries named: /etc/usb_modeswitch.d/1a40:0201*
SCSI attributes not needed, move on.

Aargh! Config file missing for 1a40:0201! Exiting.
lsusb

Code: Select all

Bus 002 Device 009: ID 12d1:1001 Huawei Technologies Co., Ltd. E169/E620/E800 HSDPA Modem
Bus 002 Device 007: ID 1a40:0201 Terminus Technology Inc. FE 2.1 7-port Hub

vzotov
Posts: 6
Joined: Thu Jan 15, 2015 4:02 pm

Re: Huawei e1750 vs usb_modeswitch 2.2.0

Post by vzotov » Wed Jan 21, 2015 8:35 am

Josh wrote: Are you on an embedded platform?
I run Asus notebook with ubuntu server 14.04 i386 installed by myself.

Josh
Site Admin
Posts: 6534
Joined: Sat Nov 03, 2007 12:30 am

Re: Huawei e1750 vs usb_modeswitch 2.2.0

Post by Josh » Wed Jan 21, 2015 10:53 am

That is even stranger than before ...

The good thing is that the Huawei is in modem mode, so the mode switching has succeeded. However, the hub should never have triggered a usb_modeswitch run.

Have you altered the "rules" file of usb_modeswitch in any way?

What does "dmesg" show, right after the plug-in?

vzotov
Posts: 6
Joined: Thu Jan 15, 2015 4:02 pm

Re: Huawei e1750 vs usb_modeswitch 2.2.0

Post by vzotov » Wed Jan 21, 2015 11:21 am

Dmesg USB-hub plugged in

Code: Select all

[69839.277939] usb 2-1.2: new high-speed USB device number 18 using ehci-pci
[69839.370539] usb 2-1.2: New USB device found, idVendor=1a40, idProduct=0201
[69839.370548] usb 2-1.2: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[69839.370554] usb 2-1.2: Product: USB 2.0 Hub [MTT]
[69839.370985] hub 2-1.2:1.0: USB hub found
[69839.371140] hub 2-1.2:1.0: 7 ports detected
Dmesg E1750 plugged in

Code: Select all

[69905.384947] usb 2-1.2.3: new full-speed USB device number 19 using ehci-pci
[69905.497640] usb 2-1.2.3: New USB device found, idVendor=12d1, idProduct=1001
[69905.497648] usb 2-1.2.3: New USB device strings: Mfr=3, Product=2, SerialNumber=0
[69905.497654] usb 2-1.2.3: Product: HUAWEI Mobile
[69905.497660] usb 2-1.2.3: Manufacturer: HUAWEI Technology
[69905.499391] usb-storage 2-1.2.3:1.0: USB Mass Storage device detected
[69905.499601] option 2-1.2.3:1.0: GSM modem (1-port) converter detected
[69905.499782] usb 2-1.2.3: GSM modem (1-port) converter now attached to ttyUSB0
[69905.499957] usb-storage 2-1.2.3:1.1: USB Mass Storage device detected
[69905.500068] option 2-1.2.3:1.1: GSM modem (1-port) converter detected
[69905.500297] usb 2-1.2.3: GSM modem (1-port) converter now attached to ttyUSB1
[69905.500449] usb-storage 2-1.2.3:1.2: USB Mass Storage device detected
[69905.500609] option 2-1.2.3:1.2: GSM modem (1-port) converter detected
[69905.500764] usb 2-1.2.3: GSM modem (1-port) converter now attached to ttyUSB2
[69906.559899] init: usb-modeswitch-upstart main process (13187) terminated with status 1
Have you altered the "rules" file of usb_modeswitch in any way?
No

Josh
Site Admin
Posts: 6534
Joined: Sat Nov 03, 2007 12:30 am

Re: Huawei e1750 vs usb_modeswitch 2.2.0

Post by Josh » Wed Jan 21, 2015 1:21 pm

usb-storage 2-1.2.3:1.0: USB Mass Storage device detected
option 2-1.2.3:1.0: GSM modem (1-port) converter detected


This is completely bogus. One interface, two drivers ...

Please post the output of "lsusb -v -d 12d1:1001" so that we can see the exact USB setup of the device.

Post Reply