0

I have a 3G USB dongle (Huawei K3715) for receiving SMS. After each reboot it changes the interface names. I wrote a udev rule but it is not working. I don't know why. Can you have a look and say what is wrong?

Thanks.

lsusb:

Bus 002 Device 002: ID 12d1:1001 Huawei Technologies Co., Ltd. E169/E620/E800 HSDPA Modem

/etc/udev/rules.d/20_3gusb-local.rules:

ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1001", ATTRS{bInterfaceNumber}=="00", SYMLINK+="smsphone"

I restart the rules daemon with udevadm control --reload-rules or reboot it doesn't create a symlink /dev/smsphone

3

So I had my difficulties. The problem is that the UDEV rule does not work like this. You can not mix-and-match attributes from multiple parent devices.

But with this trick (seperate idVendor/idProdct and bInterfaceNumber) I've found on net it works.

# /etc/udev/rules.d/40_umts.rules
# Symlink generating for UMTS-Stick

ACTION!="add", GOTO="umts_rules_end"
SUBSYSTEM!="tty" GOTO="umts_rules_end"

ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1001", GOTO="umts_rules_begin"
GOTO="umts_rules_end"
LABEL="umts_rules_begin"

# generating SYMLINKs 
ATTRS{bInterfaceNumber}=="00", SYMLINK+="smsphone"

LABEL="umts_rules_end"

Update (12.04.2017)

I have found a clearer solution based on this post that I would like to share. ;-)

# /etc/udev/rules.d/40_umts.rules
# Symlink generating for UMTS-Stick

# note bInterfaceNumber
SUBSYSTEMS=="usb", ENV{.LOCAL_ifNum}="$attr{bInterfaceNumber}"

# adding symlink for modem
SUBSYSTEM=="tty", ACTION=="add", \
    ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1001", \
    ENV{.LOCAL_ifNum}=="00", SYMLINK+="smsphone"

# adding symlink for modem diag
SUBSYSTEM=="tty", ACTION=="add", \
    ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1001", \
    ENV{.LOCAL_ifNum}=="01", SYMLINK+="modem_diag"

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.