Automatic Activation, Hotplug and UDEV, Configuration
Post Reply
thomasschaefer
Posts: 114
Joined: 17 Jul 2011, 12:08

Huawei E398

Post by thomasschaefer » 12 Apr 2012, 17:32

Today I switched from manually to automatic.

I added some entries in my udev-rules
(taken from your newest data-set)
/lib/udev/rules.d/40-usb_modeswitch.rules

Code: Select all

# Huawei EC156                                                                                  
ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1505", RUN+="usb_modeswitch '%b/%k'" 
in
/etc/usb_modeswitch.d/12d1:1505

I added the DefaultVendor and DefaultProdukt. Without, it did not work.

Code: Select all

# Huawei EC156

DefaultVendor=  0x12d1
DefaultProduct= 0x1505

TargetVendor=  0x12d1
TargetProductList="140b,1506,150f"

MessageContent="55534243123456780000000000000011062000000100000000000000000000"

The result is:

USB_ModeSwitch log from Thu Apr 12 17:07:48 CEST 2012

raw args from udev: /1-3:1.0

Using global config file: /etc/usb_modeswitch.conf
Bus ID for device not given by udev.
Trying to determine it from kernel name (1-3:1.0) ...
USB dir exists: /sys/bus/usb/devices/1-3
Warning: USB attribute "serial" not found.
----------------
USB values from sysfs:
manufacturer Huawei Technologies
product HUAWEI Mobile
serial
----------------
SCSI attributes not needed, moving on
checking config: /etc/usb_modeswitch.d/12d1:1505
ConfigGet returns /etc/usb_modeswitch.d/12d1:1505
! matched, now switching
(running command: /usr/sbin/usb_modeswitch -I -W -c /etc/usb_modeswitch.d/12d1:1505)

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

Reading config file: /etc/usb_modeswitch.d/12d1:1505

* usb_modeswitch: handle USB devices with multiple modes
* Version 1.1.6 (C) Josua Dietze 2010
* Based on libusb0 (0.1.12 and above)

! PLEASE REPORT NEW CONFIGURATIONS !

DefaultVendor= 0x12d1
DefaultProduct= 0x1505
TargetVendor= 0x12d1
TargetProduct= not set
TargetClass= not set
TargetProductList="140b,1506,150f"

DetachStorageOnly=0
HuaweiMode=0
SierraMode=0
SonyMode=0
GCTMode=0
KobilMode=0
MessageEndpoint= not set
MessageContent="55534243123456780000000000000011062000000100000000000000000000"
NeedResponse=0
ResponseEndpoint= not set
Interface=0x00

InquireDevice disabled
Success check disabled
System integration mode enabled


Looking for target devices ...
searching devices, found USB ID 12d1:1505
found matching vendor ID
searching devices, found USB ID 0951:1606
searching devices, found USB ID eb1a:2761
searching devices, found USB ID 1d6b:0002
searching devices, found USB ID 1d6b:0001
searching devices, found USB ID 1d6b:0001
searching devices, found USB ID 1d6b:0001
searching devices, found USB ID 1d6b:0001
No devices in target mode or class found
Looking for default devices ...
searching devices, found USB ID 12d1:1505
found matching vendor ID
found matching product ID
adding device
searching devices, found USB ID 0951:1606
searching devices, found USB ID eb1a:2761
searching devices, found USB ID 1d6b:0002
searching devices, found USB ID 1d6b:0001
searching devices, found USB ID 1d6b:0001
searching devices, found USB ID 1d6b:0001
searching devices, found USB ID 1d6b:0001
Found devices in default mode, class or configuration (1)
Accessing device 006 on bus 001 ...
Getting the current device configuration ...
OK, got current device configuration (1)
Using endpoints 0x01 (out) and 0x81 (in)
Using endpoints 0x01 (out) and 0x81 (in)

USB description data (for identification)
-------------------------
Manufacturer: Huawei Technologies
Product: HUAWEI Mobile
Serial No.: not provided
-------------------------
Looking for active driver ...
OK, driver found ("dummy")
OK, driver "dummy" detached
Setting up communication with interface 0 ...
Using endpoint 0x01 for message sending ...
Trying to send message 1 to endpoint 0x01 ...
libusb:error [op_clear_halt] clear_halt failed error -1 errno 71
OK, message successfully sent
Resetting response endpoint 0x81
Error resetting endpoint: -34
Resetting message endpoint 0x01
Error resetting endpoint: -6
Device is gone, skipping any further commands
-> Run lsusb to note any changes. Bye.

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


All done, exiting



The only thing, that is still ugly. the device manager at the kde-gui pops up twice.


Regards,
Thomas
Last edited by thomasschaefer on 12 Apr 2012, 19:28, edited 2 times in total.

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

Re: Huawei E398

Post by Josh » 12 Apr 2012, 19:22

Good news!

Are you using the new network driver or a standard serial port?
thomasschaefer wrote:in /etc/usb_modeswitch.d/12d1:1505
I added the DefaultVendor and DefaultProdukt. Without it did not work.
The "concise" format of config files needs usb_modeswitch version 1.2.1 and up. See the change log of the data package.


thomasschaefer
Posts: 114
Joined: 17 Jul 2011, 12:08

Re: Huawei E398

Post by thomasschaefer » 12 Apr 2012, 19:52

Josh wrote:Good news!
Are you using the new network driver or a standard serial port?
Since the weekend opensuse has the Kernel 3.4.0-rc2 in its HEAD-Repository. Therefore I can use the wwan-mode also on my regular netbook, not only on my test-device.
So far no problems.

Connecting is now very fast.

udev/usb_modeswitch set the device to the correct mode and another script, calling qmi-ifupdown, dhcpcd and aiccu(for sixxs) configures ipv4 and the ipv6-tunnel.

For native IPv6 I hope to get more informations at the IPv6-Kongress in Frankfurt a.M. next month.

Josh wrote:
thomasschaefer wrote:in /etc/usb_modeswitch.d/12d1:1505
I added the DefaultVendor and DefaultProdukt. Without it did not work.
The "concise" format of config files needs usb_modeswitch version 1.2.1 and up. See the change log of the data package.
Ok. The reason for the quite old version is: I don't like the risk to destroy udev/usb_modeswich-rules at my system. I have bad experiences at this point. I trust the distributor, knowing that this includes sometimes old releases. Sorry for the obsolete hint.

Regards,
Thomas

Post Reply