I am using a Huawei LTE modem which requires usb_modeswitch to switch the mode of the USB in order to detect the device as a modem.(Ubuntu Core on Dragonboard410c)
In a classical ubuntu system, I would add the udev rule as the following in /etc/udev/rules.d/70-huawei-e3372.rules
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1f01", RUN+="/usr/sbin/usb_modeswitch -v 12d1 -p 1f01 -M '55534243123456780000000000000a11062000000000000100000000000000'"
However, usb_modeswitch was installed using apt, so the package does not exist in /usr/sbin/usb_modeswitch
but in /var/snap/classic/common/classic/usr/sbin/usb_modeswitch
Therefore, tried adding the rule
ACTION=="add", SUBSYSTEM=="block", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1f01", RUN+="/var/snap/classic/common/classic/usr/sbin/usb_modeswitch -v 12d1 -p 1f01 -M '55534243123456780000000000000a11062000000000000100000000000000'"
SUBSYSTEM=="block", ATTRS{idVendor}=="12d1"
However, the device is not loaded properly.
As I cannot run the application directly with
$ /var/snap/classic/common/classic/usr/sbin/usb_modeswitch
/var/snap/classic/common/classic/usr/sbin/usb_modeswitch: error while loading shared libraries: libusb-1.0.so.0: cannot open shared object file: No such file or directory
As I can see that libusb-1.0.so.0
is located in /var/snap/classic/common/classic/lib/aarch64-linux-gnu
, I am suspecting when a package is installed in the classic snap, the udev cannot access the file in the classic snap.
How can I resolve this? Could anyone help in resolving this issue?
Thank you in advance,