Help with implementing usb_modeswitch
Solution 1
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.
Solution 2
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
Related videos on Youtube
oshirowanen
Updated on September 18, 2022Comments
-
oshirowanen over 1 year
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.
-
oshirowanen almost 13 yearsThe 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 almost 13 yearsI don't seem to have a usb_modeswitch.conf in /etc
-
binW almost 13 years@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'
-
oshirowanen almost 13 yearsthat is more or less what I did
sudo aptitude install usb-modeswitch
, and I have just done asudo aptitude reinstall usb-modeswitch
, but I still get no/etc/usb_modeswitch.conf
. When I typeusb_modeswitch
in the terminal, it says can't find/etc/use_modeswitch.conf
. -
oshirowanen almost 13 yearsI'm using Ubuntu 10.04.2, you're possibly using a different version of ubuntu?
-
binW almost 13 years@oshirowanen: I think in 10.04 there was also a package named usb-modeswitch-data. I may be forgetting the name but you can use aptitude to search for it. Installing it should create this file.
-
oshirowanen almost 13 yearsI think it's
usb-modeswitch-data
which got installed withusb-modeswitch
. -
binW almost 13 yearstry searching for usb_modeswitch.conf using locate. First call updatedb to update the search db and then use locate. another possible location for the file is /usr/local/etc/usb_modeswitch.conf
-
oshirowanen almost 13 yearsLooks like I'll have to wait till I upgrade my 10.04 to 12.04. Until then, I'll just have to unmount the drive manually to use it.