0

I'm trying to configure the PC to connect to the Internet over Huawei modem when it's started. However, after start, the modem is recognized as Mass storage device. I can switch it to correct mode by running

sudo usb_modeswitch -v 12d1 -p 14fe -J 

I need the modem to work from start, so I figured out that I need to add the following to /etc/usb_modeswitch.conf:

DefaultVendor=0x12d1
DefaultProduct=0x14fe

TargetVendor=0x12d1
TargetProduct=0x1506
HuaweiNewMode=1

This works when I load the configuration file by running sudo usb_modeswitch -c /etc/usb_modeswitch.conf, but not when computer starts. Anybody knows how to apply the configuration on startup?

UPDATE: I tried also adding the following line to /lib/udev/rules.d/40-usb_modeswitch.rules:

ATTR{idVendor}=="12d1", ATTR{idProduct}=="14fe", RUN+="usb_modeswitch '%b/%k'"

or

ATTR{idVendor}=="12d1", ATTR{idProduct}=="14fe", RUN+="usb_modeswitch -v 12d1 -p 14fe -J"

I still can't get it to work.

0

I did it by running the usb_modeswitch command from a startup script, as described in How to run a script during boot as root (highest rated answer). One of the commenters states that this won't work on Ubuntu 16.04 or later, but in my case it does.

I know that this solution may seem "dirty" to some, but I already spent too much time trying to do it the "proper" way.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.