Recently I had to get a Huawei USB modem to work on Linux. It was a Tata Indicom Photon+ modem and it is detected as a flash drive in windows and automatically installs its drivers in windows. First I tried it on Ubuntu, and the experience was what I had expected. Plug n Play! Just brilliant. But my project requirement was to get it to work on Fedora 9 and that was no easy task. When I plugged in my modem, Fedora recognized it as a flash drive , then as a cd rom but never a modem.
Now in Windows, while the same thing happened but the modem drivers present on the flash drive made sure that the the device was switched from flash drive mode to the modem mode. No such things seemed to be present in Fedora. So after an hour or so of searching on the net, trying out various options, this is what I came up with.
Plug in your modem. Let it be recognized as a flash drive. Once that is done do lsusb. The out put will be something like this:
Bus 001 Device 001: ID 1d6b:0002
Bus 003 Device 001: ID 1d6b:0001
Bus 002 Device 002: ID 12d1:140b Huawei USB Device
Bus 002 Device 001: ID 1d6b:0001
Now the first number here is the vendor id (0x12d1) and the second one (0x0140b) is product id. These numbers will differ depending on the make and model of your modem.
Now do an su, and then:
modprobe usbserial vendor=0x12d1 product=0x140b
Now you need to install a software known as usb_modeswitch. You can get it here. Installation is a breeze. Once installed:
usb_modeswitch -v 0x12d1 -p 0x140b -H -W
My modem was a Huawei Modem, so I chose -H for huawei mode. You could look into the /etc/usb_modeswitch.conf to try out various permutations for your modem. Now this command inevitably gives an error for the first time. So give it again and then it works
Now try an ls /dev/ttyU* and you should be able to see at least one device, or may be more.
Now its time to configure the settings. Do wvdialconf and a file would be generated (/etc/wvidal.conf). Open it and modify the phone number (usually #777 for CDMA networks) and then username and password.
Now just do a wvdial and you should be connected within seconds.




24 comments
1 ping
Ajay
November 5, 2009 at 7:03 PM (UTC 5.5)
This works. But my problem is when I disconnect (killall pppd) , next time it doesn’t connect to server(I mean it doesn’t create ppp0 interface). I need to restart my machine to connect.
Abhishek
November 5, 2009 at 8:10 PM (UTC 5.5)
Which Linux distribution are you on? In my opinion, you can try two things. First, not to kill the daemon with the kill command but properly disconnect it with Ctrl+C signal. Second, If it still does not work, you could take out the card and put it back in, instead of rebooting the system.
balaji
November 10, 2009 at 12:50 PM (UTC 5.5)
hi i am able no connect tata photon using these steps. i need to connect two tata photons using the above steps.but when i do it its dialing through ttyusb0 only and not through other one. and am not able to get two ips….
please help me out…
through my observation i found that we use the vendor id and product id so when we use two tata photons the both ahs the same vendor and product id.so is there anyother way?
Abhishek
November 10, 2009 at 8:16 PM (UTC 5.5)
Even if you are using more than one modems on the same system, the usb modeswitch software should take care of all of them, if they are from the same vendor. What you need to do is to configure the file /etc/wvdial.conf accordingly. For example :
[Dialer Defaults]
Modem = /dev/ttyUSB0
Baud = 230400
Phone = #777
[Dialer card2]
Modem = /dev/ttyUSB3
This is just a scratch configuration. Please add the desired data from your wvdial.conf. Then you can use “wvdial” command for connecting with /dev/ttyUSB0 and “wvdial card2” for conecting with /dev/ttyUSB3 or whatever your card number might be.
balaji
November 18, 2009 at 10:10 AM (UTC 5.5)
hi do need to add the two dialer cards in the same wvdial.conf?
the problem that i faced while using the two tata photons of same vendor and product ids is that when follow the steps mentioned by and then try getting two different ip for two tata photons am not able to get the two ips for two modems..
Abhishek
November 18, 2009 at 11:51 AM (UTC 5.5)
Yes, u need to add two cards in the same wvdial.conf with different names. Then when u connect, you can use “wvdial name1″ and “wvdial name2″ for getting two ip addresses.
balaji
November 18, 2009 at 1:27 PM (UTC 5.5)
ok i will try and post the result.Thanks for your support
Sofia
November 17, 2009 at 5:06 PM (UTC 5.5)
Hi,
I need to connect tata photon in blackfin processor in uclinux environment.
Is there any software for that like usb_modeswitch to detect the modem.
Please post if there is any..
Abhishek
November 18, 2009 at 11:53 AM (UTC 5.5)
I have not worked on uclinux. But as you have the source code for usb_modeswitch, so you can use it to build an executable for uclinux too. You might need to modify the code to a small extent though.
balaji
November 18, 2009 at 10:29 AM (UTC 5.5)
hi one more help….
can we use the usb_modemswitch fin uclinux too?
Abhishek
November 18, 2009 at 11:49 AM (UTC 5.5)
theoretically yes. if we have a proper build environment for uclinux, we should be able to compile it and use the executable just like fedora or any other distribution.
balaji
November 18, 2009 at 2:44 PM (UTC 5.5)
hi i added two cards in tthe wvdial.conf file but i am getting only one device and not able to dial the new added devicea nd neither getting two ips for the two tata photons….what shall i do?
balaji
November 18, 2009 at 10:53 AM (UTC 5.5)
*for uclinux.
balaji
November 18, 2009 at 3:58 PM (UTC 5.5)
thanks for ur support..
hi i have dialed one tat photon perfectly.now i am trying to dial two tata photons at the same time, as per your suggestion i have modified the wvdial.conf file . But i am able to connect to only one device at a time.
i hav pasted the config file below
[Dialer Defaults]
Modem = /dev/ttyUSB0
Baud = 460800
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3 = AT+CRM=1
Stupid Mode = 1
ISDN = 0
Modem Type = Analog Modem
Phone = #777
Username = internet
Password = internet
then for the 2nd device i followed the same procedure, but it fails
error message Voice line detected..
i hope that im gettin this error due to same Vendor and Product ID to dial.
help me is there anything i should work on USB_MODESWITCH.c code.
give me some suggestions..
thanks
balaji
December 1, 2009 at 4:49 PM (UTC 5.5)
its working fine with two usb devices and able to dial two devices,got two different ip address…
loans
November 28, 2009 at 4:00 AM (UTC 5.5)
Very good post. You write verry good, keep up the good work and I will keep on visiting!
Sukanya
January 4, 2010 at 11:31 AM (UTC 5.5)
Hi,
I need to connect tata photon on blackfin in uclinux platform.
but i am facing difficulties when i try to cross compile usb_modeswitch with bfin-uclinux-gcc compiler. And tell me how to cross compile wvdial also..
need ur suggestion.
Sukanya
Mulch Hockessin de
March 14, 2010 at 11:09 AM (UTC 5.5)
outstanding post! great advice, will take on board!
ravi
May 4, 2010 at 10:32 PM (UTC 5.5)
Thx abhisek singh for ur wonderful post. I point out one small error(not sure I am a beginner in ubuntu) the line U had posted is
usb_modeswitch -v 0×12d1 -p -x140b -H -W, I had corrected as
usb_modeswitch -v 0×12d1 -p -0x140b -H -W U just missed one zero I think so
Abhishek
May 5, 2010 at 12:18 AM (UTC 5.5)
thanks. corrected!
neil dsouza
May 8, 2010 at 9:50 AM (UTC 5.5)
HI Abhishek,
excellent post. I have just got my photon working on ubuntu linux 9.10
Just some notes – which you may edit or delete
1. when the guy came for the demo he used his modem which was an epi valley or something. at that time it created a device /dev/ttyACM0
however when i was given my own device it was a huawei. and created a /dev/ttyUSB0
2. when I ran wvdialconf , it did not detect the baud rate correctly -
partial output below
————————————————-
WvModem: Cannot get information for serial port.
ttyUSB0: ATQ0 V1 E1 — OK
ttyUSB0: ATQ0 V1 E1 Z — OK
ttyUSB0: ATQ0 V1 E1 S0=0 — OK
ttyUSB0: ATQ0 V1 E1 S0=0 &C1 — OK
ttyUSB0: ATQ0 V1 E1 S0=0 &C1 &D2 — OK
ttyUSB0: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 — OK
ttyUSB0: Modem Identifier: ATI — Manufacturer: +GMI: HUAWEI TECHNOLOGIES CO., LTD
ttyUSB0: Speed 9600: AT — OK
ttyUSB0: Max speed is 9600; that should be safe.
———————————————–
I was a bit discouraged, however there is a tata document on their website for getting this to work on linux. so I put those settings – including “stupid mode=1″ , changed the baud rate to 230400 and it worked.
Thanks again
NEIL SEQ
July 9, 2010 at 2:50 PM (UTC 5.5)
I use UBUNTU 9.1.0 sugggest some help. i am Newbie in Linux
hcg diet tips
August 15, 2011 at 7:30 AM (UTC 5.5)
I haven¡¦t checked in here for a while since I thought it was getting boring, but the last several posts are great quality so I guess I will add you back to my daily bloglist. You deserve it my friend
Jill Langous
August 21, 2011 at 8:00 AM (UTC 5.5)
Greetings from New Farm. Thanks for the useful content. I’m doing a project at school and your stuff was quite useful. Thanks for sharing
Tataphoton+ and Linux « Suresh Kanzariya
May 26, 2010 at 6:08 PM (UTC 5.5)
[...] is very straight forward Article about getting usb modem to work on linux. The most annoying part is usb_modeswith utility. Download [...]