Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

up vote 3 down vote accepted

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

MessageContent="5553424312345678000000000000061e000000000000000000000000000000"
MessageContent2="5553424312345679000000000000061b000000020000000000000000000000"

NeedResponse=1

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.

UPDATE
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

;MessageContent="55534243123456782000000080000c85010101180101010101000000000000"

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.

share|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
TargetProductList="140b,1506,150f"

MessageContent="55534243123456780000000000000011062000000100000000000000000000"

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

MessageContent="5553424312345678000000000000061e000000000000000000000000000000

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 
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.