I am running Ubuntu 13.10, 32-bit.
I had every time need to go terminal to "eject" the windows driver CD,nor gone to disk & eject windows driver CD to make the d-link dwm-156 gsm modem functioning through network manager.
It seems that usb mode switch is not working.
But on my friend's computer with ubuntu 14.04 ,usb mode switch is working and i can connect d-link dwm-156 to mobile broadband through network manager as soon as i get in.
Is there any way to make usb mode switch to eject the windows driver CD of d-link dwm-156 in my ubuntu 13.10,32-bit at start up?
The lsusb output is Bus 002 Device 013: ID 2001:a706 D-Link Corp
before ejecting the CD (modem as storage device of windows driver).
The lsusb output is Bus 002 Device 005: ID 2001:7d01 D-Link Corp
after ejecting the CD (as modem).
I don't want to use the driver in the CD,as i need to send sms & find the data usage.
Best Answer
GSM Modems with default ID 2001:a706 & target ID 2001:7d01
You must have usb switch mode installed (installed defaultly in every ubuntu)
Type in terminal:
Copy following lines to the newly opened file & save it:
Type in terminal:
Now your modem must be switched to modem mode by using usb switch mode of your Ubuntu (usually takes 10s to appear in NetworkManager)
Now you can make it Automatic Switching
Type in terminal:
Change the default ID(vendor & product) of one of the D-link with the ones in the text editor & save it as below:
Change the above code to the one below:
NOTE: Do not create any new file for your device if your device's name is not present in the gedit list, it will not work ,only just add your ID's in any of the device name in the list, any name would actually work, name does not matter, only default ID's needed. Now save it & reconnect your modem and it will be detected automatically as modem. If you want to see it from the terminal use
lsusb
which will show differently before and after reconnection. Before ejecting it would look like 2001:a706. After reconnecting it looked like 2001:7d01, which is Modem mode.You can find message content at /usr/share/usb_modeswitch/configPack.tar.gz and find suitable by appropriate name. without correct message content it is not possible to use usb mode switch, some may not be appropiate. So in general what you did was:
You are providing your device id's to usb modeswitch when you ran the
sudo gedit /etc/usb_modeswitch.d/2001:a706
line.You are making it work automatically by adding your default id's in
sudo gedit /lib/udev rules.d/40-usb_modeswitch.rules
Other Modems not mentioned above
You must have usb switch mode installed (comes installed by default in Ubuntu).
Open a terminal and type in the following, replacing the words default vendor id's, default product id's, target vendor id's, target product id's with the id's of your device
Copy the following lines & save them:
Type in the terminal:
Eg:
Now your modem must be switched to modem mode by using usb switch mode (Takes about 10s to appear in NetworkManager). Now make it automatic.
Type in terminal:
changing the default id(vendor & product) of one of modem with your ones & save it.
Change the above to look like the one below:
Like mentioned in the above cases, name does not matter, only default id's needed, save it & now reconnect your modem and it will be detected automatically as modem.
If you run the
lsusb
command you will see something like this:Where 2001=vendor id; a706=product id. Default vendor:product Id's obtained BEFORE ejecting the driver cd. here, i used- 2001:a706
Target vendor:product Id's obtained AFTER ejecting the driver cd (as modem mode). here, i used 2001:7d01
You can also find the message content at
/usr/share/usb_modeswitch/configPack.tar.gz
and find suitable for you by matching names, some may not be appropriate or at internet(difficult).Note ID's & message content are different for different modems.
So basically here you have done two things:
Provided your device id's by adding it in
sudo gedit /etc/usb_modeswitch.d/
You made it to work automatically by adding your default id's in udev rules of usb mode switch
Remember that the ID's look like the following for the D-link dwm 3.75G usb adapter:
2001:a706 (Before ejecting) 2001:7d01 (After ejecting),
The USB Modem is supported since 13.10 with the USB Mode Switch 1.2.3. In 14.04, which is 2.1.1 already has an updated Id list. If you are having any issues, update to the latest Ubuntu version.