I've recently purchased a Wifi Dongle containing a Realtek rtl8811CU chipset. I'm using Ubuntu 18.04 LTS.
Luckily, after finding this Github repo, I could compile it and install the driver without any problem.
However, every time I connect the dongle, is detected as a Disk, and I need to run usb_modeswitch to make it work:
$ lsusb
[...]
Bus 001 Device 013: ID 0bda:1a2b Realtek Semiconductor Corp.
$ sudo usb_modeswitch -KW -v 0bda -p 1a2b
$ lsusb
[...]
Bus 001 Device 014: ID 0bda:c811 Realtek Semiconductor Corp.
The device ID changes and now I can correctly use my Wifi dongle.
I've tried to add this entry, to the udev rules, located in /lib/udev/rules.d/40-usb_modeswitch.rules, supposedly to run the command every time the device is detected:
# Realtek 8211CU Wifi AC USB
ATTR{idVendor}=="0bda", ATTR{idProduct}=="1a2b", RUN+="usb_modeswitch '/%k'"
But then I recconect, and nothing happens.
I've checked that maybe you need a service to do this, but it seems that cannot be activated.
$ systemctl --all | grep usb_modeswitch
● [email protected] loaded failed failed USB_ModeSwitch_1-4.1
system-usb_modeswitch.slice loaded active active system-usb_modeswitch.slice
$ systemctl status [email protected]
● [email protected] - USB_ModeSwitch_1-4.1
Loaded: loaded (/lib/systemd/system/[email protected]; static; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2018-10-04 11:49:17 CDT; 2min 5s ago
Docs: man:usb_modeswitch_dispatcher(1)
Process: 32216 ExecStart=/usr/sbin/usb_modeswitch_dispatcher --switch-mode 1-4.1 (code=exited, status=1/FAILURE)
Main PID: 32216 (code=exited, status=1/FAILURE)
oct 04 11:49:17 systemd[1]: Starting USB_ModeSwitch_1-4.1...
oct 04 11:49:17 usb_modeswitch_dispatcher[32216]: Could not read attribute: No such file or directory
oct 04 11:49:17 usb_modeswitch_dispatcher[32216]: Could not read attribute: No such file or directory
oct 04 11:49:17 systemd[1]: [email protected]: Main process exited, code=exited, status=1/FAILURE
oct 04 11:49:17 systemd[1]: [email protected]: Failed with result 'exit-code'.
oct 04 11:49:17 systemd[1]: Failed to start USB_ModeSwitch_1-4.1.
Seems that there is a problem with the Ubuntu wrapper, does anyone knows how I can investigate further? I'm new to systemd and udev rules, so I'm not really sure where to find more logs or debug features.