Home / Alt manpages / usb_modeswitch_dispatcher(1)

  • usb_modeswitch_dispatcher(1)
  • User command
  • linux

Troubleshoot usb_modeswitch_dispatcher through udev

You will learn how to check the automatic USB_ModeSwitch path on a Linux system, find the device identity that controls it, and separate a missing configuration from a failed mode switch. The key result is a safe diagnosis: usb_modeswitch_dispatcher remains an integration helper, while usb_modeswitch is the tool intended for deliberate manual testing.

Allow about fifteen minutes. You need a shell, the usb-modeswitch package, the matching usb-modeswitch-data package, and access to the USB device. Some checks are ordinary user commands. Mode switching itself can disconnect storage or network interfaces and normally needs elevated privileges.

1. Confirm the installed components

Start with read-only checks. This machine has Ubuntu's usb-modeswitch package version 2.6.1-3ubuntu3 and data package version 20191128-6. Your versions may differ, so record them before comparing behaviour with another host.

$ dpkg-query -W -f='${Package} ${Version}\n' usb-modeswitch usb-modeswitch-data
usb-modeswitch 2.6.1-3ubuntu3
usb-modeswitch-data 20191128-6
$ command -v usb_modeswitch_dispatcher
/usr/sbin/usb_modeswitch_dispatcher
$ usb_modeswitch --version
 * usb_modeswitch: handle USB devices with multiple modes
 * Version 2.6.1 (C) Josua Dietze 2017

The data package matters. The dispatcher selects device information from the installed configuration set; installing only the core binary does not provide the same automatic coverage.

Checkpoint

If either package is missing, stop here and use your normal package-management process. Do not copy a random configuration file from another machine.

2. Understand the boundary between the two commands

The dispatcher is called by udev. Its manual page says it checks a device, selects a configuration, and then uses the Linux-independent usb_modeswitch binary. It may also try to load and bind the option serial driver to vendor-specific interfaces when no driver has claimed them.

That makes the dispatcher part of a chain, not a useful interactive interface. Running it without the udev arguments can produce an internal usage error on the installed release. Treat that as a reminder of its contract, not as a test of whether your modem is supported.

$ man usb_modeswitch_dispatcher
$ man usb_modeswitch

For a normal plug-in, udev sees the initial USB identity, invokes the helper, and the helper arranges for the dispatcher to run with device-specific context. The initial device often presents as USB storage; after switching, it may reappear as a modem or another composite device.

3. Capture the device identity

Insert the device and inspect its current identity without changing it. lsusb is an ordinary command and does not need sudo on a typical installation.

$ lsusb
Bus 001 Device 007: ID 12d1:1446 Example USB device

Record the hexadecimal vendor and product IDs, here 12d1:1446. The model name is less reliable than the IDs because vendors reuse names across firmware revisions and rebranded hardware. Run lsusb again after a switch: a successful transition commonly changes the product ID or the interfaces shown.

To watch the event path without modifying anything, use the udev monitor in a second terminal:

$ udevadm monitor --kernel --udev --property

Now unplug and reconnect the device. Stop the monitor with Ctrl-C when you have captured the relevant event. Do not repeatedly reconnect a device that is behaving erratically; USB power cycling can interrupt an active connection.

4. Check whether the data package knows the initial ID

On Debian-family systems, device configurations are normally under /usr/share/usb_modeswitch and custom configurations belong under /etc/usb_modeswitch.d. Search the installed data without editing it:

$ test -d /usr/share/usb_modeswitch && \
  find /usr/share/usb_modeswitch -maxdepth 1 -type f -name '12d1:1446*' -print
/usr/share/usb_modeswitch/12d1:1446

Replace 12d1:1446 with the IDs from your own output. A matching file is evidence that the automatic path has a device record. No match means the installed data may not support this exact initial identity. It does not prove that the hardware cannot be switched.

Checkpoint

Do not create a file merely because the filename looks right. A mode-switch message is device-specific and can leave hardware in an unexpected state.

5. Inspect service and journal results

This package installs a systemd template at [email protected]. The udev helper starts the appropriate instance on systemd systems. Check recent messages after reconnecting the device:

$ systemctl list-units 'usb_modeswitch@*.service' --all
$ journalctl -b -u 'usb_modeswitch@*.service' --no-pager
$ journalctl -b --grep='usb_modeswitch' --no-pager

These are read-only diagnostics. An empty service list is not automatically a fault: the unit is a one-shot service and may already have finished. Look for the device instance, an exit status, and whether a target device appeared afterwards.

If the journal is quiet, inspect the kernel's USB messages around the reconnect:

$ journalctl -b -k --since '5 minutes ago' --no-pager

Use a suitable time window for your host. Avoid pasting the entire journal into a support ticket if it contains unrelated device names or serial information.

6. Test manually only when you accept the risk

Manual mode switching is for testing and analysis. The core command can send USB control or bulk messages, detach drivers, reset a USB device, and make a storage or network interface disappear. Before using it, save work that depends on the device and disconnect anything you cannot afford to interrupt.

Read the installed option list first:

$ usb_modeswitch --help
$ man usb_modeswitch

The documented manual workflow uses a device configuration with -c, or explicit vendor and product information plus the required switching method. Do not invent a message string. If a known configuration exists, inspect it and use the package's documented data as the basis for a controlled test. Run the switching command with sudo only when you have verified the exact device and configuration.

There is no general undo command. Unplugging and reconnecting may restore the initial state, but some devices retain their mode or require a hardware reset. Keep the original configuration and device available, and do not test against an important production connection.

7. Interpret the common outcomes

  • No matching data file: check the exact initial IDs, then consult the project's device data or support channel. Do not guess a configuration.
  • A matching file but no switch: inspect udev and journal events, driver binding, permissions, and whether another process claimed the device first.
  • The device changes identity but no serial port appears: check the new lsusb output and kernel messages. The dispatcher may have attempted the option binding fallback, but its manual page explicitly says this may or may not work.
  • The device disappears: wait briefly, inspect lsusb and the kernel journal, then reconnect it. Do not immediately repeat a risky command.

A successful dispatcher run means the wrapper completed its work. It does not prove that a usable modem, network interface, or serial port has been created. Verify the interface that your application actually needs.

Done means

  • You recorded the installed core and data package versions.
  • You let udev invoke the dispatcher and used read-only tools to inspect the result.
  • You matched the initial USB IDs against installed data instead of guessing.
  • You checked service, udev, and kernel evidence after reconnecting the device.
  • Any manual test used the core command with a verified configuration and an explicit recovery plan.
  • You confirmed the final interface your workload needs, not merely a zero exit status.