1

I'm troubleshooting a usb_modeswitch failure on Ubuntu 20.04.

Here is the output of various commands. None of them really detail why the failure.

Do you have any idea how to fix usb_modeswitch?

$ systemctl --failed

  UNIT                           LOAD      ACTIVE SUB    DESCRIPTION           
● [email protected] loaded    failed failed USB_ModeSwitch_1-1.3.2

$ systemctl status [email protected]

[email protected] - USB_ModeSwitch_1-1.3.2
     Loaded: loaded (/lib/systemd/system/[email protected]; static; vendor preset: enabled)
     Active: failed (Result: exit-code) since Wed 2020-10-28 12:15:13 PDT; 25min ago
       Docs: man:usb_modeswitch_dispatcher(1)
    Process: 3680020 ExecStart=/usr/sbin/usb_modeswitch_dispatcher --switch-mode 1-1.3.2 (code=exited, status=1/FAILURE)
   Main PID: 3680020 (code=exited, status=1/FAILURE)

Oct 28 12:15:13 Satellite-E55 systemd[1]: Starting USB_ModeSwitch_1-1.3.2...
Oct 28 12:15:13 Satellite-E55 systemd[1]: [email protected]: Main process exited, code=exited, status=1/FAILURE
Oct 28 12:15:13 Satellite-E55 systemd[1]: [email protected]: Failed with result 'exit-code'.
Oct 28 12:15:13 Satellite-E55 systemd[1]: Failed to start USB_ModeSwitch_1-1.3.2.

$ grep modeswitch /var/log/syslog

Oct 28 11:46:05 Satellite-E55 systemd[1]: Starting USB_ModeSwitch_1-1.3.2...
Oct 28 11:46:05 Satellite-E55 systemd[1]: [email protected]: Main process exited, code=exited, status=1/FAILURE
Oct 28 11:46:05 Satellite-E55 systemd[1]: [email protected]: Failed with result 'exit-code'.
Oct 28 11:46:05 Satellite-E55 systemd[1]: Failed to start USB_ModeSwitch_1-1.3.2.

$ sudo systemctl start [email protected]

Job for [email protected] failed because the control process exited with error code.
See "systemctl status [email protected]" and "journalctl -xe" for details.

$ journalctl -xe

Oct 28 12:15:13 Satellite-E55 systemd[1]: Starting USB_ModeSwitch_1-1.3.2...
-- Subject: A start job for unit [email protected] has begun execution
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- A start job for unit [email protected] has begun execution.
-- 
-- The job identifier is 50559.
Oct 28 12:15:13 Satellite-E55 systemd[1]: [email protected]: Main process exited, code=exited, status=1/FAILURE
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- An ExecStart= process belonging to unit [email protected] has exited.
-- 
-- The process' exit code is 'exited' and its exit status is 1.
Oct 28 12:15:13 Satellite-E55 systemd[1]: [email protected]: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- The unit [email protected] has entered the 'failed' state with result 'exit-code'.
Oct 28 12:15:13 Satellite-E55 systemd[1]: Failed to start USB_ModeSwitch_1-1.3.2.
-- Subject: A start job for unit [email protected] has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- A start job for unit [email protected] has finished with a failure.
-- 
-- The job identifier is 50559 and the job result is failed.
Oct 28 12:15:13 Satellite-E55 sudo[3680017]: pam_unix(sudo:session): session closed for user root

$ lsusb

Bus 001 Device 004: ID 04ca:7017 Lite-On Technology Corp. 
Bus 001 Device 008: ID 8087:07dc Intel Corp. 
Bus 001 Device 020: ID 046d:0a0e Logitech, Inc. 
Bus 001 Device 021: ID 051d:0002 American Power Conversion Uninterruptible Power Supply
Bus 001 Device 019: ID 03f0:032a HP, Inc 
Bus 001 Device 018: ID 05e3:0607 Genesys Logic, Inc. Logitech G110 Hub
Bus 001 Device 002: ID 8087:8000 Intel Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 026: ID 0480:a00c Toshiba America Inc 
Bus 003 Device 025: ID 0bda:0411 Realtek Semiconductor Corp. 
Bus 003 Device 024: ID 0bda:0411 Realtek Semiconductor Corp. 4-Port USB 3.0 Hub
Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 005: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 002 Device 007: ID 0bda:5411 Realtek Semiconductor Corp. 
Bus 002 Device 006: ID 0bda:5411 Realtek Semiconductor Corp. 4-Port USB 2.0 Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
7
  • @nobody I don't know what "fishing" is... but I don't believe that I have any USB devices that need a mode switch. I'll add lsusb to my question.
    – heynnema
    Oct 28, 2020 at 21:27
  • In /etc/usb_modeswitch.conf can you enable loging. I don't see any device that needs to be swicht in modem mode either.
    – nobody
    Oct 28, 2020 at 21:42
  • @nobody Thanks for the .conf info. I tried changing a few options, like logging, etc., and it didn't give me any more info than I already had. Based on the service name, I suspect that 1-1.3.2 is the udev device number, but I don't know what to do with that.
    – heynnema
    Oct 28, 2020 at 22:27
  • Can you search for entries modem manager in journal l have errors from it for not existing modem on my focal system
    – nobody
    Oct 28, 2020 at 22:47
  • @nobody I updated my question with that info.
    – heynnema
    Oct 28, 2020 at 23:29

2 Answers 2

2

Update #1: The following worked until I deleted the HP USB printer definition in the Printer Settings panel, and tried to re-add the HP USB printer. The HP USB port was not seen. I had to un-comment my fix, below, and reboot. Then I could add the HP USB printer back.


I found the problem!

usb_modeswitch was trying to flip my HP printer!

Here's the clue...

$ systemctl --failed

  UNIT                           LOAD      ACTIVE SUB    DESCRIPTION           
● [email protected] loaded    failed failed USB_ModeSwitch_1-1.3.2

The 1-1.3.2 is the USB address of the failing device. So which device is that?

$ lsusb -tv

/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 5000M
    ID 1d6b:0003 Linux Foundation 3.0 root hub
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 5000M
        ID 0bda:0411 Realtek Semiconductor Corp. 
        |__ Port 4: Dev 3, If 0, Class=Hub, Driver=hub/4p, 5000M
            ID 0bda:0411 Realtek Semiconductor Corp. 
            |__ Port 4: Dev 4, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
                ID 0480:a00c Toshiba America Inc 
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/9p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
        ID 0bda:5411 Realtek Semiconductor Corp. 
        |__ Port 4: Dev 4, If 0, Class=Hub, Driver=hub/4p, 480M
            ID 0bda:5411 Realtek Semiconductor Corp. 
    |__ Port 2: Dev 3, If 2, Class=Human Interface Device, Driver=usbhid, 12M
        ID 046d:c52b Logitech, Inc. Unifying Receiver
    |__ Port 2: Dev 3, If 0, Class=Human Interface Device, Driver=usbhid, 12M
        ID 046d:c52b Logitech, Inc. Unifying Receiver
    |__ Port 2: Dev 3, If 1, Class=Human Interface Device, Driver=usbhid, 12M
        ID 046d:c52b Logitech, Inc. Unifying Receiver
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/2p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/8p, 480M
        ID 8087:8000 Intel Corp. 
        |__ Port 3: Dev 3, If 0, Class=Hub, Driver=hub/4p, 480M
            ID 05e3:0607 Genesys Logic, Inc. Logitech G110 Hub
            |__ Port 3: Dev 6, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
                ID 051d:0002 American Power Conversion Uninterruptible Power Supply
            |__ Port 4: Dev 7, If 2, Class=Human Interface Device, Driver=usbhid, 12M
                ID 046d:0a0e Logitech, Inc. 
            |__ Port 4: Dev 7, If 0, Class=Audio, Driver=snd-usb-audio, 12M
                ID 046d:0a0e Logitech, Inc. 
            |__ Port 4: Dev 7, If 1, Class=Audio, Driver=snd-usb-audio, 12M
                ID 046d:0a0e Logitech, Inc. 
            |__ Port 2: Dev 5, If 1, Class=Vendor Specific Class, Driver=, 480M
                ID 03f0:032a HP, Inc 
            |__ Port 2: Dev 5, If 0, Class=Printer, Driver=usblp, 480M
                ID 03f0:032a HP, Inc 
        |__ Port 5: Dev 8, If 0, Class=Wireless, Driver=btusb, 12M
            ID 8087:07dc Intel Corp. 
        |__ Port 5: Dev 8, If 1, Class=Wireless, Driver=btusb, 12M
            ID 8087:07dc Intel Corp. 
        |__ Port 8: Dev 4, If 0, Class=Video, Driver=uvcvideo, 480M
            ID 04ca:7017 Lite-On Technology Corp. 
        |__ Port 8: Dev 4, If 1, Class=Video, Driver=uvcvideo, 480M
            ID 04ca:7017 Lite-On Technology Corp

lsusb -tv shows that device 1-1.3.2 is my HP printer!

        |__ Port 2: Dev 5, If 0, Class=Printer, Driver=usblp, 480M
            ID 03f0:032a HP, Inc 

From lsusb we can see that my HP printer is device code:

Bus 001 Device 019: ID 03f0:032a HP, Inc 

So now we go to /lib/udev/rules.d/40-usb_modeswitch.rules and we find:

# HP LaserJet Professional P1102w
ATTR{idVendor}=="03f0", ATTR{idProduct}=="032a", RUN+="usb_modeswitch '/%k'"

which matches the device code of the HP printer.

We comment out the second line...

# HP LaserJet Professional P1102w
#ATTR{idVendor}=="03f0", ATTR{idProduct}=="032a", RUN+="usb_modeswitch '/%k'"

We reboot, and it's all fixed! usb_modeswitch no longer fails when trying to flip my HP printer!

1
  • great. I could solve my problem too.
    – nobody
    Oct 30, 2020 at 16:23
2

Since this is one of the first results in Google I will leave my solution here, even tho it's not exactly the same problem.

In my case, the problem actually lies in a bug on the usb_modeswitch itself that can be found here: https://bugs.launchpad.net/ubuntu/+source/usb-modeswitch/+bug/1866926?comments=all

Since ubuntu 20 comes with version 2.5.2 of modeswitch, the solution was commited on version 2.6.0, so upgrading should solve the issue.

This bug affects raspberry pi/usb hubs and other OS's apparently.

2
  • Okay bot, I don't know how to make it clearer: upgrade to 2.6.0. That's really it.
    – lucaswxp
    Sep 25, 2021 at 14:15
  • Thanks, had the same issue on Nvidia Jetpack 5.0.2 (Ubuntu 20.04) and D-Link DWA-X1850 Wifi USB Dongle (rtl8852au driver). This modem is recognised as USB mass storage device with windows driver first. Oct 7, 2022 at 17:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .