Anyone know how to configure usb_modeswitch? I have read the documentation and did not find it very useful.

I have the following device:

oshirowanen@laptop:~$ lsusb
Bus 001 Device 003: ID 19d2:0031 ONDA Communication S.p.A. ZTE MF636

I am using Ubuntu 10.04.2.

Basically, I don't want the device to be recognised as a usb storage device. I am having to manually eject the device before it automatically gets recognised as a usb broadband modem.


I am not sure that I completely understand your problem because according to usb_modeswitch your device is in the modem mode i.e the device ID 0x0031 is for modem.

This is from the device_reference.txt file available on usb_modeswitch site:

# ZTE MF622 (aka "Onda MDC502HS")
# ZTE MF626
# ZTE MF628+ (tested version from Telia / Sweden)
# ZTE MF633
# ZTE MF636 (aka "Telstra / BigPond 7.2 Mobile Card")
# ZTE MF637
# Contributor: Joakim Wennergren and others

DefaultVendor=  0x19d2
DefaultProduct= 0x2000

TargetVendor=   0x19d2
TargetProduct=  0x0031



As you can see the target ID for your device is 0x0031 which means that your device is in modem mode.

So if you are having this problem at system startup then try plugging your device in after the system boots into Ubuntu and not before.

But if you are having problem when reconnecting the device for example if it got disconnected because of a network problem, then you will need to unplug and replug the device.

I just installed usb_modeswitch and found out that all entries in the config file are commented. So open /etc/usb_modeswitch.conf and look for a line containing

;TargetProduct=  0x0031

Remove semi-colon (;) from start of the following lines

;DefaultVendor=  0x19d2
;DefaultProduct= 0x2000

;TargetVendor=   0x19d2
;TargetProduct=  0x0031

# only for reference
# MessageEndpoint=0x01


Now save and close this file. You will need sudo privileges for this. Now unplug and replug your device and I believe it should work. If it doesnt then comment the MessageContent line and un-comment (remove semi-colon) the second MessageContent line which is just below the first one.

| improve this answer | |
  • The problem is basically this. After getting into the desktop. If I plug in the device, it comes up on the desktop as a usb or cd drive which I can use as a normal storage location. I don't want this to happen when I plug in the device. When I plug in the device, I want it to be recognised as a modem. At the moment, I have to plug in the device, eject it, then it gets recognised as a modem. The lsusb I provided is after I have ejected the device, which I think means that I need to give you the output of lsusb before ejecting the device? – oshirowanen May 19 '11 at 10:44
  • I don't seem to have a usb_modeswitch.conf in /etc – oshirowanen May 19 '11 at 15:44
  • @oshirowanen: how did you install usb_modeswitch? In ubuntu usb_modeswitch is available in repo, so you can simply install it with 'sudo apt-get install usb-modeswitch' – binW May 19 '11 at 18:03
  • that is more or less what I did sudo aptitude install usb-modeswitch, and I have just done a sudo aptitude reinstall usb-modeswitch, but I still get no /etc/usb_modeswitch.conf. When I type usb_modeswitch in the terminal, it says can't find /etc/use_modeswitch.conf. – oshirowanen May 19 '11 at 18:25
  • I'm using Ubuntu 10.04.2, you're possibly using a different version of ubuntu? – oshirowanen May 19 '11 at 18:26

I have same problems with my modem on 12.04. All you have to do are the following things:

First install USB_modeswitch on your computer. Try to download it from Software Center or Synaptic package manager. Also check for libusb in synaptic.

Now check whether you have /etc/mod_switch.conf or /etc/mod_switch.d file. Don't worry about their content, just check whether they are on your system or not. If /etc/mod_switch.conf is not present then you can create it manually.

Now check the file in /usr/share/usb_modswitch you will find a tar file in it which contain some information about your device. Look for your device file in the tar file, you will get it there.

To know which file you need, just run the command lsusb in your terminal to get the vendor id and product id respectively. In your file you will get the information like:

TargetVendor=  0x12d1


You will have you own TargetVendor, Targetid, TargetMessage content.

Now go to terminal and run gedit /etc/mod_switch.conf and write the following lines in it:

DefaultVendor=  0x19d2
DefaultProduct= 0x2000

TargetVendor=   0x19d2
TargetProduct=  0x0031


Please make sure you put the right entry. Default vendor and product can be obtained from lsusb command. Target vendor, product and message content from the file I mentioned above. Save it and close the file.

Now open the terminal and run the following command:

sudo usb_modeswitch -c /etc/usb_modeswitch.conf 
| improve this answer | |

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.