Skip to content

Instantly share code, notes, and snippets.

@ryankurte
Last active June 11, 2018 21:17
Show Gist options
  • Save ryankurte/55d2c348b89792188852 to your computer and use it in GitHub Desktop.
Save ryankurte/55d2c348b89792188852 to your computer and use it in GitHub Desktop.
Enable Huawei K4203 Cellular Internet dongle on Linux
TargetVendor=0x12d1
TargetProduct=0x1f1c
MessageContent="55534243123456780000000000000011062000000101000100000000000000"
ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1f1c", RUN+="usb_modeswitch '%b/%k'"
#!/bin/bash
#Install udev rule
cp ./12d1\:1f1c /etc/usb_modeswitch.d/
#Install usb modeswitch rule
cp ./40-usb_modeswitch.rules /etc/udev/rules.d/
@webworxshop
Copy link

On Raspbian Stretch usb_modeswitch seems not to be able to identify the device correctly using this method. Specifying the options directly to the command works, as follows:

ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1f1c", RUN+="/usr/sbin/usb_modeswitch -v 12d1 -p 1f1c -M 55534243123456780000000000000011062000000101000100000000000000"

@ryanteck
Copy link

Just to add I have the same issue, running it as @webworxshop recommends works. This goes into the 40-usb_modeswitch.rules file for anyone interested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment