Automatic Activation, Hotplug and UDEV, Configuration
Post Reply
SimonJ
Posts: 3
Joined: 02 Jul 2011, 00:33
Location: Clanwilliam, South Africa

SOLVED : Manual works, Automatic Don't Huawei K3770

Post by SimonJ » 02 Jul 2011, 22:33

I have Ubuntu 11.04, I can manually switch my Huawei K3770 modem with the command:

sudo usb_modeswitch -v 0x12d1 -p 0x14d1 -c /home/USER/12d1:14d1

Then I need to do the command:

sudo modprobe usbserial vendor=0x12d1 product=0x14c9

And the modem works fine. I would like it to work automatically when I plug in the modem. I have followed various Forum posts and this is what I have done:

1. My config file "12d1:14d1" is in the /usr/share/usb_modeswitch directory as part of the compressed file configpack.tar.gz

2. I have modified the /lib/udev/ruled.d/40-usb_modeswitch.rules with the following line

# Vodafone (Huawei) K3770
ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="14d1", RUN+="usb_modeswitch '%b/%k'"

3. I have enabled logging on both udev.conf and /etc/usb_modeswitch.conf. This is what the logfile says for /var/log/usb_modeswitch_1-7:1.0 :


USB_ModeSwitch log from Sat Jul 02 16:59:31 SAST 2011

raw args from udev: /1-7: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-7:1.0) ...
USB dir exists: /sys/bus/usb/devices/1-7
Warning: USB attribute "serial" not found.
----------------
USB values from sysfs:
manufacturer HUAWEI
product Vodafone Mobile Broadband (Huawei)
serial
----------------
Found packed config collection /usr/share/usb_modeswitch/configPack.tar.gz
Searching overriding entries named: /etc/usb_modeswitch.d/12d1:14d1*
SCSI attributes not needed, moving on
checking config: 12d1:14d1/etc/usb_modeswitch.d/12d1:14d1
Extracting config 12d1:14d1/etc/usb_modeswitch.d/12d1:14d1 from collection /usr/share/usb_modeswitch/configPack.tar.gz

These are the relevant lines from /var/log/syslog:


Jul 2 16:59:31 Simon udevd-work[534]: RUN 'usb_modeswitch '%b/%k'' /lib/udev/rules.d/40-usb_modeswitch.rules:329
Jul 2 16:59:31 Simon udevd-work[534]: RUN '/sbin/modprobe -bv $env{MODALIAS}' /lib/udev/rules.d/80-drivers.rules:5
Jul 2 16:59:31 Simon udevd-work[534]: 'usb_modeswitch '/1-7:1.0'' started
Jul 2 16:59:31 Simon udevd-work[534]: '/lib/udev/usb_modeswitch' (stderr) '/lib/udev/usb_modeswitch: 33: '
Jul 2 16:59:31 Simon udevd-work[534]: '/lib/udev/usb_modeswitch' (stderr) 'arithmetic expression: expecting EOF: "0x"'
Jul 2 16:59:31 Simon udevd-work[534]: '/lib/udev/usb_modeswitch' (stderr) '/lib/udev/usb_modeswitch: 33: '
Jul 2 16:59:31 Simon udevd-work[534]: '/lib/udev/usb_modeswitch' (stderr) 'arithmetic expression: expecting EOF: "0x"'
Jul 2 16:59:32 Simon udevd-work[534]: 'usb_modeswitch '/1-7:1.0'' returned with exitcode 0


Thanks.
Last edited by SimonJ on 03 Jul 2011, 15:43, edited 1 time in total.

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

Post by Josh » 03 Jul 2011, 09:30

There is a little bug in a Debian patch for usb_modeswitch (version 1.1.7).

I suggest that you use the current source version from this site (1.1.8) with the current data package (20110619) which includes the K3770. It's easy to install; if you should need instructions, see the main doc page.


SimonJ
Posts: 3
Joined: 02 Jul 2011, 00:33
Location: Clanwilliam, South Africa

Thanks : Solved

Post by SimonJ » 03 Jul 2011, 15:42

uninstalled version 1.1.7
compiled 1.1.8

Everything works! Thanks.

Just a note : 12d1:14d1config file wasn't yet included in the /usr/share/usb_modeswitch/ directory.

I also still needed to modify the /lib/udev/rules.d/40-usb_modeswitch.rules file

Regards

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

Post by Josh » 03 Jul 2011, 16:09

Did you install the data package as well?

As I said, the current version is 20110619.

SimonJ
Posts: 3
Joined: 02 Jul 2011, 00:33
Location: Clanwilliam, South Africa

Data package

Post by SimonJ » 03 Jul 2011, 19:04

Yes, downloaded the usb-modeswitch-data-20110619 and did a:

sudo make install

after uninstalling the original "usb-modeswitch-data" via Synaptic


If you want the 12d1:14d1 file I can email

thanks

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

Post by Josh » 03 Jul 2011, 20:06

Turns out you are right. Somehow this device has escaped.

I know I have prepared it for inclusion ... Oh well ...

Thanks for the notice.

Post Reply